Os:centos Release 5.5
lighttpd:1.4.28
Installation
sudo yum install lighttpd.i386 lighttpd-fastcgi.i386 lighttpd-mod_mysql_vhost.i386
Run
Check configuration file
Lighttpd-t-F lighttpd.conf
Start the LIGHTTPD service
Lighttpd-d-F lighttpd.conf
End LIGHTTPD Service
CTRL + C
Or use Linux's system service to start stop LIGHTTPD service
/ETC/INIT.D/LIGHTTPD Start/stop/restart
Test
Create a file index.html in the/SRV/WWW/LIGHTTPD directory, which reads as follows:
Hello lighttpd!
Then visit: http://localhost/index.html
Configuring PHP Support
Edit the/etc/lighttpd/modules.conf file to remove the comments in front of the line
Include "conf.d/fastcgi.conf"
Edit the/etc/lighttpd/conf.d/fastcgi.conf file and add the following line
Copy Code code 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, which reads as follows:
Copy Code code as follows:
Then visit: http://localhost/test.php