Build LNMP in Ubuntu 14.04

Source: Internet
Author: User

Build LNMP in Ubuntu 14.04

During LNMP setup in Ubuntu 14.04, the combination of LNMP (Linux-Nginx-MySQL-PHP) software can become a free, efficient, and scalable website service system.

1. Procedure

1. Install Nginx

sudo apt-get install updatesudo apt-get install nginx

2. Test Nginx. If Nginx is displayed, the installation is successful.

Ip addr show eth0 | grep inet | awk '{print $2;}' | sed's /\/. * $ // '# view the local ip address curl http: // 127.0.0.1 or curl http: // local ip Address

3. Install MySQL

Sudo apt-get install mysql-server # enter the same password twice in a row

4. install PHP

sudo apt-get install php5-fpm php5-mysql

5. Configure PHP and modify the php. ini file.

# Back up php. INI file cp/etc/php5/fpm/php. ini/etc/php5/fpm/php. ini. back # cancel the pathinfo mode vim/etc/php5/fpm/php with security risks. ini # Set cgi. fix_pathinfo = 1 is set to cgi. fix_pathinfo = 0cgi. fix_pathinfo = 0 # Start php-fpmsudo service php5-fpm restart

6. Configure Nginx to use the php-fpm Process

# Back up the/etc/nginx/sites-available/default file cp/etc/nginx/sites-available/default. back # modify the defalut file content as follows: server {listen 80 default_server; listen [:]: 80 default_server defaults 6only = on; root/usr/share/nginx/html; index. php index.html index.htm; server_name server_domain_name_or_IP; location/{try_files $ uri/= 404;} error_page 404/404 .html; error_page 500 502 503 504/50 x.html; location =/50x.html {root/usr/share/nginx/html;} location ~ \. Php $ {try_files $ uri = 404; fastcgi_split_path_info ^ (. + \. php )(/. +) $; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; include fastcgi_params ;}}

7. Restart the nginx Server

sudo service nginx restart

8. Create info. php in/usr/share/nginx/html/and write the following content.

<? Phpphpinfo ();?> Enter http: // ip/info. php in the browser.

Ii. written at the end

This article briefly introduces how to install Nginx + php-fpm. If you have more in-depth research on Linux, you can install and configure it by manually installing the source code package. Of course, you should have learned about the advantages of Nginx when you see this article. The subsequent articles will continue to analyze the classic configurations of Nginx and the similarities and differences between Nginx and Apahce.

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04

Build and install the LNMP production environment in CentOS 6.4

Practical Production Environment-LNMP architecture compilation and installation + SSL encryption implementation

LNMP full-featured compilation and installation for CentOS 6.3 notes

Install LNMP in CentOS 6.3 (PHP 5.4, MyySQL5.6)

Nginx startup failure occurs during LNMP deployment.

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)

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.