最近瞎摸了一下 nginx+passenger 在阿里云部署生产环境
项目下敲命令 passenger start -e production -d
也跑起来了
但是 nginx.conf 里写的用 80 端口。查的时候 80 端口是阿里云的服务在占用
所以不明白 nginx 是否有在工作,也有用命令去看进程
nginx.conf
server {
listen 80;
server_name ip;
root /root/project/public
passenger_enabled on;
location / {
root html;
index index.html index.htm;
}
}
lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
AliYunDun 883 root 22u IPv4 19135 0t0 TCP ubuntu18.04:59914->100.100.30.26:http (ESTABLISHED)
lsof -i:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx-1.1 12800 xx 5u IPv4 1106451 0t0 TCP *:3000 (LISTEN)
nginx-1.1 12805 xx 5u IPv4 1106451 0t0 TCP *:3000 (LISTEN)
ps -ef | grep nginx
xx 12800 1 0 May07 ? 00:00:00 nginx: master process /home/xx/.passenger/support-binaries/6.0.4/nginx-1.17.3 -c /tmp/passenger-standalone.ditppu/nginx.conf -p /tmp/passenger-standalone.ditppu
xx 12805 12800 0 May07 ? 00:00:00 nginx: worker process
xx 12812 1 0 May07 ? 00:00:00 /home/xx/.rvm/gems/ruby-2.4.1@blog/gems/passenger-6.0.4/buildout/support-binaries/PassengerAgent temp-dir-toucher /tmp/passenger-standalone.ditppu --cleanup --daemonize --pid-file /tmp/passenger-standalone.ditppu/temp_dir_toucher.pid --log-file /home/xx/project/log/passenger.3000.log --nginx-pid 12800
root 14906 14786 0 00:26 pts/2 00:00:00 grep --color=auto nginx