随笔分类 - nginx
nginx
摘要:[root@bogon conf.d]# cat /etc/nginx/conf.d/test6.conf server { listen 8085; server_name 192.168.0.204; #填写 ip 或者域名 index index.html index.htm default.h...
阅读全文
摘要:nginx报错:nginx: [emerg] unknown directive in /etc/nginx/conf.d/test.conf:4 解决: 第四行出现了 tab 空格 , 换成正常的空格即可
阅读全文
摘要:[root@bogon default]# ps aux | grep "nginx: worker process" | awk '{print $1}'rootrootrootrootroot [root@bogon default]# vi /etc/nginx/nginx.conf user
阅读全文
摘要:cat >> /etc/nginx/conf.d/status.conf << EOF server{ listen 8085; server_name www.test2.com; location / { stub_status on; access_log /usr/local/nginx/logs/status.log;...
阅读全文
摘要:Mysql主主同步环境部署: centos 7.4 三台云主机: mysql1 :10.1.1.142 mysql2 :10.1.1.106 nginx: 10.1.1.152 外网地址:114.115.174.210 两台都安装mysql 1 . 安装新版mysql前,需将系统自带的mariadb-lib卸载 [root@slave mytmp]# rpm -qa|gre...
阅读全文
摘要:1、查看主配置文件 [root@bogon ~]# cat /etc/nginx/nginx.conf user root root; worker_processes auto; worker_rlimit_nofile 51200; events { use epoll; worker_connections 65535; } http { include ...
阅读全文
摘要:linux创建www用户组和用户 wdcp中的nginx服务启动需要依赖www用户,因此若没有此用户就可能会启动失败。创建这个用户的方法:
阅读全文
摘要:1、修改配置文件 重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户 [root@host-10-1-1-161 html]# ll /etc/nginx/nginx.conf -rw-r--r-- 1 root root 345 Aug 26 10:41 /etc/nginx/nginx.conf [root@host-10-1-1-161 html]# vi /etc/ng...
阅读全文
摘要:参照地址: https://www.cnblogs.com/tianhei/p/7726505.html https://blog.csdn.net/cjs5202001/article/details/80228985
阅读全文
摘要:1、 其他目录下的。网页文件 必须写成 index.html 不能写成 sina.html,更不能写成test.index.html 否则报错,这是格式 2、配置域名必须要写到host里面;和通过百度访问域名是另一回事;通过 curl+ 域名访问只能对应80端口,不能写成8083其他端口 ,如下 server { listen 80; 注意:写...
阅读全文
摘要:1、 nginx: [error] open() "/var/run/nginx.pid" failed (2: No such file or directory) 解决: [root@TEST nginx]# sudo nginx -c /etc/nginx/nginx.conf [root@TEST nginx]# nginx -s reload 2、 [root@ngi...
阅读全文
摘要:1、重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户 [root@host-10-1-1-161 html]# ll /etc/nginx/nginx.conf -rw-r--r-- 1 root root 345 Aug 26 10:41 /etc/nginx/nginx.conf [root@host-10-1-1-161 html]# vi /etc/nginx/ngin...
阅读全文
摘要:在主配置文件http模块最后添加如下一句话 [root@host-10-1-1-161 ~]# vi /etc/nginx/nginx.conf include /etc/nginx/conf.d/*.conf; [root@host-10-1-1-161 ~]# mkdir -p /etc/nginx/conf.d 把主配置文件的server复制到conf.d下面就可以 主配置文...
阅读全文
摘要:403禁止访问解决 1、 重要:修改配置文件使用虚拟机,否则怎么配置都不生效,添加如下用户 [root@host-10-1-1-161 html]# ll /etc/nginx/nginx.conf -rw-r--r-- 1 root root 345 Aug 26 10:41 /etc/nginx/nginx.conf [root@host-10-1-1-161 html]# vi /e...
阅读全文
摘要:1、环境 nginx 10.1.1.161 公网:123.58.251.166 tomcat 10.1.1.103 2、远端tomcat 配置 [root@host-10-1-1-103 ~]# netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Addr...
阅读全文
摘要:1、环境 nginx 10.1.1.161 公网:123.58.251.166 tomcat 10.1.1.103 2、tomcat 配置 [root@host-10-1-1-103 ~]# netstat -tnlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Addres...
阅读全文
摘要:环境: 本地外网ip:123.58.251.166 1、配置index.html网页 [root@host-10-1-1-161 conf.d]# cat /web/sing/index.html www.test1.com [root@host-10-1-1-161 conf.d]# cat /root/html/index.html www.test2.com 2、配...
阅读全文
摘要:环境: 本地外网ip:123.58.251.166 1、配置index.html网页 [root@host-10-1-1-161 conf.d]# cat /web/sing/index.html www.test1.com [root@host-10-1-1-161 conf.d]# cat /root/html/index.html www.test2.com 2、配...
阅读全文
摘要:环境: 本地外网ip:123.58.251.166 1、配置index.html网页 [root@host-10-1-1-161 conf.d]# cat /web/sing/index.html www.test1.com 2、配置conf.d目录下配置文件 [root@host-10-1-1-161 conf.d]# pwd /etc/nginx/conf.d [root...
阅读全文
摘要:环境: 本地外网ip:123.58.251.166 1、配置index.html网页 [root@host-10-1-1-161 conf.d]# cat /web/sing/index.html www.test1.com 2、配置conf.d目录下配置文件 [root@host-10-1-1-161 conf.d]# pwd /etc/nginx/conf.d [roo...
阅读全文