这里是自己使用源码编译安装。
需要下载MySQL-4.0.25源码包。
wget xxx
tar -zxvf mysql-4.0.25.tar.gz -C src
cd src/mysql-4.0.25/
./configure –prefix=/opt/modules/mysql
–enable-assembler
–with-mysqld-ldflags=-all-static
–with-charset=gb2312
–without-debug
make install
/opt/modules/mysql/bin/mysql_install_db
chown -R mysql.mysql /opt/modules/mysql/var
chgrp mysql /opt/modules/mysql
./configure
–prefix=/opt/modules/phpcgi
–enable-fastcgi
–enable-force-cgi-redirect
–enable-bcmath
–enable-inline-optimization
–enable-magic-quotes
–enable-wddx–disable-debug
–enable-sysvmsg
–enable-sockets
–enable-mbstring
–enable-calendar
–with-trans-sid
–with-ldap
–with-ldap-sasl
–with-mysql=/opt/modulels/mysql
make install clean
server.document-root = “/opt/data/www/”
将 #”mod_fastcgi”, 的#去掉
#### fastcgi module
## read fastcgi.txt for more info
fastcgi.server = ( “.php” =>
( “localhost” =>
(
“socket” => “/tmp/php-fastcgi.socket”,
“bin-path” => “/opt/modules/phpcgi/bin/php”,
# 如果你的网站很繁忙,可以加入如下设置
#”bin-environment” => (
# “PHP_FCGI_CHILDREN” => “16″,
# “PHP_FCGI_MAX_REQUESTS” => “10000″
#)
)))
touch /var/log/lighttpd.access.log
chown www:www /var/log/lighttpd.*
4.5.1 创建证书
cd /opt/etc/
openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
4.5.2 打开SSL支持
#### SSL engine
ssl.engine = “enable”
ssl.pemfile = “/opt/etc/server.pem”
默认的监听端口是 80,如果需要更改端口,可以修改配置设定。
## bind to port (default: 80)
#server.port = 81
5.1 设置自动启动
vi /etc/rc.conf
lighttpd_enable=”YES”
5.2 手工启动
/usr/local/etc/rc.d/lighttpd.sh start
注意,如果没有在/etc/rc.conf添加 /etc/rc.conf ,是不能启动的。所以需要先添加。