Ubuntu manual compilation and installation of Lighttpd configuration to run PHP

Source: Internet
Author: User
Install a lighttpdhttp server on the Linux server and test the performance by using a program. It should be easy to install lighttpd. I don't care about it. I just want to install it when my hands are busy. This morning, I started to install the command. When I installed the command, why? If the make command is unavailable, I asked the boss how to make the command. The boss replied that our servers are all lite and there is no compilation tool. Compile and install it on another linux machine, and then port it to this machine. I fainted on the spot. Although dizzy, you have to do it.

Install a lighttpd http server on the Linux server and test the performance by using a program. It should be easy to install a lightt pd. I don't care about it. I just want to install it when my hands are busy.

This morning, I started to install the command. When I installed the command, why? If the make command is unavailable, I asked the boss how to make the command. The boss replied that our servers are all lite and there is no compilation tool. Compile and install it on another linux machine, and then port it to this machine. I fainted on the spot.

Although dizzy, it still has to work. I am using Ubuntu 11.10, so sudo apt-get install lighttpd directly, run, OK, run successfully! Add

Fastcgi. server = (". php" =>
("Localhost" =>
(
"Socket" => "/tmp/php. socket ",
"Bin-path" => "/usr/bin/php5-cgi"
)
)
)

Save and run/etc/init. d/lighttpd restart. php can run (because php is installed previously ).

However, this is only installed using the apt-get tool. It does not work, so apt-get remove lighttpd is uninstalled. Re-compile and install.

Run the following commands in sequence:

Download lighttpd-1.4.19.tar.gz

Free onHttp://linux.linuxidc.com/

Both the user name and password areWww.linuxidc.com

The specific download directory is in/Pub/2011/12/06/Ubuntu manual compilation and installation Lighttpd configuration run PHP/

Then

Tar zxvf lighttpd-1.4.19.tar.gz

Cd lighttpd-1.4.19.tar.gz

./Configure -- prefix =/usr/local/lighttpd/

Some associated packages may not exist during execution. you can install these packages on your own.

Make

Make install

Copy all the files under doc/config to/usr/local/lighttpd/conf. Conf creates another log directory for the self-created directory.

Set the path and Log Path in lighttpd. conf. OK.

Run

/Usr/local/lighttpd/sbin/lighttpd-f/usr/local/lighttpd/conf/lighttpd. conf

Enable http: // localhost/to run.

Supports running php.

Add

Fastcgi. server = (". php" =>
("Localhost" =>
(
"Socket" => "/tmp/php. socket ",
"Bin-path" => "/usr/bin/php5-cgi"
)
)
)

 

Run killall lighttpd.

/Usr/local/lighttpd/sbin/lighttpd-f/usr/local/lighttpd/conf/lighttpd. conf

Open php and you will find a 403 forbidden access error. (I have been stuck here for a long time ).

The error is that the fastcGI module is not added to modules. conf.

Open modules. conf,

Server. modules = (
"Mod_access ",
"Mod_alias ",
# "Mod_auth ",
# "Mod_evasive ",
"Mod_redirect ",
"Mod_rewrite ",
"Mod_fastcgi ",
"Mod_cgi ",
# "Mod_setenv ",
# "Mod_usertrack ",
)

Add "mod_fastcgi ",
"Mod_cgi ",
Save. Restart lighttpd.

OK. Put the file on the server and run it.

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.