librelist archives

« back to archive

Apache (mod-wsgi) issue

Apache (mod-wsgi) issue

From:
Laszlo Papp
Date:
2013-09-19 @ 09:19
Dear list,

My wsgi file called "cfoo.wsgi" does not seem to load through apache
(mod-wsgi). I see the raw folder content when trying to load the
A.B.C.D/cfoo.wsgi page rather than getting it interpreted through the wsgi
protocol.

This is a Ubuntu 10.04 distribution installed on the server, and almost the
same vhost config file works on another Ubuntu server which is version
12.04. I copied the file from there to this machine with some slight
customization due to the version differences.

You can see my vhost site config and the wsgi files below. I am enabling
the site with /usr/sbin/a2ensite cfoo which runs successfully. Then, I just
reload (although tried restart) apache 2. The mod_wsgi module seems to be
loaded based on the apache2ctl -M output.

==== /var/www/cfoo/cfoo.wsgi ====

import sys
sys.path.insert(0, '/opt/cfoo')

from cfoo import application

==== cat /etc/apache2/sites-available/cfoo ====

<VirtualHost *:80>

    ServerAdmin webmaster@localhost

    ServerName cfoo.com

    # WSGIDaemonProcess cfoo # user=http group=http threads=5
    WSGIDaemonProcess cfoo threads=5
    WSGIScriptAlias / /var/www/cfoo/cfoo.wsgi

    <Directory /var/www/cfoo>


        WSGIProcessGroup cfoo

        WSGIApplicationGroup %{GLOBAL}



        Order deny,allow



        Allow from all



    </Directory>







        DocumentRoot /var/www



        <Directory />



                Options FollowSymLinks



                AllowOverride None



        </Directory>



        <Directory /var/www/>



                Options Indexes FollowSymLinks MultiViews



                AllowOverride None



                Order allow,deny



                Allow from all



        </Directory>







        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/



        <Directory "/usr/lib/cgi-bin">



                AllowOverride None



                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch



                Order allow,deny



                Allow from all



        </Directory>

        ErrorLog /var/log/apache2/error.log

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

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>


</VirtualHost>

==== The end of the apache error log ====

[Wed Sep 18 18:52:04 2013] [notice] Apache/2.2.14 (Ubuntu)
PHP/5.3.2-1ubuntu4.21 with cfoo mod_wsgi/2.8 Python/2.6.5 mod_perl/2.0.4
Perl/v5.10.1 configured -- resuming normal operations
[Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Attach interpreter
''.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8702): mod_wsgi (pid=21945):
Starting 5 threads in daemon process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
Starting thread 1 in daemon process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
Starting thread 2 in daemon process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
Starting thread 3 in daemon process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
Starting thread 4 in daemon process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
Starting thread 5 in daemon process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Enable deadlock
thread in process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Enable monitor
thread in process 'cfoo'.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8542): mod_wsgi (pid=21945):
Deadlock timeout is 300.
[Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8545): mod_wsgi (pid=21945):
Inactivity timeout is 0.

Thank you in advance,
Laszlo

Re: [flask] Apache (mod-wsgi) issue

From:
Joseph Mutumi
Date:
2013-09-19 @ 20:22
Hello,

Just a few questions here:

Which HTTP response code is returned when you try to access the application
?
Possibly the omission of `Options Indexes FollowSymLinks MultiViews` for
the directory ` /var/www/cfoo`?
What's the file hierarchy like under /opt/cfoo ?



On Thu, Sep 19, 2013 at 12:19 PM, Laszlo Papp <lpapp@kde.org> wrote:

> Dear list,
>
> My wsgi file called "cfoo.wsgi" does not seem to load through apache
> (mod-wsgi). I see the raw folder content when trying to load the
> A.B.C.D/cfoo.wsgi page rather than getting it interpreted through the wsgi
> protocol.
>
> This is a Ubuntu 10.04 distribution installed on the server, and almost
> the same vhost config file works on another Ubuntu server which is version
> 12.04. I copied the file from there to this machine with some slight
> customization due to the version differences.
>
> You can see my vhost site config and the wsgi files below. I am enabling
> the site with /usr/sbin/a2ensite cfoo which runs successfully. Then, I just
> reload (although tried restart) apache 2. The mod_wsgi module seems to be
> loaded based on the apache2ctl -M output.
>
> ==== /var/www/cfoo/cfoo.wsgi ====
>
> import sys
> sys.path.insert(0, '/opt/cfoo')
>
> from cfoo import application
>
> ==== cat /etc/apache2/sites-available/cfoo ====
>
> <VirtualHost *:80>
>
>     ServerAdmin webmaster@localhost
>
>     ServerName cfoo.com
>
>     # WSGIDaemonProcess cfoo # user=http group=http threads=5
>     WSGIDaemonProcess cfoo threads=5
>     WSGIScriptAlias / /var/www/cfoo/cfoo.wsgi
>
>     <Directory /var/www/cfoo>
>
>
>
>         WSGIProcessGroup cfoo
>
>         WSGIApplicationGroup %{GLOBAL}
>
>
>
>         Order deny,allow
>
>
>
>         Allow from all
>
>
>
>     </Directory>
>
>
>
>
>
>
>
>         DocumentRoot /var/www
>
>
>
>         <Directory />
>
>
>
>                 Options FollowSymLinks
>
>
>
>                 AllowOverride None
>
>
>
>         </Directory>
>
>
>
>         <Directory /var/www/>
>
>
>
>                 Options Indexes FollowSymLinks MultiViews
>
>
>
>                 AllowOverride None
>
>
>
>                 Order allow,deny
>
>
>
>                 Allow from all
>
>
>
>         </Directory>
>
>
>
>
>
>
>
>         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>
>
>
>         <Directory "/usr/lib/cgi-bin">
>
>
>
>                 AllowOverride None
>
>
>
>                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>
>
>
>                 Order allow,deny
>
>
>
>                 Allow from all
>
>
>
>         </Directory>
>
>         ErrorLog /var/log/apache2/error.log
>
>         # Possible values include: debug, info, notice, warn, error, crit,
>         # alert, emerg.
>         LogLevel debug
>
>         CustomLog /var/log/apache2/access.log combined
>
>     Alias /doc/ "/usr/share/doc/"
>     <Directory "/usr/share/doc/">
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride None
>         Order deny,allow
>         Deny from all
>         Allow from 127.0.0.0/255.0.0.0 ::1/128
>     </Directory>
>
>
> </VirtualHost>
>
> ==== The end of the apache error log ====
>
> [Wed Sep 18 18:52:04 2013] [notice] Apache/2.2.14 (Ubuntu)
> PHP/5.3.2-1ubuntu4.21 with cfoo mod_wsgi/2.8 Python/2.6.5 mod_perl/2.0.4
> Perl/v5.10.1 configured -- resuming normal operations
> [Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Attach interpreter
> ''.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8702): mod_wsgi (pid=21945):
> Starting 5 threads in daemon process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
> Starting thread 1 in daemon process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
> Starting thread 2 in daemon process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
> Starting thread 3 in daemon process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
> Starting thread 4 in daemon process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi (pid=21945):
> Starting thread 5 in daemon process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Enable deadlock
> thread in process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Enable monitor
> thread in process 'cfoo'.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8542): mod_wsgi (pid=21945):
> Deadlock timeout is 300.
> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8545): mod_wsgi (pid=21945):
> Inactivity timeout is 0.
>
> Thank you in advance,
> Laszlo
>
>
>

Re: [flask] Apache (mod-wsgi) issue

From:
Laszlo Papp
Date:
2013-09-19 @ 20:26
Oh, sorry, I thought my email to the mailing would have been lost as I did
not see it in the archive today when I checked. Hence, I forgot to notify
the list it has now been resolved. Apologies for that.

I had to remove the "default" file in sites-enabled, and then it worked
fine.


On Thu, Sep 19, 2013 at 9:22 PM, Joseph Mutumi <jjmutumi@gmail.com> wrote:

> Hello,
>
> Just a few questions here:
>
> Which HTTP response code is returned when you try to access the
> application ?
> Possibly the omission of `Options Indexes FollowSymLinks MultiViews` for
> the directory ` /var/www/cfoo`?
> What's the file hierarchy like under /opt/cfoo ?
>
>
>
> On Thu, Sep 19, 2013 at 12:19 PM, Laszlo Papp <lpapp@kde.org> wrote:
>
>> Dear list,
>>
>> My wsgi file called "cfoo.wsgi" does not seem to load through apache
>> (mod-wsgi). I see the raw folder content when trying to load the
>> A.B.C.D/cfoo.wsgi page rather than getting it interpreted through the wsgi
>> protocol.
>>
>> This is a Ubuntu 10.04 distribution installed on the server, and almost
>> the same vhost config file works on another Ubuntu server which is version
>> 12.04. I copied the file from there to this machine with some slight
>> customization due to the version differences.
>>
>> You can see my vhost site config and the wsgi files below. I am enabling
>> the site with /usr/sbin/a2ensite cfoo which runs successfully. Then, I just
>> reload (although tried restart) apache 2. The mod_wsgi module seems to be
>> loaded based on the apache2ctl -M output.
>>
>> ==== /var/www/cfoo/cfoo.wsgi ====
>>
>> import sys
>> sys.path.insert(0, '/opt/cfoo')
>>
>> from cfoo import application
>>
>> ==== cat /etc/apache2/sites-available/cfoo ====
>>
>> <VirtualHost *:80>
>>
>>     ServerAdmin webmaster@localhost
>>
>>     ServerName cfoo.com
>>
>>     # WSGIDaemonProcess cfoo # user=http group=http threads=5
>>     WSGIDaemonProcess cfoo threads=5
>>     WSGIScriptAlias / /var/www/cfoo/cfoo.wsgi
>>
>>     <Directory /var/www/cfoo>
>>
>>
>>
>>         WSGIProcessGroup cfoo
>>
>>         WSGIApplicationGroup %{GLOBAL}
>>
>>
>>
>>         Order deny,allow
>>
>>
>>
>>         Allow from all
>>
>>
>>
>>     </Directory>
>>
>>
>>
>>
>>
>>
>>
>>         DocumentRoot /var/www
>>
>>
>>
>>         <Directory />
>>
>>
>>
>>                 Options FollowSymLinks
>>
>>
>>
>>                 AllowOverride None
>>
>>
>>
>>         </Directory>
>>
>>
>>
>>         <Directory /var/www/>
>>
>>
>>
>>                 Options Indexes FollowSymLinks MultiViews
>>
>>
>>
>>                 AllowOverride None
>>
>>
>>
>>                 Order allow,deny
>>
>>
>>
>>                 Allow from all
>>
>>
>>
>>         </Directory>
>>
>>
>>
>>
>>
>>
>>
>>         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>>
>>
>>
>>         <Directory "/usr/lib/cgi-bin">
>>
>>
>>
>>                 AllowOverride None
>>
>>
>>
>>                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>
>>
>>
>>                 Order allow,deny
>>
>>
>>
>>                 Allow from all
>>
>>
>>
>>         </Directory>
>>
>>         ErrorLog /var/log/apache2/error.log
>>
>>         # Possible values include: debug, info, notice, warn, error, crit,
>>         # alert, emerg.
>>         LogLevel debug
>>
>>         CustomLog /var/log/apache2/access.log combined
>>
>>     Alias /doc/ "/usr/share/doc/"
>>     <Directory "/usr/share/doc/">
>>         Options Indexes MultiViews FollowSymLinks
>>         AllowOverride None
>>         Order deny,allow
>>         Deny from all
>>         Allow from 127.0.0.0/255.0.0.0 ::1/128
>>     </Directory>
>>
>>
>> </VirtualHost>
>>
>> ==== The end of the apache error log ====
>>
>> [Wed Sep 18 18:52:04 2013] [notice] Apache/2.2.14 (Ubuntu)
>> PHP/5.3.2-1ubuntu4.21 with cfoo mod_wsgi/2.8 Python/2.6.5 mod_perl/2.0.4
>> Perl/v5.10.1 configured -- resuming normal operations
>> [Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Attach
>> interpreter ''.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8702): mod_wsgi
>> (pid=21945): Starting 5 threads in daemon process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi
>> (pid=21945): Starting thread 1 in daemon process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi
>> (pid=21945): Starting thread 2 in daemon process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi
>> (pid=21945): Starting thread 3 in daemon process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi
>> (pid=21945): Starting thread 4 in daemon process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8708): mod_wsgi
>> (pid=21945): Starting thread 5 in daemon process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Enable deadlock
>> thread in process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [info] mod_wsgi (pid=21945): Enable monitor
>> thread in process 'cfoo'.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8542): mod_wsgi
>> (pid=21945): Deadlock timeout is 300.
>> [Wed Sep 18 18:52:04 2013] [debug] mod_wsgi.c(8545): mod_wsgi
>> (pid=21945): Inactivity timeout is 0.
>>
>> Thank you in advance,
>> Laszlo
>>
>>
>>
>