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


cd 
/usr/ports/ftp/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

[mysqld]
myisam-recover=backup,forceinnodb_file_per_table
innodb_buffer_pool_size = 1200M
innodb_flush_log_at_trx_commit=1
sync_binlog=1relay-log = /usr/local/mysql/data/relay-log.info
relay-log-index = /usr/local/mysql/data/db-relay-bin.index
log-bin-trust-function-creators=1log-bin=mysql-bin
log-error = /var/log/mysql-errors.log
log-output=file
slow-query-log = /var/log/mysql-slow.log
skip-slave-start
slave_exec_mode = IDEMPOTENT
slave-skip-errors=1062log-slave-updates
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
#max_heap_table_size=128M
#max_tmp_tables=32
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
[mysqldump]
quick
max_allowed_packet = 16M[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates[isamchk]
key_buffer = 64M
sort_buffer_size = 1M
read_buffer = 16M
write_buffer = 16M[mysqlimport]
local = 1
character-sets-dir=utf8
default-character-set=utf8

mkdir /usr/local/mysql
mkdir /usr/local/mysql/data
chmod 777 /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
/usr/local/bin/mysql_install_db
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


cd 
/usr/ports/security/libmcrypt
make all
make install
cd /usr/ports/devel/php5-pcntl
make all
make installcd /usr/tmp
fetch “http://www.gocit.vn/files/php-5.2.8.tar.gz”
tar xvfz php-5.2.8.tar.gz
fetch “http://www.gocit.vn/files/php-5.2.8-fpm-0.5.10.diff.gz”
gzip -cd php-5.2.8-fpm-0.5.10.diff.gz | patch -d php-5.2.8 -p1
fetch “http://www.gocit.vn/files/suhosin-patch-5.2.8-0.9.6.3.patch.gz”
gzip -cd suhosin-patch-5.2.8-0.9.6.3.patch.gz | 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 “http://www.gocit.vn/files/php-fpm.conf”
mv php-fpm.conf /usr/local/etc/php-fpm.conf
fetch “http://www.gocit.vn/files/nginx.conf”
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 http://1.2.3.4/ (replacing 1.2.3.4 with the PUBLIC ip address of the server)

Verify PHP is working properly:

Point your browser to http://1.2.3.4/phpinfo.php (replacing 1.2.3.4 with  ip address of the server).

If you see the PHP info screen, all is well

Print Friendly

Comments

comments

Bài viết liên quan