The construction of the lnmp of CentOS

Source: Internet
Author: User
Before installing, you can first look at the lamp installation process

http://blog.csdn.net/zph1234/article/details/51248124

1. Installing Nginx

Yum install yum-priorities-y  wget http://nginx.org/packages/centos/7/noarch/RPMS/ nginx-release-centos-7-0.el7.ngx.noarch.rpm  rpm-ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm  Yum Install Nginx  

Systemctl start Nginx.service #启动nginx  systemctl stop nginx.service #停止  systemctl restart Nginx.service #重启  

2. Change the Nginx port number (depending on your needs)
    cd/etc/nginx/conf.d/      vim default.conf      Change Listen 80 to listen 81  

    Systemctl Restart Nginx.service #重启nginx  

3. Visit http://ip:81 to see Nginx homepage

4. Next Installation PHP-FPM
Yum Install PHP-FPM  

    Systemctl start Php-fpm.service #启动php-fpm      systemctl enable Php-fpm.service #设置开机启动  
5. Change Nginx config file to identify PHP

Vi/etc/nginx/conf.d/default.conf, the previous # to get rid of it, you can change the Fastcgi_param

Location ~ \.php$ {      root           html;      Fastcgi_pass   127.0.0.1:9000;      Fastcgi_index  index.php;      Fastcgi_param  script_filename  /usr/share/nginx/html/$fastcgi _script_name;      Include        fastcgi_params;  }

6.

Create a new test.php in/usr/share/nginx/html

Visit http://ip:81/test.php to see the PHP page in Nginx


The above describes the lnmp of CentOS, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.