CentOS 6.5 Installation Configuration Nginx environment

Source: Internet
Author: User

1. Install Pcre, zlib, OpenSSL

Yum install-y pcre pcre-develyum install-y zlib zlib-develyum install-y OpenSSL openssl-devel

2. Installing Nginx

RPM-IVH http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpmyum-y Install Nginxyum-y php-fpmservice php-fpm restartservice nginx restartchkconfig php-fpm onchkconfig nginx on

Open the browser to access the IPof this machine if the browser appears Welcome to nginx! Indicates that Nginx is installed and running successfully.

3. Common commands

Service Nginx startservice nginx stopservice nginx Reload

4. Common Configuration

Vi/etc/nginx/conf.d/default.conf

server {    listen       ;    server_name  localhost;    AutoIndex on    ;    #charset Koi8-r;    #access_log  /var/log/nginx/log/host.access.log  main;    Location/{        root   /var/www/html;        Index  index.html index.htm index.php;    }    Location ~ \.php$ {        root           /var/www/html;        Fastcgi_pass   127.0.0.1:9000;        Fastcgi_index  index.php;        Fastcgi_param  script_filename  /var/www/html$fastcgi_script_name;        Include        fastcgi_params;    }

CentOS 6.5 Installation Configuration Nginx environment

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.