1.前期準備html
關閉防火牆和selinuxlinux
[root@vip ~]# iptables -F && setenforce 0 && systemctl stop firewalldnginx
2.安裝依賴包vim
[root@vip ~]# yum -y install gcc pcre-devel openssl-devel瀏覽器
[root@vip ~]# yum -y install epel-releasesession
安裝nginxrest
[root@vip ~]# yum -y install nginx日誌
設置nginx開機自啓server
[root@vip ~]# systemctl enable nginxhtm
知識擴展:
nginx經常使用命令
[root@vip ~]# systemctl start nginx.service #啓動nginx
[root@vip ~]# systemctl stop nginx #中止nginx
[root@vip ~]# systemctl enable nginx #開機自啓
[root@vip ~]# systemctl restart nginx.service #重啓nginx
配置路徑:/etc/nginx/
日誌路徑:/var/log/nginx
3.打開配置文件
[root@vip ~]# vim /etc/nginx/nginx.conf
server {
listen 443;
server_name localhost;
ssl on;
root /usr/share/nginx/html;
ssl_certificate "/root/3309085_cszc.top.pem";
ssl_certificate_key "/root/3309085_cszc.top.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
}
}
}
4.而後啓動nginx
[root@vip ~]# systemctl start nginx.service
啓動成功以後打開瀏覽器輸入:https://192.168.175.200/
總結:。。。。。。。。。。此處省略一萬字