Lanmp one-click installation package series tutorial 4

Source: Internet
Author: User
Tags mcrypt connection reset
After we have installed the linux server WEB environment with one-click installation package lanmp, there may be many questions about the problems encountered during the use process. The following are some common examples. if you have other questions, go to the wdlinux forum to find related tutorials. 1. added apache support for CGI programs... after we have installed the linux server WEB environment with one-click installation package lanmp, there may be many questions about the problems encountered during the use process. The following are some common examples. if you have other questions, go to the wdlinux forum to find related tutorials.
1 Add apache CGI supported Program
CGI is supported by apache by default, but it is not enabled by default. to support CGI, use the following method:
1
Vi/www/wdlinux/apache/conf/httpd-wdl.conf
Add at last
AddHandler cgi-script. cgi. pl
Or
Echo "AddHandler cgi-script. cgi. pl">/www/wdlinux/apache/conf/httpd-wdl.conf

2
Modify the VM configuration file/www/wdlinux/apache/conf/vhost/wdlinux.cn. conf.

Options FollowSymLinks
AllowOverride All
Order allow, deny
Allow from all

Replace

Options FollowSymLinks ExecCGI
AllowOverride All
Order allow, deny
Allow from all

Actually, "ExecCGI" is added"

Restart apache
Service httpd restart

Now let's test it.
Vi/www/web/wdlinux.cn/public_html/test.cgi
#! /Usr/bin/perl
Print "Content-type: text/html \ n ";
Foreach $ var (sort (keys (% ENV ))){
$ Val = $ ENV {$ var };
$ Val = ~ S | \ n | g;
$ Val = ~ S | "| \" | g;
Print "$ {var }=\" $ {val} \ "\ n ";
}
Save

You also need to pay for the execution right of this file, as shown in figure
Chmod 755/www/web/wdlinux.cn/public_html/test.cgi
 
2 Solve nginx 502 bad gateway Problem
Recently, I moved a joomla 1.5.18 site from apache of the VM to nginx of another VPS host, and modified the nginx configuration according to the nginx rewrite rule officially provided by joomla, most of the web pages in the results are normally displayed. when sending an email, only one page with a contact us has an error: 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

Two errors are noticeable:
Tail/www/wdlinux/nginx_php-5.2.17/logs/php-fpm.log
[WARNING] fpm_children_bury (), line 215: child 16523 (pool default) exited on signal 15 SIGTERM after 1868.423609 seconds from start
Tail/www/wdlinux/nginx/logs/error. log

[Error] 16501 #0: * 5 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 :"........................."

Search by site:

Site :( wdlinux.cn) recv () failed (104: Connection reset by peer)

Google Baidu on the above error search results are to modify php. ini, php-fpm.conf, nginx. conf and other configuration, the results were not successful
Let's look back and think about the two error prompts. The nginx error should be caused by the failure to get a correct response from the request submitted by nginx to php-fpm (127.0.0.1: 9000, so it may be a problem with php-fpm.
So I think Recompile Fpm-phpThe result is successful.

Re-compilation process:
Refer to the installation path of 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 -- enable-xml -- disable- rpath -- enable-discard-path -- enable-inline-optimization -- with-curl -- enable-mbregex -- enable-mbstring -- with-mcrypt =/usr -- with-gd -- enable-gd -native-ttf -- with-openssl -- with-mhash -- enable-ftp -- enable-sockets -- enable-zip $ NV


For more information, see The nginx article of Dr. Zhang banquet and 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/:/usr/local/lib: /lib64/:/usr/lib64/:/usr/local/lib64"
LD_LIBRARY_PATH = "/www/wdlinux/mysql/lib/:/usr/local/lib:/lib64/:/usr/lib64 /: /usr/local/lib64"

#./In the configure stage, add the-n option next to it to test whether the configuration is successful. If yes, remove-n and run it 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 -- disable-rpath -- enable-bcmath -- enable-shmop -- enable-sysvsem -- enable-inline-optimization -- with-curl -- enable-mbregex -- enable-fpm -- enable-mbstring --- gd -- enable-gd-native-ttf -- with-openssl -- with-mhash -- enable-pcntl -- enable-sockets -- with-xmlrpc -- enable-zip -- enable-soap-n
Make ZEND_EXTRA_LIBS = '-liconv'
Make install

Disable 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 and send the email. the email is sent successfully.
 
 
3 Lanmp One-click package, wdcp Troubleshooting methods such as background
Although I did not test it, there are still some problems, maybe related to the environment or operations.
Please remember to follow the instructions

Use
Netstat-lnpt
Check ports

If the backend cannot be opened, check whether Port 8080 is available.
If A does, it may be because of the firewall. View iptables-L-n, or enable iptables-F.
If B does not, it may be not started or the installation is not successful. you can start it, for example, service wdapache start.

, 88, 21 are checked according to the method described above
For more information, see
Http://www.wdlinux.cn/bbs/thread-192-1-1.html
 
This article is excerpted from the wdlinux Forum http://www.wdlinux.cn/bbs ~
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.