The only way you can achieve separation of logs file for each application is to 
host them under different virtual hosts in Apache. This is because Apache only 
allows you to specify the log file to use per VirtualHost. If you were to use 
ErrorLog twice in a VirtualHost, the second will apply.

The only thing you can do which may be of use to help distinguish messages in 
the log, is to use the ErrorLogFormat directive to output as part of the log 
message prefix the value of an Apache request environment variable. You could 
then using a Location directive for the different sub URLs the applications are 
at, set a distinguishing environment variable using SetEnv to be included in 
the log message prefix.

BTW, you are missing a WSGIProcessGroup directive, or process-group option to 
WSGIScriptAlias in your configuration. Without those, your application is still 
running in embedded mode in the Apache child worker processes, and not in the 
mod_wsgi daemon process groups you have set up.

You can verify what is happening by replacing the WSGI script with test script 
given in:

    
https://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html#embedded-or-daemon-mode
 
<https://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html#embedded-or-daemon-mode>

Graham

> On 29 Sep 2017, at 3:46 pm, BIJAL MANIAR <bija...@gmail.com> wrote:
> 
> 
> Hi,
> 
> I want to serve two django projects (test1 and test2) through apache and 
> modwsgi.
> test1 project to be served with url front slash (/)
> test2 project to be server with url (/test/test2)
> 
> I am using single virtual host with 2 aliases for each application. This 
> seems to work fine. But need to have separate error logs for both the 
> projects. Is this correct way to write settings in apache.
> eg. ErrorLog test2_error_log/error_log
> ErrorLog test1_error_log/error_log
> 
> <VirtualHost *:80>
> WSGIDaemonProcess test2
> Alias /test1/test2app /opt/app/test2_codebase
> WSGIScriptAlias /test1/test2 /opt/app/test2_codebase/ECST/test2project/wsgi.py
>          <Directory /opt/app/test2_codebase>
>              Order allow,deny
>              Allow from all
>          </Directory>
> 
> 
> WSGIDaemonProcess test1 
> Alias /test1/apache/static/ /opt/app/test1/apache/static/
> WSGIScriptAlias / /opt/app/test1/test1/test1.wsgi
>         <Directory "/opt/app/test1/apache">
>             Order deny,allow
>             Allow from all
>         </Directory>
> </VirtualHost>
> 
> Any help would be appreciated. Thanks!
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to modwsgi+unsubscr...@googlegroups.com 
> <mailto:modwsgi+unsubscr...@googlegroups.com>.
> To post to this group, send email to modwsgi@googlegroups.com 
> <mailto:modwsgi@googlegroups.com>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to