Centos7 Installing Nginx

Source: Internet
Author: User

 Nginx+php+redis Environment Construction under CENTOS7

1, Nginx Install:
Download the Nginx bundle (package) corresponding to the current system version

# wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm set up Nginx's Yum Warehouse# RPM-IVH nginx-release-centos-7-0.el7.ngx.noarch.rpm Download and install Nginx# yum Install nginx start nginx service systemctl start nginx Configuration default configuration file under the/etc/nginx path, using this configuration is already able to run Nginx correctly, if you need to customize, modify the nginx.conf under it and other documents. Test enter the IP of the machine that deploys the NGINX environment in the browser address bar, if everything is OK, you should be able to see the following words. /etc/nginx/nginx.confDelete the comment############################################ location ~ \.php$ {root html; fastcgi_pass127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param Script_filename/usr/share/nginx/html/$fastcgi _ Script_name; Include Fastcgi_params; }########################################## #service nginx restart         

2. Redis Install:

wget http://download. Redis. io/releases/redis-3.0.0.tar.gztar zxvf redis-3.0.0.tar.GZCD redis-3.0.0./configure;make;make Installredis-server/etc/redis         

3, Php-redis Install:

Error:the GPG keys listed for the"CentOS-7-updates-163.com" repository is already instarpm--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-7cd/tmpwget https:Github.com/nicolasff/phpredis/zipball/master-o php-redis.zipunzip PHP-redisThe directory after the. zip decompression is: NICOLASFF-phpredis-21D6614CD NICOLASFF-phpredis-21d6614phpize./configuremakemake install confirm that so files are placed in the correct directory Ll/usr/lib/php/modules/redis.sovi/etc/php.ini Add the following Content. Extension=redis.so[[email protected] Phpredis-phpredis-fc673f5]# ll/usr/lib64/php/modules/redis.so          

4, PHP-FPM Install:

as to parse the php by nginxyum install php-fpm

5, start php-fpm nginx

vi/etc/php-fpm.conf daemonize = Yesphp-FPM -c/etc/php.iniservice nginx Restart        

6. Test Nginx and PHP

http://localhost/test.php<?phpecho phpinfo();?>

Centos7 Installing Nginx

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.