首页 > 后端开发 > php教程 > openbsd+nginx+php+mysql

openbsd+nginx+php+mysql

WBOY
发布: 2016-06-23 14:36:18
原创
957 人浏览过

#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/nginx.conf

--------------------------------------------------------

location / {
            root   /var/nginx/html;
            index  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'

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板