Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在同一服务器上部署不同版本的django应用程序_Django_Apache_Mod Wsgi - Fatal编程技术网

在同一服务器上部署不同版本的django应用程序

在同一服务器上部署不同版本的django应用程序,django,apache,mod-wsgi,Django,Apache,Mod Wsgi,我正在使用Apache&mod_wsgi在我的服务器上部署一个django应用程序。我使用wsgi的守护程序模式在服务器上运行django应用程序 现在我的目标是在同一台服务器上拥有两个或多个版本的django应用程序(每个应用程序都有自己的设置、数据库等)。例如: 我已经更新了位于/etc/apache2/sites的apache配置文件。 这是我的配置文件:- <IfModule mod_ssl.c> <VirtualHost *:443> Ser

我正在使用Apache&mod_wsgi在我的服务器上部署一个django应用程序。我使用wsgi的守护程序模式在服务器上运行django应用程序

现在我的目标是在同一台服务器上拥有两个或多个版本的django应用程序(每个应用程序都有自己的设置、数据库等)。例如:


我已经更新了位于/etc/apache2/sites的apache配置文件。 这是我的配置文件:-

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin xyz@gmail.com
    ServerName test-server.com
    ServerAlias www.test-server.com
    #DocumentRoot /var/www/html

    Alias /static /var/www/html/Smart_chat_share/smart_chat_share/static  // This should accesible via https://test-server.com/ which is working
    <Directory /var/www/html/Smart_chat_share/smart_chat_share/static>
            Require all granted
    </Directory>

    WSGIDaemonProcess smart_chat_share python-home=/var/www/html/Smart_chat_share/smart_chat_share/virtual_env python-path=/var/www/html/Smart_chat_share/smart_chat_share
    WSGIProcessGroup smart_chat_share
    WSGIScriptAlias / /var/www/html/Smart_chat_share/smart_chat_share/smart_chat_share/wsgi.py process-group=smart_chat_share application-group=%{GLOBAL}

    <Directory /var/www/html/Smart_chat_share/smart_chat_share/smart_chat_share>
            <Files wsgi.py>
                 Require all granted
            </Files>
    </Directory>

    Alias /dev/static /var/www/html/dev/smart_chat_share/static // This should accesible via https://test-server.com/dev which is not working.
    <Directory /var/www/html/dev/smart_chat_share/static>
            Require all granted
    </Directory>

    WSGIDaemonProcess dev python-home=/var/www/html/dev/smart_chat_share/virtual_env python-path=/var/www/html/dev/smart_chat_share
    WSGIProcessGroup dev
    WSGIScriptAlias /dev /var/www/html/dev/smart_chat_share/smart_chat_share/wsgi.py process-group=smart_chat_share application-group=%{GLOBAL}

    <Directory /var/www/html/dev/smart_chat_share/smart_chat_share>
            <Files wsgi.py>
                 Require all granted
            </Files>
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLCertificateFile /etc/letsencrypt/live/scss.identixweb.com/fullchain.pem
SSLCertificateKeyFile 
/etc/letsencrypt/live/scss.identixweb.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

服务器管理员xyz@gmail.com
ServerName test-server.com
ServerAlias www.test-server.com
#DocumentRoot/var/www/html
Alias/static/var/www/html/Smart\u chat\u share/Smart\u chat\u share/static//这应该可以通过https://test-server.com/ 哪个有效
要求所有授权
WSGIDaemonProcess smart_chat_share python home=/var/www/html/smart_chat_share/smart_chat_share/virtual_env python path=/var/www/html/smart_chat_share/smart_chat_share
WSGIProcessGroup智能聊天共享
WSGIScriptAlias//var/www/html/Smart\u chat\u share/Smart\u chat\u share/Smart\u chat\u share/wsgi.py进程组=Smart\u chat\u share应用程序组=%%{GLOBAL}
要求所有授权
别名/dev/static/var/www/html/dev/smart\u chat\u share/static//这应该可以通过https://test-server.com/dev 这是行不通的。
要求所有授权
WSGIDaemonProcess dev python home=/var/www/html/dev/smart_chat_share/virtual_env python path=/var/www/html/dev/smart_chat_share
WSGIProcessGroup开发
WSGIScriptAlias/dev/var/www/html/dev/smart_chat_share/smart_chat_share/wsgi.py进程组=smart_chat_share应用程序组=%{GLOBAL}
要求所有授权
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
SSLCertificateFile/etc/letsencrypt/live/scss.identixweb.com/fullchain.pem
SSLCertificateKeyFile
/etc/letsencrypt/live/scss.identixweb.com/privkey.pem
Include/etc/letsencrypt/options-ssl-apache.conf
这是一个工作版本,但第二个版本我无法访问和测试。当涉及到Apache配置时,我经常会不知所措。非常感谢你的帮助。
非常感谢

以防有人遇到这个问题,这里是我的答案。我通过重新排列文件中django应用程序的配置就解决了这个问题。确保子目录首先出现,然后进行根目录one apps配置

本文件非常有用:-
以防有人遇到这个问题,这里是我的答案。我通过重新排列文件中django应用程序的配置就解决了这个问题。确保子目录首先出现,然后进行根目录one apps配置

本文件非常有用:-