Lighttpd mysql php simple tutorial

Source: Internet
Author: User

The following is a simple process

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 select other modules you need,

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.