Openbsd + nginx + php + mysql # export PKG_PATH = ftp://ftp.openbsd.org/pub/OpenBSD/4.8/packages/amd64/
# Pkg_add-r nginx-0.7.67 mysql-server-5.1.48 php5-fastcgi-5.2.13p0 php5-gd-5.2.13p0-no_x11 php5-mysql-5.2.13p0 spawn-fcgi-1.6.3p0
# Vi/etc/rc. local:
-----------------------------------------------------
# Start MySQL
If [-x/usr/local/bin/mysqld_safe]; then
Echo-n'starting MySQL ...'
Su-c mysql root-c '/usr/local/bin/mysqld_safe>/dev/null 2> & 1 &'
Echo "DONE"
Fi
# Start php-fastcgi
If [-x/usr/local/bin/spawn-fcgi]; then
Echo-n 'starting php-fastcgi ...'
/Usr/local/bin/spawn-fcgi-a 127.0.0.1-p 9000-C 6-u www-f/usr/local/bin/php-fastcgi>/var/run/ fcgi. pid
Echo "DONE"
Fi
# Start nginx
If [-x/usr/local/sbin/nginx]; then
Echo-n'starting nginx ...'
/Usr/local/sbin/nginx
Echo "DONE"
Fi
-----------------------------------------------------
# Ln-s/var/www/conf/modules. sample/php5.conf/var/www/conf/modules/php5.conf
# Ln-s/var/www/conf/php5.sample/gd. ini/var/www/conf/php5/gd. ini
# Ln-fs/var/www/conf/php5.sample/mysql. ini/var/www/conf/php5/mysql. ini
# Vi/etc/nginx. conf
--------------------------------------------------------
Location /{
Root/var/nginx/html;
Index. php index.html index.htm;
}
Location ~ \. Php $ {
Root html;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME/var/nginx/html $ fastcgi_script_name;
Include fastcgi_params;
}
--------------------------------------------------------
# Vi/etc/sysctl. conf
-----------------------------------------------------------
Kern. maxfiles = 65535
-----------------------------------------------------------
# Vi/etc/login. conf
-----------------------------------------------------------
#
# MySQL
#
Mysql :\
: Openfiles-cur = 1024 :\
: Openfiles-max = 2048 :\
: Tc = daemon:
-----------------------------------------------------------
# Cap_mkdb/etc/login. conf
#/Usr/local/bin/mysql_install_db
#/Usr/local/bin/mysqladmin-u root password 'yourpassword'