OS: centos release 5.5
Lighttpd: 1.4.28
Install
Sudo Yum install Lighttpd. i386 lighttpd-fastcgi.i386 lighttpd-mod_mysql_vhost.i386
Run
Check the configuration file
Lighttpd-T-F Lighttpd. conf
Start the Lighttpd Service
Lighttpd-D-F Lighttpd. conf
End Lighttpd Service
CTRL + c
Or use Linux system services to start and stop the Lighttpd service.
/Etc/init. d/Lighttpd start/stop/restart
Test
Create an index.html file in the/srv/www/lighttpddirectory. The content is as follows:
Hello Lighttpd!
Then access: http: // localhost/index.html
Configure PHP support
Edit the/etc/Lighttpd/modules. conf file and delete the comments before the following lines.
Include "Conf. d/FastCGI. conf"
Edit the/etc/Lighttpd/CONF. d/FastCGI. conf file and add the following linesCopyCodeThe Code is as follows: FastCGI. Server = (". php" =>
("Localhost" =>
(
"Socket" => "/tmp/php-fastcgi.socket ",
"Bin-path" => "/usr/bin/PHP-cgi"
)
)
)
Create a file test. php In the/srv/www/Lighttpd directory. The content is as follows:Copy codeThe Code is as follows: <?
Phpinfo ();
?>
Then access: http: // localhost/test. php