首页 新闻 会员 周边 捐助

Apache2.4 同ip同端口,不同域名,部署两个项目。

0
悬赏园豆:10 [待解决问题]

Apache配置完成之后域名A可以访问, 域名B,403

配置如下

WSGIScriptAlias / "D:/project/ms_backend/ms_backend/wsgi.py"
WSGIPythonPath D:/project/ms_backend

Mod_WSGI Permission config One

<VirtualHost *:80>
<Directory D:/project/ms_backend/ms_backend>
<Files wsgi.py>
Require all granted
</Files>
</Directory>

Static File Config

Alias /static D:/project/ms_backend/static
<Directory D:/project/ms_backend/static>
AllowOverride None
Options None
Require all granted
</Directory>
ServerName api.tjyunshi.com
DocumentRoot "D:/project/ms_backend"
ErrorLog "logs/api.tjyunshi.com-error.log"
CustomLog "logs/api.tjyunshi.com-access.log" common
</VirtualHost>

WSGIScriptAlias / "C:/work/testbs/testbs/wsgi.py"
WSGIPythonPath C:/work/testbs

Mod_WSGI Permission config Two

<VirtualHost *:80>

<Directory C:/work/testbs/testbs>
Options Indexes FollowSymLinks
allow from all
<Files wsgi.py>
Require all granted
</Files>
</Directory>

ServerName a.tjyunshi.com
DocumentRoot "C:/work/testbs"
    ErrorLog "logs/a.tjyunshi.com-error.log"
    CustomLog "logs/a.tjyunshi.com-access.log" common

</VirtualHost>

WrYcF的主页 WrYcF | 初学一级 | 园豆:21
提问于:2018-10-29 16:36
< >
分享
所有回答(1)
0

修改wsgi.py文件

sys.path.append('C:/xampp/htdocs/advisory_portal/advisory_portal')
sys.path.append('C:/xampp/htdocs/advisory_portal')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "advisory_portal.settings")

application = get_wsgi_application()

WrYcF | 园豆:21 (初学一级) | 2018-10-29 18:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册