Openbsd+nginx+php+mysql

Source: Internet
Author: User
#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 '

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.