Browsing articles tagged with "modwsgi - Admins Goodies"
Jan 19, 2013
tom

CherryPy 3 with Apache 2 using ModWSGI: stack traces?

I am trying to show stack traces or at least some sort of errors rendered to the HTML response while using a WSGI script. A ModuleNotFound exception is raised when I tried to import a module the script can’t seem to find (which is fine for now), but all that is reported in the HTTP response is a rather vague Internal Server Error status 500 error which looks like Apache’s work. How can I get [...]

Continue Reading »
Dec 24, 2012
tom

only django work in presence of mod_wsgi , PHP not working

I am using PHP with apache2 and MySQL on a rackspace server, it is unmanaged cluoud hosting. I am hosting multiple sites using virtual host. Now i want to use Django on it. A site needs django so I have installed django and mod_wsgi using apt-get install . Then I wrote following lines in my httpd.conf WSGIScriptAlias / /var/www/djangosite/pyproject/mysite/mysite/wsgi.py WSGIPythonPath /var/www/djangosite/pyproject/mysite/<Directory /var/www/djangosite/pyproject/mysite/mysite/> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> But then only django [...]

Continue Reading »
Oct 9, 2012
tom

Can’t locate API module structure `mod_wsgi’

I’m working on setting up Trac to use wsgi, and am running into trouble getting mod_wsgi working. I downloaded and installed mod_sgi. [box]# apachectl configtest httpd: Syntax error on line 214 of /etc/httpd/conf/httpd.conf: Can’t locate API module structure `mod_wsgi’ in file /etc/httpd/modules/mod_wsgi.so: /etc/httpd/modules/mod_wsgi.so: undefined symbol: mod_wsgi Line 214 of httpd.conf: LoadModule mod_wsgi modules/mod_wsgi.so Here is mod_wsgi.so as found on the filesystem: [box]# locate mod_wsgi.so /usr/lib64/httpd/modules/mod_wsgi.so What might I be overlooking? Asked by a coder The [...]

Continue Reading »
Sep 26, 2012
tom

Installing mod_wsgi with python 2.7 on ubuntu

I tried to install mod_wsgi on my ubuntu server using the package manager, but noticed it depends on python 2.6. I’m using python 2.7, and would rather avoid installing 2.6… Does mod_wsgi really depend on python 2.6, even if I intend to run only python 2.7 with it? If not, is there a way to install mod_wsgi having only python 2.7 installed? Asked by Filipe Correia I’ve confirmed that the mod_wsgi package (libapache-mod-wsgi) supports both [...]

Continue Reading »
Sep 15, 2012
tom

Configuring varnish and django (apache/modwsgi)

I am trying to work out why my application keeps hitting the database while I have setup varnish infront of apache. I think I am missing some vital configuration, any tips are welcome This is my curl result: HTTP/1.1 200 OK Server: Apache/2.2.16 (Debian) Content-Language: en-us Vary: Accept,Accept-Encoding,Accept-Language,Cookie Cache-Control: s-maxage=60, no-transform, max-age=60 Content-Type: application/json; charset=utf-8 Date: Sat, 15 Sep 2012 08:19:17 GMT Connection: keep-alive My varnishlog: 13 BackendClose – apache 13 BackendOpen b apache 127.0.0.1 [...]

Continue Reading »
Jun 11, 2012
tom

Running apache + mod_wsgi as different user

I have a django project, which I am moving from the dev-server to apache. I have managed to get it server with mod_wsgi, but it runs as apache. Mod_wsgi documentation says, that if apache is run as root, it is possible to run mod_wsgi process as a different user. Q1: Is it possible to run mod_wsgi as different user without running apache as root? Q2: If answer to the above is no, how do I [...]

Continue Reading »
Jun 7, 2012
tom

Setting environment variables in mod_wsgi for Django

I’m running Django on an RHEL instance under Apache/mod_wsgi, and I’m having issues setting some environment variables for the Python process. All of the components (Apache, Python, mod_wsgi, external libraries) are built from source, not installed from the repos. The specific issue is support for Oracle support. I am able to connect to Oracle instances without a problem if I set the ORACLE_HOME and LD_LIBRARY_PATH on the command line when firing up Python myself, but [...]

Continue Reading »
Apr 2, 2012
tom

How may I know the amount of memory used by each one of my apache sites?

When I run ps aux I get the following process table http://pastebin.com/NJsASBek that shows how much memory is being used by each one of the subprocess. We can see apache proceess are shown like this: www-data 26487 0.0 0.9 245476 14920 ? Sl 17:32 0:00 /usr/sbin/apache2 -k start Where 2687 is the PID but I have no idea if that belongs to either foo1.domain.com or to foo2.domain.com or to fooX.domain.com etc… How can I know [...]

Continue Reading »
Apr 2, 2012
tom

Find site of apache from linux process table

I am using Ubuntu server and when I run ps aux I get the following process table http://pastebin.com/NJsASBek as we can see apache proceess are shown like this: www-data 26487 0.0 0.9 245476 14920 ? Sl 17:32 0:00 /usr/sbin/apache2 -k start Where 2687 is the PID. How can I know wich of my enabled sites belong that process? This is how my apache sites are defined http://pastebin.com/mcew79sH of course I am willing to edit my [...]

Continue Reading »
Mar 21, 2012
tom

Installing Mod-wsgi 3.3 for apache 2.2 and python 3.2

I am attempting to install Mod-wsgi 3.3 on an ubuntu 11.10 desktop edition with apache 2.2 and python 3.2 I downloaded the source tarball and extracted it. I configured it using the –with-python=/usr/bin/python3 option to configure. This is the only copy of python3 that I have installed. I then issued the commands make and sudo make install. I attempted to restart apache using sudo /etc/init.d/apache2 restart and get the following error message: apache2: Syntax error [...]

Continue Reading »