Nginx CentOS
Posted 大牛1对1编程
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx CentOS相关的知识,希望对你有一定的参考价值。
带你一起做真实企业上线项目
斩获 2 年企业经验积累
[root@daniu101 ~]# yum -y install nginx
[root@daniu101 ~]# systemctl enable nginx
[root@daniu101 ~]# systemctl start nginx
[root@daniu101 ~]# systemctl stop nginx
[root@daniu101 ~]# systemctl status nginx
[root@daniu101 ~]# ps -ef |grep nginx
[root@daniu101 ~]# cd /etc/nginx
[root@daniu101 nginx]# vim nginx.conf
#################### vim ####################
# Java vim使用:i输入模式,Esc + :qw! 强制保存退出
listen 80 default_server;
server_name www2.daniu101.com
#################### vim ####################
[root@daniu101 ~]# systemctl restart nginx
http://nginx.org/download/
[root@daniu101 ~]# cd /home/
[root@daniu101 home]# yum install -y lrzsz
[root@daniu101 home]# tar -zxvf nginx-1.18.0.tar.gz
[root@daniu101 ~]# cd /home/
[root@daniu101 home]# wget
http://nginx.org/download/
nginx-1.18.0.tar.gz
[root@daniu101 home]# tar -zxvf nginx-1.18.0.tar.gz
nginx-1.18.0 nginx-1.18.0.tar.gz
[root@daniu101 home]# cd nginx-1.18.0/
[root@daniu101 nginx-1.18.0]# yum -y install pcre-devel
[root@daniu101 nginx-1.18.0]# yum -y install openssl openssl-devel
[root@daniu101 nginx-1.18.0]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
[root@daniu101 nginx-1.18.0]# make
[root@daniu101 nginx-1.18.0]# make install
[root@daniu101 nginx-1.18.0]# cd /usr/local/nginx/
[root@daniu101 nginx]# vim conf/nginx.conf
#################### vim ####################
# Java vim使用:i输入模式,Esc + :qw! 强制保存退出
listen 80 default_server;
server_name www2.daniu101.com
#################### vim ####################
[root@daniu101 nginx]# cd sbin/
[root@daniu101 sbin]# ./nginx
[root@daniu101 sbin]# ps -ef |grep nginx
证书的购买、创建、申请、解析确认见:Tomcat-SSL部分。
[root@daniu101 nginx]# mkdir cert
[root@daniu101 nginx]# cd cert/
[root@daniu101 nginx]# yum install -y lrzsz
5580864_www2.daniu101.com.key 5580864_www2.daniu101.com.pem
[root@daniu101 cert]# cd ..
[root@daniu101 nginx]# cd conf/
[root@daniu101 conf]# vim nginx.conf
#################### vim ####################
# Java vim使用:i输入模式,Esc + :qw! 强制保存退出
server_name www2.daniu101.com;
ssl_certificate /usr/local/nginx/cert/5580864_www2.daniu101.com.pem;
ssl_certificate_key /usr/local/nginx/cert/5580864_www2.daniu101.com.key;
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;
server{
listen 80;
server_name www3.daniu101.com;
rewrite ^/(.*)$ https://www3.daniu101.com:443/$1 permanent;
}
#################### vim ####################
[root@daniu101 sbin]# ./nginx -t
[root@daniu101 sbin]# ./nginx -s reload
直播视频录制 + 完整项目源代码 + 超级详细文档 +PPT +上课笔记 + 思维导图 + 经验总结...
大牛一对一是超级硬核的编程教育高端品牌,开创了编程领域一对一的指导模式,开设全栈、Java、Python、LeetCode、C系、人工智能、区块链、数据结构与算法、数据科学、产品经理、CTO技术管理等课程,特聘科班硕士和10多年工作经验的大牛教学,引导和培育学员独立创新研究学习能力,独立开发企业项目的能力,大团队协同工作沟通的能力,使每个人都成为高端的计算机人才,研究型企业骨干编程人才。
以上是关于Nginx CentOS的主要内容,如果未能解决你的问题,请参考以下文章
CentOSCentOS Linux服务器安全设置
centoscentos中添加一个新用户,并授权
Linux CentOSCentOS 7 YUM 安裝 MySQL 5.7
CentosCentos7.5取消自动锁屏功能
CentOS下安装mysql,make时出现make[1]: *** [link_sources] Error 1 make: *** [all-recursive] Error 1
CentOS简介