繁体   English   中英

如何使用mod_python在apache2上用php5共同托管django应用程序?

[英]How to co host django app with php5 on apache2 with mod_python?

我安装了django + python + apache2 + mod_python托管并在ubuntu服务器/ linode VPS上工作。 php5已安装并配置。 我们没有example.com中的域名。 只是IP地址。 所以我的apache .conf文件看起来像这样

ServerAdmin webmaster @ localhost DocumentRoot / var / www

    <Location "/">
            SetHandler python-program
            PythonHandler django.core.handlers.modpython
            SetEnv DJANGO_SETTINGS_MODULE mysite.settings
            PythonOption django.root /mysite
            PythonPath "['/var/www/djangoprojects',] + sys.path"
            PythonDebug On
    </Location>

我想安装vtiger,所以如果我像这样更改我的.conf文件,

<VirtualHost *:80>
    DocumentRoot /var/www/vtigercrm/
    ErrorLog /var/log/apache2/vtiger.error_log
    CustomLog /var/log/apache2/vtiger.access_log combined
    <Directory /var/www/vtigercrm>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

这样,基于PHP的应用程序vtiger可以正常工作,并且django应用程序当然不可访问。 我如何使两者共存于一个文件中。 我无法使用虚拟主机/子域。 我不能使用差异端口。

有什么线索吗?

问候安库尔·古普塔

我需要对其进行测试,但这将使您的Django项目在/ mysite /下运行:

<VirtualHost *:80>
    DocumentRoot /var/www/vtigercrm/
    ErrorLog /var/log/apache2/vtiger.error_log
    CustomLog /var/log/apache2/vtiger.access_log combined
    <Directory /var/www/vtigercrm>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    <Location "/mysite/">
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE mysite.settings
        PythonOption django.root /mysite
        PythonPath "['/var/www/djangoprojects',] + sys.path"
        PythonDebug On
    </Location>
</VirtualHost>

另外, 托管Django应用程序首选方法是使用mod_wsgi

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM