Linux Server Web Environment one-click installation package LANMP Tutorial Five

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

After we installed the Linux Server Web environment a key installation package LANMP, there may be a lot of questions there is the use of the process of the problem, the following for you to sum up a few more common, if there are other questions, you can go to the Wdlinux forum to find relevant tutorials.

1, add Apache support CGI program

Apache has supported CGI by default, but it is not enabled by default, and if CGI support is required, the following methods can be used

1

Vi/www/wdlinux/apache/conf/httpd-wdl.conf

At the end of the increase

AddHandler cgi-script. cgi. pl

Or

echo "AddHandler cgi-script. cgi. pl" >>/www/wdlinux/apache/conf/httpd-wdl.conf

2

Modify the virtual host configuration file/www/wdlinux/apache/conf/vhost/wdlinux.cn.conf, as follows

Options FollowSymLinks

AllowOverride All

Order Allow,deny

Allow from all

Modify Replace with

Options FollowSymLinks execcgi

AllowOverride All

Order Allow,deny

Allow from all

Actually, it adds "execcgi."

Back up Apache

Service httpd Restart

Now you can test

vi/www/web/wdlinux.cn/public_html/test.cgi

#!/usr/bin/perl

print "content-type:text/html nn";

foreach $var (sort (%env)) {

$val = $ENV {$var};

$val =~ s|n|\n|g;

$val =~ s| "| \ "|G;

Print "${var}=" ${val} "n";

}

Save

There is also a need to pay the right to execute this document, as

chmod 755/www/web/wdlinux.cn/public_html/test.cgi

2, solve Nginx 502 Bad gateway problem

Recently in the Joomla 1.5.18 a site from the virtual host of Apache moved to another VPS host Nginx, according to Joomla official Nginx rewrite rules modified Nginx configuration, the results of most of the pages are normal display, Only one Contact Us page encountered an error when sending mail: Nginx 502 Bad Gateway

System environment:

CentOS 6.4 86x64

Wdcp:wget http://dl.wdlinux.cn:5180/lanmp_laster.tar.gz

0C5D80FD4B28B7049D18275962F1FC09 lanmp_laster.tar.gz

Nginx 1.0.15

MySQL 5.1.63

PHP 5.2.17

There are 2 errors that are notable:

Tail/www/wdlinux/nginx_php-5.2.17/logs/php-fpm.log

[WARNING] Fpm_children_bury (), line 215:child 16523 (pool default) exited in signal after Sigterm From start

Tail/www/wdlinux/nginx/logs/error.log

[ERROR] 16501#0: Pocket recv () failed (104:connection reset by peer) while reading response header from upstream, client:123 .456.789, server:www.shop-yishunbike.com, request: "Post/index.php?option=com_contact&view=contact&id=1 &itemid=210 http/1.1 ", Upstream:" fastcgi://127.0.0.1:9000 ", Host:" ... ", referrer:" ........................."

Use site: () Search:

Site: (wdlinux.cn) recv () failed (104:connection reset by Peer)

Google Baidu on the above error search results are to modify the php.ini,php-fpm.conf,nginx.conf and other configuration, the results were unsuccessful

Turn around and think about these 2 error prompts, the Nginx error should be due to the Nginx submitted to PHP-FPM (127.0.0.1:9000) request did not get the correct reply, so it may be php-fpm problem.

So think of recompiling fpm-php, and the results are successful.

Recompile process:

Refer to the installation path for the lanmp.sh script in WDCP:

/configure--prefix= $IN _dir/$PHP _dir--with-config-file-path= $IN _dir/$PHP _dir/etc--with-mysql= $IN _dir/mysql- WITH-ICONV=/USR--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr- Disable-rpath--enable-discard-path--enable-inline-optimization--with-curl--enable-mbregex WITH-MCRYPT=/USR--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-ftp- Enable-zip $NV

Then refer to the Nginx article of the Big Brother, run the following command:

Tar zxf php-5.4.13.tar.gz

CD php-5.4.13

libs= "-lm-ltermcap-lresolv" dyld_library_path= "/www/wdlinux/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/ Usr/lib64/:/usr/local/lib64 "

Ld_library_path= "/www/wdlinux/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"

#./configure phase, followed by the-n option does not generate configuration, only test whether it can pass through, remove-N, and then run again

./configure--PREFIX=/WWW/WDLINUX/PHP2--with-config-file-path=/www/wdlinux/php2/etc--with-mysql=/www/wdlinux/ MySQL--with-mysqli=/www/wdlinux/mysql/bin/mysql_config--with-mcrypt=/usr--with-iconv-dir=/usr--with-libxml-dir =/USR--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--enable-xml- Enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--enable-mbregex Enable-mbstring--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl- With-xmlrpc--enable-zip--enable-soap-n

Make zend_extra_libs= '-liconv '

Make install

Close the original PHP-FPM

/ETC/INIT.D/PHP-FPM stop

Open a new PHP-FPM process

/www/wdlinux/php2/sbin/php-fpm

Open the Contact Us page, send the message, and send it successfully

3, Lanmp a key package, WDCP background, such as troubleshooting methods

Although I did not test the problem, but there are always some problems, perhaps with the environment, or perhaps with the operation.

Please remember, be sure to follow the instructions

First Use

Netstat-lnpt

Check which ports

If the background is not open, from the top to see if there are 8080 ports

A If yes, it may be the cause of the firewall, iptables-l-n view, or iptables-f clear and open again

B if not, may be not started or not installed successfully, you can start to see, such as service Wdapache start

80,88,21 are checked as described above

Related directories, starting, description please see

Http://www.wdlinux.cn/bbs/thread-192-1-1.html

This digest from Wdlinux forum http://www.wdlinux.cn/bbs/, welcome reprint ~

Related reading:

Linux Server one-click installation package LANMP one of a series of tutorials

Linux Server Web Environment one-click installation package LANMP Series two tutorials

Linux Server Web Environment one-click installation Package LANMP Series Tutorial Three

Linux Server Web Environment one-click installation package LANMP Series Tutorial Four

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.