V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  kmdd33  ›  全部回复第 2 页 / 共 15 页
回复总数  293
1  2  3  4  5  6  7  8  9  10 ... 15  
@aLazarus Google pwa?感谢各位,我都去试一下
2018-07-31 18:32:40 +08:00
回复了 oubenruing 创建的主题 程序员 eos 生态到底算是去中心化吗,是否看好今后的生态环境?
@分叉一条链早晚会出现,正如 zcash founder 不满 bitcoin 的隐私,byteball founder 不满 bitcoin 的速度。相互制约,相互竞争才对的起“去中心化” 这个词。
2018-07-27 11:24:55 +08:00
回复了 terrywater 创建的主题 分享创造 开源 BSD 协议 - fecshop - 开源电商 b2c
@terrywater 有没有计划加入多商家店铺的功能?方便让更多的卖家入住?
刚解决掉,贴出解决步骤:

# service openresty stop

Stopping openresty (via systemctl): [ OK ]

[root@li1165-57 ~]# ps ax |grep nginx

648 pts/1 S+ 0:00 grep --color=auto nginx
5974 ? S 0:04 nginx: worker process

[root@li1165-57 ~]# ps ax | grep nginx
651 pts/1 S+ 0:00 grep --color=auto nginx
5974 ? S 0:04 nginx: worker process

[root@li1165-57 ~]# ps ax | grep nginx

653 pts/1 S+ 0:00 grep --color=auto nginx
5974 ? S 0:04 nginx: worker process

[root@li1165-57 ~]# sudo kill -2 5974 (最终要的命令,杀死正在进行中的 nginx 进程)

[root@li1165-57 ~]# sudo kill -2 5974

kill: sending signal to 5974 failed: No such process

[root@li1165-57 ~]# ps ax | grep nginx

694 pts/1 S+ 0:00 grep --color=auto nginx

[root@li1165-57 ~]# service openresty restart

Restarting openresty (via systemctl): [ OK ]

[root@li1165-57 ~]# systemctl status openresty

● openresty.service - SYSV: OpenResty is a scalable web platform by extending
Loaded: loaded (/etc/rc.d/init.d/openresty; bad; vendor preset: disabled)
Active: active (running) since Thu 2018-07-12 13:21:32 UTC; 31s ago
Docs: man:systemd-sysv-generator(8)
Process: 9983 ExecStop=/etc/rc.d/init.d/openresty stop (code=exited, status=0/SUCCESS)
Process: 721 ExecStart=/etc/rc.d/init.d/openresty start (code=exited, status=0/SUCCESS)
Main PID: 737 (nginx)
CGroup: /system.slice/openresty.service
├─737 nginx: master process /usr/local/openresty/nginx/sbin/nginx -c /usr/local/ope...
└─739 nginx: worker process

Jul 12 13:21:32 li1165-57.members.vultr.com systemd[1]: Starting SYSV: OpenResty is a scalab....
Jul 12 13:21:32 li1165-57.members.vultr.com openresty[721]: Starting nginx: [ OK ]
Jul 12 13:21:32 li1165-57.members.vultr.com systemd[1]: PID file /usr/local/openresty/nginx/....
Jul 12 13:21:32 li1165-57.members.vultr.com systemd[1]: Started SYSV: OpenResty is a scalabl....
Hint: Some lines were ellipsized, use -l to show in full.
[root@li1165-57 ~]#
# ps ax | grep nginx
5974 ? S 0:03 nginx: worker process
32605 pts/0 S+ 0:00 grep --color=auto nginx
@chrisyunhua


# sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 5974/nginx: worker
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5974/nginx: worker
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 730/sshd
tcp6 0 0 :::9000 :::* LISTEN 4961/php-fpm: pool
tcp6 0 0 :::3306 :::* LISTEN 3299/mysqld
tcp6 0 0 :::80 :::* LISTEN 5974/nginx: worker
tcp6 0 0 :::22 :::* LISTEN 730/sshd
2018-07-02 02:04:40 +08:00
回复了 kmdd33 创建的主题 问与答 求助: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
@0312birdzhang 解决了,谢谢
同意谢谢各位。在 stackoverflow 上面找到了答案:

解决步骤:

1.在 nginx.conf 中把 error_log and pid 前面的注释去掉。 就像这样,方便得出正确的 error.log

user root;
worker_processes 1;

#error_log logs/error.log;
error_log logs/error.log debug;
#error_log logs/error.log info;

pid logs/nginx.pid;

2.http{}里面的 80 端口正确配置方式是:

listen 80;
listen [::]:80 default_server;

3.检查哪个 pid 占用了 80 端口:809 这个进程占用了 80 端口

# sudo netstat -tulpn | grep --color :80
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 809/nginx: master p
[root@li1382-238 ~]# sudo kill -2 809 (这个命令很重要)
[root@li1382-238 ~]# sudo netstat -tulpn | grep --color :80
[root@li1382-238 ~]# openresty
[root@li1382-238 ~]# openresty -t

# netstat -antp 这个命令也可以查出来哪个端口占用了 80 端口。

然后重启:openresty
2018-06-30 20:48:32 +08:00
回复了 kmdd33 创建的主题 问与答 求助: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
sudo fuser -k 80/tcp 尝试执行这个命令:
sudo: fuser: command not found
@Livid @est @sajesemuy @wqsfree @yaxin 最新的 /usr/local/openresty/nginx/log/error.log


8/06/28 18:04:18 [notice] 32331#32331: signal process started
2018/06/28 22:19:32 [emerg] 2711#2711: bind() to 127.0.0.1:80 failed (98: Address already in use)
2018/06/28 22:19:32 [emerg] 2711#2711: bind() to 127.0.0.1:80 failed (98: Address already in use)
2018/06/28 22:19:32 [emerg] 2711#2711: bind() to 127.0.0.1:80 failed (98: Address already in use)
2018/06/28 22:19:32 [emerg] 2711#2711: bind() to 127.0.0.1:80 failed (98: Address already in use)
2018/06/28 22:19:32 [emerg] 2711#2711: bind() to 127.0.0.1:80 failed (98: Address already in use)
2018/06/28 22:19:32 [emerg] 2711#2711: still could not bind()
2018/06/29 08:38:40 [emerg] 9553#9553: open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
2018/06/29 08:39:35 [emerg] 9589#9589: open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
2018/06/29 08:51:43 [emerg] 9757#9757: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
2018/06/29 08:55:53 [notice] 9801#9801: signal process started
2018/06/29 08:55:53 [error] 9801#9801: invalid PID number "" in "/var/run/nginx/nginx.pid"
2018/06/29 09:09:34 [notice] 10112#10112: signal process started
2018/06/29 09:09:34 [error] 10112#10112: invalid PID number "" in "/usr/local/openresty/nginx/logs/nginx.pid"
2018/06/29 09:14:52 [notice] 10206#10206: signal process started
2018/06/29 09:14:58 [notice] 10209#10209: signal process started
2018/06/29 09:30:18 [notice] 10444#10444: signal process started
2018/06/29 09:32:03 [notice] 10470#10470: signal process started
2018/06/29 09:44:49 [notice] 10614#10614: signal process started
2018/06/29 09:44:49 [alert] 10614#10614: kill(10009, 1) failed (3: No such process)
2018/06/29 09:45:05 [notice] 10616#10616: signal process started
2018/06/29 09:45:05 [alert] 10616#10616: kill(10009, 1) failed (3: No such process)
2018/06/29 09:50:38 [notice] 10681#10681: signal process started
2018/06/29 09:50:38 [alert] 10681#10681: kill(10009, 1) failed (3: No such process)
@wqsfree
/var/run/nginx/nginx.pid 仅仅输出了

10009

这个提示。请问我应该修改什么地方呢?服务器 ip 还是无法访问
@wqsfree

你好,按照您的建议,把你提供的这个写在了 http 段外面,重新 reload openresty 成功,error_log /var/log/nginx/error.log 内容:

2018/06/29 09:06:08 [notice] 10008#10008: using the "epoll" event method

2018/06/29 09:06:08 [notice] 10008#10008: openresty/1.13.6.2

2018/06/29 09:06:08 [notice] 10008#10008: built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

2018/06/29 09:06:08 [notice] 10008#10008: OS: Linux 3.10.0-862.3.2.el7.x86_64

2018/06/29 09:06:08 [notice] 10008#10008: getrlimit(RLIMIT_NOFILE): 1024:4096

2018/06/29 09:06:08 [notice] 10009#10009: start worker processes

2018/06/29 09:06:08 [notice] 10009#10009: start worker process 10011

2018/06/29 09:14:52 [notice] 10009#10009: signal 1 (SIGHUP) received from 10206, reconfiguring

2018/06/29 09:14:52 [notice] 10009#10009: reconfiguring

2018/06/29 09:14:52 [notice] 10009#10009: using the "epoll" event method

2018/06/29 09:14:52 [notice] 10009#10009: start worker processes

2018/06/29 09:14:52 [notice] 10009#10009: start worker process 10207

2018/06/29 09:14:52 [notice] 10011#10011: gracefully shutting down

2018/06/29 09:14:52 [notice] 10011#10011: exiting

2018/06/29 09:14:52 [notice] 10011#10011: exit

2018/06/29 09:14:52 [notice] 10009#10009: signal 17 (SIGCHLD) received from 10011

2018/06/29 09:14:52 [notice] 10009#10009: worker process 10011 exited with code 0

2018/06/29 09:14:52 [notice] 10009#10009: signal 29 (SIGIO) received

2018/06/29 09:14:58 [notice] 10009#10009: signal 1 (SIGHUP) received from 10209, reconfiguring

2018/06/29 09:14:58 [notice] 10009#10009: reconfiguring

2018/06/29 09:14:58 [notice] 10009#10009: using the "epoll" event method

2018/06/29 09:14:58 [notice] 10009#10009: start worker processes

2018/06/29 09:14:58 [notice] 10009#10009: start worker process 10210

2018/06/29 09:14:58 [notice] 10207#10207: gracefully shutting down

2018/06/29 09:14:58 [notice] 10207#10207: exiting

2018/06/29 09:14:58 [notice] 10207#10207: exit

2018/06/29 09:14:58 [notice] 10009#10009: signal 17 (SIGCHLD) received from 10207

2018/06/29 09:14:58 [notice] 10009#10009: worker process 10207 exited with code 0

2018/06/29 09:14:58 [notice] 10009#10009: signal 29 (SIGIO) received
@Livid @sajesemuy @est Sorry,Sorry,是 502 bad gateway 的提示。
@Livid 2.已经注释了,1 给 server 那段单独写一个 error_log ?请问这个如何操作?
头疼到现在
reload openresty 后

# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 32255 root 6u IPv4 170338 0t0 TCP localhost:http (LISTEN)
nginx 32332 root 6u IPv4 170338 0t0 TCP localhost:http (LISTEN)
@banksiae lsof -i :80 没有任何结果现在
2018-06-28 19:20:36 +08:00
回复了 Livid 创建的主题 NGINX 关于 NGINX 在 reload 时丢连接的问题
@Livid 请问您是如何解决的?碰到了跟你一样的问题,reload 后,error.log 就是这种信息,我 google 了一天一夜了,还是无法解决。
@banksiae yes 请问该如何解决这个问题呢? google 了一天一夜了
@0312birdzhang @ytlm

# ps -ef |grep nginx
root 19205 1 0 00:16 ? 00:00:00 nginx: master process /usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.conf
nginx 19364 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19365 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19366 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19367 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19368 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19369 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19370 19363 0 00:20 ? 00:00:00 php-fpm: pool www
nginx 19371 19363 0 00:20 ? 00:00:00 php-fpm: pool www
root 19989 19205 0 01:08 ? 00:00:00 nginx: worker process
root 25860 25839 0 09:49 pts/0 00:00:00 grep --color=auto nginx
1  2  3  4  5  6  7  8  9  10 ... 15  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1003 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms · UTC 19:48 · PVG 03:48 · LAX 12:48 · JFK 15:48
Developed with CodeLauncher
♥ Do have faith in what you're doing.