Ubuntu 502 reports error after LNMP is installed

Source: Internet
Author: User
Previously, LNMP was successfully installed using javastuserver12.04. Then I installed Ubuntu12.10desktop on my local environment. Install LNMP as per my article. See Region

Previously, LNMP was successfully installed on Ubuntu Server 12. 04. Then I installed Ubuntu 12.10 desktop on my local environment.

Install LNMP as per my article. See http://www.linuxidc.com/Linux/2012-12/75438.htm

However, after the installation is successful, I found that the "welcome to nginx" image can appear normally at http: // localhost. Then I wrote a php probe file, but this reported an error. 502...

Now I am depressed... Why?

First, let's take a look at the previous configuration. Configure the PHP component.

  1. Location ~ \. Php $ {
  2. Try_files $ uri = 404;
  3. Fastcgi_pass 127.0.0.1: 9000;
  4. Fastcgi_index index. php;
  5. Include fastcgi_params;
  6. }

The problem actually occurs in fastcgi_pass configuration.
After the php5-fpm is installed on ubuntu 12.10. We can go

  1. /Etc/php5/fpm/pool. d/www. conf

Find the following code:

  1. Listen =/var/run/php5-fpm.sock

This is the use of unix to use php5-fpm.
At this time. We need to change the php configuration

  1. Location ~ \. Php $ {
  2. Fastcgi_pass unix:/var/run/php5-fpm.sock;
  3. Fastcgi_index index. php;
  4. Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
  5. Include fastcgi_params;
  6. }

Here, the address of fastcgi_pass should be changed to this .. In this way, your lnmp will be normal.

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.