Lighttpd mysql php simple tutorial, lighttpdmysql
Lighttpd mysql phpSimple tutorial
Lighttpd + php5 + mysql + Debian etch
Lighttpd is the fastest static web server, and mysql is the most common database server.
Let's take a look at lighttpd. After debian is installed, everything is easy.
Log on to debian through ssh first
1. # apt-get install lighttpd
2, # apt-get install php5-cgi
Configure php
# Vi/etc/php5/cgi/php. ini
Add at the end of php. ini
Cgi. fix_pathinfo = 1
3. Configure lighttpd to support php
# Vi/etc/lighttpd. conf
Added the fastcgi module:
Server. modules = (
"Mod_access ",
"Mod_alias ",
"Mod_accesslog ",
"Mod_rewrite ",
"Mod_fastcgi ",
)
Of course you can choose another module you need // http://www.pprar.com
Modify the sequence of the main page file and put index.html before index. php (based on the needs of the program to be installed)
Index-file.names = (jsonindex.html "," index. php ",
“Index.htm ", “default.htm ")
Add data transmission mode (this is required or cannot be run)
Server. network-backend = "writev"
Then, add:
Fastcgi. server = (". php" => ((
"Bin-path" => "/usr/bin/php5-cgi ",
"Socket" => "/tmp/php. socket"
)))
After modification, restart lighttpd:
#/Etc/init. d/lighttpd restart
4. Test whether php is started normally.
# Vi/var/www/phpinfo. php
Add the following content
Then, check whether the http: // mss ip Address/phpinfo. php is displayed normally.
5. install php-related modules
Find available php modules
# Apt-cache search php5
Php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy
Generally there are the following modules, must be installed is a php5-mysql, other can be installed as needed
# Apt-get install php5-mysql
6. Install MYSQL
Debian is also very simple.
# Apt-get install mysql-server
Note: Set the root password.
Wordpress installation should not be difficult. Note that html-Based Static plug-ins must be installed. I have installed wp super cache to take full advantage of lighttpd. The entire installation was basically not optimized. It was found that M was not enough and about 15 m of swap was used. I began to consider removing mysql and switching to sqlite.
If a 100% MHz CPU executes dynamic php, it will certainly load, but if it is static html, the cpu is basically not under pressure, and the speed is extremely fast.