GIT – Enjoy our step-by-step guide to configuring 5 with FPM, Web server, and 5.5, on :1. FreeBSD 7 compatibility and standard packages

cd /usr/ports/misc/compat7x
make all
make install
pkg_add -r libevent
pkg_add -r libtool
pkg_add -r m4
pkg_add -r pcre
pkg_add -r pdftk
pkg_add -r rsync
pkg_add -r vim
pkg_add -r wget

2. Install ProFTPD

make all
make install

3. Install NGinx

Make sure you click to enable ‘HTTP_GZIP_STATIC_MODULE’, ‘HTTP_SSL_MODULE’ and ‘HTTP_ZIP_MODULE’

cd /usr/ports/www/nginx
make all
make install
echo “nginx_enable=YES” >> /etc/rc.conf
echo “<?php phpinfo(); ?>” >> /usr/local/www/nginx/phpinfo.php

You can always run make config to redo the configuration options

4. Install CURL+LibXML

cd /usr/ports/ftp/curl
make all
make install
cd /usr/ports/textproc/libxml
make all
make install

5. Install MySQL client and server

cd /usr/ports/databases/mysql55-server
make all
make install
cd /usr/ports/databases/mysql55-client
make all
make installvi /etc/my.cnf
Change to this config

innodb_buffer_pool_size = 1200M
sync_binlog=1relay-log = /usr/local/mysql/data/
relay-log-index = /usr/local/mysql/data/db-relay-bin.index
log-error = /var/log/mysql-errors.log
slow-query-log = /var/log/mysql-slow.log
slave_exec_mode = IDEMPOTENT
replicate-same-server-id = 0character_set-server = utf8datadir = /usr/local/mysql/data
innodb_data_home_dir = /usr/local/mysql/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/data
innodb_log_files_in_group = 2
innodb_log_file_size = 5242880innodb_thread_concurrency=8
datetime_format = %Y%m%d%H%i%s
delayed_insert_timeout = 3000
innodb_lock_wait_timeout = 600
interactive_timeout = 50
net_read_timeout = 300
net_write_timeout = 600skip-name-resolve
max_connections = 200
key_buffer = 50M
key_buffer_size = 1M
myisam_sort_buffer_size = 1M
join_buffer_size = 64M
read_buffer_size = 1M
sort_buffer_size = 1M
read_rnd_buffer_size = 768K
table_cache = 200
thread_cache_size = 80
wait_timeout = 100
connect_timeout = 100
#tmp_table_size = 128M
bulk_insert_buffer_size = 8M
max_allowed_packet = 64M
max_connect_errors = 500
query_cache_limit = 1M
query_cache_size = 64M
query_cache_type = 1
default-storage-engine = InnoDB
max_allowed_packet = 16M[mysql]
# Remove the next comment character if you are not familiar with SQL
key_buffer = 64M
sort_buffer_size = 1M
read_buffer = 16M
write_buffer = 16M[mysqlimport]
local = 1

mkdir /usr/local/mysql
mkdir /usr/local/mysql/data
chmod 777 /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
chmod -R 777 /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql

6. Install GD

cd /usr/ports/graphics/ruby-libpng
make all
make install

7. Install PHP 5

make all
make install
cd /usr/ports/devel/php5-pcntl
make all
make installcd /usr/tmp
fetch “”
tar xvfz php-5.2.8.tar.gz
fetch “”
gzip -cd php-5.2.8-fpm-0.5.10.diff.gz | patch -d php-5.2.8 -p1
fetch “”
gzip -cd suhosin-patch-5.2.8- | patch -d php-5.2.8 -p1cd php-5.2.8
./configure –with-config-file-path=/usr/local/lib/ –enable-pcntl –enable-fastcgi–enable-fpm –enable-calendar –enable-ftp –enable-mbstring –with-mysql –with-curl –with-mcrypt –with-gd –with-iconv –with-jpeg-dir=/usr/lib –with-mysql=/usr/local/mysql –enable-memcache –with-openssl –enable-soap –enable-sockets –with-zlib –enable-zip –enable-bcmath –with-ttf –enable-gd-native-ttf –with-freetype-dir=/usr/local/lib/ –enable-pdo –with-pdo_mysql –enable-suhosin
make all install
fetch “”
mv php-fpm.conf /usr/local/etc/php-fpm.conf
fetch “”
mv nginx.conf /usr/local/etc/nginx/nginx.conf

8. Install Memcached

cd /usr/ports/databases/memcached
make all
make install

9. Install HAProxy

cd /usr/ports/net/haproxy
make all
make install

10. Start MySQL and NGinx

/usr/local/bin/mysqld_safe &
/usr/local/sbin/php-fpm start
/usr/local/etc/rc.d/nginx start

Verify MySQL is working properly:

Attempt connecting to MySQL:

/usr/local/bin/mysql -uroot

Verify NGinx is working properly:

Point your browser to (replacing with the PUBLIC ip address of the server)

Verify PHP is working properly:

Point your browser to (replacing with  ip address of the server).

If you see the PHP info screen, all is well

Print Friendly, PDF & Email



Bài viết liên quan