Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two virtual hosts on different ports. Here is what the config file looks like (roughly):

<VirtualHost *:80>
    ServerName www.example.com

    Alias /favicon.ico /home/ubuntu/alpha/favicon.ico
    Alias /static/ /home/ubuntu/alpha/static/

    WSGIDaemonProcess alpha_wsgi user=www-data group=www-data
    WSGIScriptAlias / /home/ubuntu/alpha/alpha/wsgi.py
    WSGIProcessGroup alpha_wsgi

    ServerAdmin info@example.com

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:1222>
    ServerName www.example.com

    Alias /favicon.ico /home/ubuntu/main/favicon.ico
    Alias /static/ /home/ubuntu/main/static/

    WSGIDaemonProcess main_wsgi user=www-data group=www-data
    WSGIScriptAlias / /home/ubuntu/main/main/wsgi.py
    WSGIProcessGroup main_wsgi

    ServerAdmin info@example.com

    ErrorLog ${APACHE_LOG_DIR}/error_main.log

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access_main.log combined
</VirtualHost>

I'm using the default Ubuntu 12.10 (I think) Apache 2.2 install. My log files are created, but never written to:

$ ls /var/log/apache2/ -l
total 4
-rw-r--r-- 1 root root    0 Nov  7 12:28 access.log
-rw-r--r-- 1 root root    0 Nov  7 12:28 access_main.log
-rw-r--r-- 1 root root 1065 Nov  7 12:28 error.log
-rw-r--r-- 1 root root    0 Nov  7 12:28 error_main.log
-rw-r--r-- 1 root root    0 Nov  7 12:25 other_vhosts_access.log

It's not a permissions thing. I tried chmod a+w to no effect. The contents of error.log is just some normal stuff about WSGI.

It did work before I added the second virtual host. What's going on?

Oh and I've also tried commenting out one or both sets of logging directives. It didn't work.

Edit

error.log doesn't say anything interesting:

[Wed Nov 07 12:25:32 2012] [warn] mod_wsgi: Compiled for Python/2.7.2+.
[Wed Nov 07 12:25:32 2012] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Wed Nov 07 12:25:33 2012] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.4 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
share|improve this question
    
What does the error log say ? –  adaptr Nov 8 '12 at 16:42
    
@adaptr Nothing interesting. I put it in the question. –  Timmmm Nov 8 '12 at 16:48
    
Can you clarify log are you concerned about and what you are expecting to see? The access log or the error log? –  Graham Dumpleton Nov 8 '12 at 23:22
    
Both. I access the site, and nothing is written, and when I generate a test error nothing is written. To be clear, it worked when I only had one virtual host. –  Timmmm Nov 9 '12 at 9:47
    
I narrowed it down a bit. Exactly the same config works if the two sites have different ServerNames and the same port (80). –  Timmmm Nov 9 '12 at 17:57
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.