共计 8436 个字符,预计需要花费 22 分钟才能阅读完成。
接下来我们重启服务器就可以了,重启的过程中,你会发现速度非常快;
安装配置
[root@LNAP /]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm |
[root@LNAP /]# yum info nginx 已加载插件:fastestmirror Determining fastest mirrors * base: mirrors.yun-idc.com * extras: mirrors.neusoft.edu.cn * updates: mirrors.neusoft.edu.cn base | 3.7 kB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 37 kB 00:00 nginx | 2.9 kB 00:00 nginx/primary_db | 22 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 4.3 MB 00:05 可安装的软件包 Name : nginx Arch : x86_64 Version : 1.10.3 Release : 1.el6.ngx Size : 861 k Repo : nginx Summary : High performance web server URL : http://nginx.org/ License : 2-clause BSD-like license Description : nginx [engine x] is an HTTP and reverse proxy server, as well as : a mail proxy server. |
[root@LNAP /] #yum install nginx -y …….. ……. ……. [root@LNAP /]# service nginx start Starting nginx: [OK] [root@LNAP /]# chkconfig nginx on //设置 nginx 开机自启动 |
Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com. Thank you for using nginx. |
server { listen 443; server_name localhost; ssl on; ssl_certificate server.crt; ssl_certificate_key server.key; # ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2; # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; # ssl_prefer_server_ciphers on; #这些内容根据自己的需求进行更改 } |
server { listen 80; server_name www.cloud.com; rewrite ^(.*)https:// https:// host$1 permanent; location / { root /data/html/phpwind/; index index.html index.htm index.php; } location ~ \.php$ { root /data/html/phpwind/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/html/phpwind/$fastcgi_script_name; include fastcgi_params; } } |
server { listen 443; server_name www.tcloud.com; #charset koi8-r; #access_log /var/log/nginx/log/host.access.log main; ######SSL############# ssl on; ssl_certificate /etc/nginx/cert/discuz.crt; ssl_certificate_key /etc/nginx/cert/discuz.key; ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; ########SSL 模块 ########## location / { root /data/html/phpwind/; index index.html index.htm index.php; } error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 ##########PHP 模块 ########### location ~ \.php$ { root /data/html/phpwind/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/html/phpwind/$fastcgi_script_name; include fastcgi_params; } ##########PHP############# # deny access to .htaccess files, if Apache’s document root # concurs with nginx’s one #location ~ /\.ht { # deny all; #} } |
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
LNMP 环境搭建(Discuz 论坛) http://www.linuxidc.com/Linux/2016-03/129334.htm
Ubuntu 14.04 下 apt-get 方法安装 LNMP 环境 http://www.linuxidc.com/Linux/2016-07/133683.htm
CentOS 7 源码编译安装 PHP5.6 和 Nginx1.7.9 及 MySQL(搭建 LNMP 环境) http://www.linuxidc.com/Linux/2015-12/126200.htm
Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm
CentOS 7 源码安装最新版 LNMP 环境 http://www.linuxidc.com/Linux/2015-04/116058.htm
Ubuntu 16.04 下源码配置 LNMP 开发环境 http://www.linuxidc.com/Linux/2016-09/135381.htm
LNMP 环境搭建以及调优 http://www.linuxidc.com/Linux/2017-01/140072.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-03/141762.htm