【发布时间】:2016-06-21 00:41:56
【问题描述】:
我的 ubuntu 服务器上有 django restful 服务,这些服务在端口 84 上运行。
发送请求时,它来自运行在 80 端口上的 apache2 服务器。
现在假设我的服务器 IP 是“xx.xx.xx.10”,当我使用这个 url http://xx.xx.xx.10/user 调用时,用户是在端口 84 上运行在 django rest 框架上的其余服务。然后请求应该转到我的 django rest 服务通过 apache2 并返回所需的输出。
我尝试在 apache2 中使用以下配置:-
<VirtualHost *:80>
WSGIScriptAlias / /myproject/myapp/test/wsgi.py
<Directory "/myproject/myapp/test/">
<Files "wsgi.py">
Require all granted
</Files>
</Directory>
</VirtualHost>
但这给出了内部错误,说 test.settings 没有退出。
这是配置在apache服务器上不同端口上运行的restful服务的正确方法吗?
【问题讨论】:
-
您如何以及为什么在端口 84 上部署服务? Django 文档提供了使用 Apache mod wsgi 部署 Django 的说明,您可能会觉得这些说明很有用。
标签: django apache apache2 django-rest-framework