我正在创建一个 websocket 服务器,它将在ws.mysite.example
. 我希望 Web 套接字服务器进行 SSL 加密以及domain.example
SSL 加密。我是否需要为我创建的每个子域购买新证书?我创建的每个子域都需要一个专用 IP 地址吗?我可能会有多个子域。
我正在使用在 Ubuntu 上运行的 NGINX 和 Gunicorn。
我正在创建一个 websocket 服务器,它将在ws.mysite.example
. 我希望 Web 套接字服务器进行 SSL 加密以及domain.example
SSL 加密。我是否需要为我创建的每个子域购买新证书?我创建的每个子域都需要一个专用 IP 地址吗?我可能会有多个子域。
我正在使用在 Ubuntu 上运行的 NGINX 和 Gunicorn。
如果我跑:
$ sudo service nginx status
* nginx is not running
然后我跑:
$ sudo service nginx start
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
...
nginx: [emerg] still could not bind()
所以我杀了它:
sudo fuser -k 80/tcp
所以我尝试再次启动 Nginx:
$ sudo service nginx start
Starting nginx: nginx.
现在应该正在运行,对吧?:
$ sudo service nginx status
* nginx is not running
我试过了:
$ ps aux | grep nginx
root 1316 0.0 0.2 64988 1236 ? Ss 14:37 0:00 nginx: master process /usr/sbin/nginx
nobody 1317 0.0 0.3 65408 1908 ? S 14:37 0:00 nginx: worker process
myusername 1436 0.0 0.1 9388 876 pts/2 S+ 14:40 0:00 grep nginx
当我访问该站点的 ip 时。nginx/1.2.1
我在底部收到一条 404 消息。在我看来,它实际上正在运行。我在 nginx.conf 中阻止了 ip 地址,我测试了这些 ip 目前正在被阻止。所以我对 Nginx 是否正在运行以及如何抓住这个野兽感到困惑。
我的最终目标是让 Gunicorn 也能运行。奇怪的是这一切昨天都在工作。Gunicorn 和 Nginx 的状态均为working
.