[英]Apache handling multiple domains with mod_wsgi
I want apache to run django mod_wsgi and php application on one server. 我希望apache在一台服务器上运行django mod_wsgi和php应用程序。 I have made changes in conf.d file below but its not working.
我在下面的conf.d文件中进行了更改,但无法正常工作。
<VirtualHost *:80>
ServerName api.temp.in
#Django Application
<Directory /django>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName web.temp.in
ServerAlias web.temp.in
DocumentRoot /var/www/html
</VirtualHost>
Currently both the domains are redirecting to api.temp.in(django/mod_wsgi) .Is it even possible with mod_wsgi ? 当前两个域都重定向到api.temp.in(django / mod_wsgi).mod_wsgi甚至有可能吗?
Check you have a working virtual host entry. 检查您是否有一个有效的虚拟主机条目。
Try this 尝试这个
<virtualhost *:80>
servername api.temp.in
documentroot /var/www/html/api.temp.in
</virtualhost>
<virtualhost *:80>
servername web.temp.in
documentroot /var/www/html/web.temp.in
</virtualhost>
mkdir /var/www/html/api.temp.in /var/www/html/web.temp.in
echo “<h1> api.temp.in </h1>” > /var/www/html/api.temp.in/index.html
echo “<h1> web.temp.in </h1>” > /var/www/html/web.temp.in/index.html
Then try to access it , don't forget to add /etc/hosts entry. 然后尝试访问它,不要忘记添加/ etc / hosts条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.