阿帕奇mod_wsgi的和PHP在同一个域中 [英] Apache mod_wsgi and php in the same domain

查看:166
本文介绍了阿帕奇mod_wsgi的和PHP在同一个域中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是有可能使我的web服务器运行Python和PHP在同一个域中?

is it possible to make my webserver run python and php in the same domain?

我在Python /网站Django的是www.mydomain.com。

I have a website in python/django that is www.mydomain.com.

现在,我要主办www.mydomain.com/blog字preSS一个博客。

Now, i have to host a blog in www.mydomain.com/blog in wordpress.

我可以让它通过?

Apache 2.2的
mod_wsgi的

Apache 2.2 mod_wsgi

现在我的配置:

# RUNS PYTHON
<VirtualHost *:80>
    DocumentRoot /home/padrao
    ErrorLog /home/padrao/logs/mydomain.com-error_log
    CustomLog /home/padrao/logs/mydomain.com-access_log common
    WSGIScriptAlias / /home/padrao/mywebsite.wsgi
</VirtualHost>

# RUNS PHP
<VirtualHost *:80>
    ServerName cloud.mydomain.com
    ServerAdmin postmaster@mydomain.com
    DocumentRoot /home/padrao/www
    ErrorLog logs/mydomain.com-error_log
    CustomLog logs/mydomain.com-access_log combined

    <Directory /home/padrao/www>
      php_admin_value open_basedir "/home/padrao/www"
      php_admin_value upload_tmp_dir "/tmp"
    </Directory>

</VirtualHost>

感谢

推荐答案

他们应该在一个虚拟主机定义,而不是两个独立的。

They should be defined in the one VirtualHost, not two separate ones.

然后,Alias​​指令需求子目录PHP应用程序被定义为。这将覆盖WSGIScriptAlias​​为子URL。

An Alias directive then needs to be defined for subdir PHP application is at. This will override WSGIScriptAlias for the sub URL.

另外,您需要使用方法概要:

Alternatively you need to use methods outlined in:

<一个href=\"http://$c$c.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive\">http://$c$c.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive

其中的东西将被映射到基于文件系统资源,如果不将作为后备被路由到WSGI应用程序。

whereby stuff will be mapped to file system based resource and if not will as fallback be routed to WSGI application.

这篇关于阿帕奇mod_wsgi的和PHP在同一个域中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆