Install Lighttpd + Php5 + Mysql website server on Ubuntu11.04
Source: Internet
Author: User
Install Lighttpd + Php5 + Mysql website server-Linux Enterprise Application-Linux server application on Ubuntu11.04. For more information, see the following. [I = s] This post was last edited by duxuejiang
Lighttpd is rarely heard of. Let's talk about Lighttpd. Lighttpd is an open-source Web server software led by Germans. Its fundamental goal is to provide a website dedicated to high-performance websites, secure, fast, compatible, and flexible web server environment. It features low memory overhead, low cpu usage, good performance, and rich modules.
Lighttpd is one of the many OpenSource lightweight web servers. It supports important functions such as FastCGI, CGI, Auth, output compress, URL rewriting, and Alias. Apache is popular because of its rich functions, many functions of lighttpd are implemented accordingly. This is very important for apache users, because these problems must be addressed when migrating to lighttpd.
This tutorial is similar to the "Ubuntu 11.04 Web server for installing Nginx + Php5 + Mysql" that was not released recently. It is from the same website, howtoforge.com.
1. instructions before installation
In this tutorial, the host name server1.example.com and IP address 192.168.0.100 are used. These settings may be different from your settings, so you must change them as appropriate.
Many operations require a Super User Name, so to avoid the trouble, we first switch to the Super User name for the operation, terminal input command:
Sudo su
Ii. Install MySQL 5
Run the following command on the terminal:
Apt-get install mysql-server mysql-client
During installation, you need to set the mysql super root user password and enter the password twice:
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // imcn. me/wp-content/uploads/2011/06/mysqlps-620x391.png '); ">
3. Install lighttpd
Lighttpd is also available in the ubuntu software library. Just like installing apache and nginx, you can run the following command:
Apt-get install lighttpd
Then, enter http: // 192.168.0.100/index.lighttpd.html in the browser, and you will see the lighttpd page. The page shows that the installation is successful and the operation is normal:
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // imcn. me/wp-content/uploads/2011/06/index.lighttpd.png '); ">
Here, the default root directory of Lighttpd in ubuntu is/var/www, And the configuration file/etc/lighttpd. conf, default website configuration file:/etc/lighttpd/conf-available, lighttpd can enable the configuration command: lighttpd-enable-mod, lighttpd disable configuration command: lighttpd-disable-mod
4. Install PHP5
You can install PHP5 FastCGI to run it with lighttpd. The Ubuntu Library provides the FastCGI function PHP5 solution. We can install it like this:
Apt-get install php5-cgi
5. Configure lighttpd and PHP5
Configure php5 to enable lighttpd and modify/etc/php5/cgi/php. ini and the comment line cgi. fix_pathinfo = 1:
Vi/etc/php5/cgi/php. ini
Configure the following code:
; Cgi. fix_pathinfo provides * real * PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; Previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; What PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; This to 1 will cause php cgi to fix its paths to conform to the spec. A setting
; Of zero causes PHP to behave as before. Default is 1. You shoshould fix your scripts
; To use SCRIPT_FILENAME rather than PATH_TRANSLATED.
Http://php.net/cgi.fix-pathinfo
Cgi. fix_pathinfo = 1
[/Indent] to enable FastCGI configuration, run the following command:
Lighttpd-enable-mod fastcgi
Lighttpd-enable-mod fastcgi-php
Create a link character/etc/lighttpd/conf-enabled/10-fastcgi.conf pointing to/etc/lighttpd/conf-available/10-fastcgi.conf and/etc/lighttpd/conf-enabled/15-fastcgi-php.conf. Point to/etc/lighttpd/conf-available/15-fastcgi-php.conf:
Ls-l/etc/lighttpd/conf-enabled
As shown below:
Root @ server1 :~ # Ls-l/etc/lighttpd/conf-enabled
Total 0
Lrwxrwxrwx 1 root 33 10-fastcgi.conf-> ../conf-available/10-fastcgi.conf
Lrwxrwxrwx 1 root 37 15-fastcgi-php.conf-> ../conf-available/15-fastcgi-php.conf
Root @ server1 :~ #
Then, reload the lighttpd:
/Etc/init. d/lighttpd force-reload
6. Test PHP5/obtain installation details about PHP5
Create an info. php file for debugging and check that the modules are running.
Vi/var/www/info. php
Add the following code. Because this is a function and runs back in wordpress, you need to change the double quotation marks to single quotation marks:
《? Php
Phpinfo ();
"
Enter http: // 192.168.0.100/info. php In the browser. We will see:
(400) {this. resized = true; this. width = 400; this. alt = 'click here to open new window';} "onmouseover =" if (this. resized) this. style. cursor = 'hand'; "onclick =" window. open ('HTTP: // imcn. me/wp-content/uploads/2011/06/phpinfo.png '); ">
If you see the above, PHP5 works normally, continue to scroll down to see the PHP5 module you have started. MySQL is not listed, which means we have not added MySQL module support in PHP5.
7. Obtain MySQL support in PHP5
Some modules need to be installed. Let's first check:
Apt-cache search php5
Then enter the following command:
Apt-get install php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp
Then restart Lighttpd:
/Etc/init. d/lighttpd restart
Check whether the mysql module is available and refresh your page: http: // 192.168.0.100/info. php.
Related website links:
Lighttpd: http://www.lighttpd.net/
PHP: http://www.php.net/
MySQL: http://www.mysql.com/
Ubuntu: http://www.ubuntu.com/
Original
Reprinted from IMCN
Link:Install lighttpd + php5 + mysql website server on ubuntu 11.04
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