即使是枪支在本地运行良好,我面对内部服务器错误
这是我第一次在Django部署进行生产。
我测试了它是否可以通过运行以下命令来服务我的Django应用程序,没有问题,我可以通过服务器IP Adress到达我的网站。
gunicorn hello.wsgi:application --bind 0.0.0.0:8000
application --bind 0.0.0.0:8000
[2022-05-01 11:00:46 +0000] [26484] [INFO] Starting gunicorn 20.1.0
[2022-05-01 11:00:46 +0000] [26484] [INFO] Listening at: http://0.0.0.0:8000 (26484)
[2022-05-01 11:00:46 +0000] [26484] [INFO] Using worker: sync
[2022-05-01 11:00:46 +0000] [26486] [INFO] Booting worker with pid: 26486
/home/scknylmz35/PersonelBlog/home/views.py:24: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'home.models.Blog'> QuerySet.
然后我遵循了以下命令:
sudo nano /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=baris
Group=www-data
WorkingDirectory=/home/baris/eventhub
ExecStart=/home/baris/eventhub/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/baris/eventhub/eventhub.sock eventhub.wsgi:application
[Install]
WantedBy=multi-user.target
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
我测试了枪支,
>> sudo systemctl status gunicorn
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor pres>
Active: active (running) since Sun 2022-05-01 08:01:47 UTC; 2h 19min ago
Main PID: 23885 (gunicorn)
Tasks: 4 (limit: 1132)
Memory: 136.3M
CGroup: /system.slice/gunicorn.service
├─23885 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
├─23897 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
├─23898 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
└─23899 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
这似乎效果很好。但是,当我尝试以mysite的形式到达我的站点时,我也会在检查NGINX错误日志时面对“内部服务器错误”
时,没有错误。
我如何找到问题在哪里?你能指导我吗?
This is my first deploy in Django for production.
I tested whether it can serve my Django application by running the following command and there is no problem I can reach my site by my server ip adress.
gunicorn hello.wsgi:application --bind 0.0.0.0:8000
application --bind 0.0.0.0:8000
[2022-05-01 11:00:46 +0000] [26484] [INFO] Starting gunicorn 20.1.0
[2022-05-01 11:00:46 +0000] [26484] [INFO] Listening at: http://0.0.0.0:8000 (26484)
[2022-05-01 11:00:46 +0000] [26484] [INFO] Using worker: sync
[2022-05-01 11:00:46 +0000] [26486] [INFO] Booting worker with pid: 26486
/home/scknylmz35/PersonelBlog/home/views.py:24: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'home.models.Blog'> QuerySet.
Then I followed following commands:
sudo nano /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=baris
Group=www-data
WorkingDirectory=/home/baris/eventhub
ExecStart=/home/baris/eventhub/venv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/baris/eventhub/eventhub.sock eventhub.wsgi:application
[Install]
WantedBy=multi-user.target
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
And I tested gunicorn
>> sudo systemctl status gunicorn
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor pres>
Active: active (running) since Sun 2022-05-01 08:01:47 UTC; 2h 19min ago
Main PID: 23885 (gunicorn)
Tasks: 4 (limit: 1132)
Memory: 136.3M
CGroup: /system.slice/gunicorn.service
├─23885 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
├─23897 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
├─23898 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
└─23899 /home/scknylmz35/PersonelBlog/venv/bin/python /home/scknyl>
It seems working good. But when I try to reach my site as mysite.me I face with "Internal Server Error"
Also when I check nginx error log, there is no error.
How can I find where is the problem? Could you please guide me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论