Build a lighttpd + fastcgi + php5 + mysql environment on debian4

Source: Internet
Author: User
Build a lighttpd + fastcgi + php5 + mysql Environment On Debian 4-Linux Enterprise Application-Linux server application information. The following is a detailed description. Recently, I was excited to build a php Forum In debian or supplement it to the server. Therefore, my work in the past few days gave birth to this work note. For the time being, I put gentoo on hold for the rest of the work. It is not intended to continue, but just a slight conversion.

Speaking of this, if we use two identical IDE hard disks, we still have a good choice for raid + lvm, which greatly improves both speed and stability, this is because I am using my company's unprocessed garbage to build, the configuration is antique: C633, SDR128M, 15Ghd. (It's really cool)

No more nonsense. Let's get started! It is used in the disc generated by the installation CD of the officially downloaded dibian netinstall to boot the system and then how to install it. No nonsense, I press

/Boot 128 M ext2
Swap 256 M
/Give him all ext3

After the format is divided into good zones, we recommend that you do not directly connect to the network cable and update it immediately, because your network is not necessarily fast. Even if it is fast, you cannot connect to cn99 quickly, so install the basic system and restart it. I want to talk about the problem again. If you carefully read my gentoo notes, you will feel that it is very easy to build raid + lvm. So gentoo is a good tool for learning linux.

Continue. After debian is installed, First Change The Source: nano? W/etc/apt/sources. list (nano is used to it now. Gentoo habits .) I had a fast connection to cn99 before. At present, it is worse to connect to ADSL. I changed it to The ustc source, which is quite good. I posted the complete ustc source. You should pay attention to it, because I found that many websites have found ustc, the source of cn99 is incomplete.

Deb http://debian.ustc.edu.cn/debian stable main non-free contrib

Deb-src http://debian.ustc.edu.cn/debian stable main non-free contrib

Deb http://debian.ustc.edu.cn/debian proposed-updates main contrib non-free

Deb-src http://debian.ustc.edu.cn/debian proposed-updates main contrib non-free

Deb http://debian.ustc.edu.cn/debian-security stable/updates main

Use the above source to update: aptitude update; aptitude upgrade; OK. The update is complete. If the system time is abnormal In debian or ubuntu, if there is a big difference from the standard time, there will be a GPG error, as long as you use the date command to change back to the normal time.

After the update, we start to build the environment: Aptitude install lighttpd mysql-server php5-cgi php5-mysql

After downloading and installing all the other packages, configure these items:

Configure php: Modify/etc/php5/cgi/php. ini and add cgi. fix_pathinfo = 1

Configure lighttp:

Modify/etc/lighttpd. conf and add mod_fastcgi to server. modules as follows:

Server. modules = (
"Mod_access ",
"Mod_alias ",
"Mod_accesslog ",
"Mod_fastcgi ",
"Mod_rewrite ",
)

Then, it is transferred to the end of the file, and the following code is added:

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

Next, modify the default mysql password: mysqladmin? U root password <你设置的密码> Congratulations, a basic lighttpd + fastcgi + php5 + mysql environment has been set up.

To complete the setting of a virtual directory, enable/etc/lighttpd. conf. In the # virtual line, you can add the desired virtual directory: (I will give an example)

Alias. url = ("/bbs/" => "/var/www/bbs/") the default lighttpd web directory is under/var/www. By the way, you should be reminded of the directory permissions. In general, it is best to enable only the lowest permissions, security first.

Here, I want to add the content that I forgot just now. The network is not configured during installation. After debian is installed, the network must be configured before aptitude can be installed.

Edit the/etc/network/interfaces file: Add:

Auto eth0

Iface eth0 inet dhcp

I still use dhcp =.

Well, basically, this environment In debian has been set up. You can create a vsftpd on your own to upload files .. This is also very simple. You only need to pay attention to the permission to upload files.

Author: darwinux
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.