cd /usr/ports/databases/mysql50-server/
make fetch
cd /usr/ports/www/nginx-devel/
make fetch
cd /usr/ports/lang/php5
make fetch
cd /usr/ports/www/lighttpd
make fetch
二、编译安装
MySQL
cd /usr/ports/distfiles/
tar -jxf mysql-5.0.51a.tar.gz
cd mysql-5.0.51a
./configure --prefix=/usr/local/vhost/mysql --with-charset=utf8 --with-extra-charsets=all --with-big-tables --with-pthread
make &&make install
Nginx
cd /usr/ports/devel/pcre
make install clean
cd /usr/ports/distfiles/
tar -jxf nginx-0.6.30.tar.gz
cd nginx-0.6.30
./configure --prefix=/usr/local/vhost/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_sub_module
make &&make install
Lighttpd
(安装lighttpd是为了得到启动fastcgi进程)
cd /usr/ports/distfiles/
tar -jxf lighttpd-1.4.19.tar.bz2
cd lighttpd-1.4.19
./configure --prefix=/usr/local/vhost/lighttpd
Php
cd /usr/ports/textproc/libxml2
make install clean
cd /usr/ports/ftp/curl
make install clean
cd /usr/ports/graphics/jpeg
make install clean
cd /usr/ports/graphics/png
make install clean
cd /usr/ports/devel/gettext
make install clean
cd /usr/ports/distfiles/
tar -jxf php-5.2.6.tar.bz2
cd php-5.2.6
./configure --prefix=/usr/local/vhost/php --with-mysql=/usr/local/vhost/mysql -enable-fastcgi --enable-sockets --enable-ftp --enable-zip --enable-mbstring --enable-mbregex --enable-calendar --with-curl=/usr/local/clude --with-curlwrappers --disable-debug --enable-inline-optimization --with-zlib --with-gd --with-kerberos --with-gettext --enable-force-cgi-redirect --with-jpeg-dir=/usr/inlocal/clude --with-png-dir=/usr/local/include --with-bz2 --enable-pcntl --with-iconv
make && make install
cp php.ini-dist /usr/local/vhost/php/lib/php.ini
三、配置
MySQL
cd /usr/local/vhost/mysql
pw adduser mysql -d /dev/null -s /sbin/nologin
bin/mysql_install_db
cp share/mysql/mysql.server ./
chmod +x mysql.server
chown -R mysql ./
测试配置文件
引用:sbin/nginx -t
2008/05/08 11:50:19 [info] 3336#0: the configuration file /usr/local/vhost/nginx/conf/nginx.conf syntax is ok
2008/05/08 11:50:19 [info] 3336#0: the configuration file /usr/local/vhost/nginx/conf/nginx.conf was tested successfully
vi html/phpinfo.php
<?php
phpinfo();
?>
启动测试
引用:/usr/local/vhost/nginx/sbin/nginx
在浏览器里输入
引用:https://192.168.29.128/phpinfo.php
安装配置phpMyadmin
cd /usr/ports/databases/phpmyadmin/
make fetch
cd /usr/ports/distfiles
tar -jxf phpMyAdmin-2.11.6-all-languages.tar.bz2
mv phpMyAdmin-2.11.6-all-languages /usr/local/vhost/nginx/html/dbadmin