First time here? Check out the FAQ!

Somerandomguy's profile - activity

2014-09-17 07:35:49 -0500 received badge Editor (source)
2014-09-17 07:34:45 -0500 asked a question After adding mod_wsgi settings to httpd.conf, apache no longer restarts?

So after setting up mod_wsgi (which works), I can't seem to configure httpd.conf without getting apache to fail.

Here are the settings I'm using:

#NOTE: the directory paths used here may be adjusted

#the following two directories must be both readable and writable by apache
#WSGISocketPrefix /path/to/socket/sock #This directory doesn't exist?? /var/run/wsgi
#WSGIPythonEggs /var/python/eggs #Neither does this!

#the following directory must be readable by apache
WSGIPythonHome /usr/local

#NOTE: all urs below will need to be adjusted if
#settings.FORUM_SCRIPT_ALIAS is anything other than empty string (e.g. = 'forum/')

#replace with 127.0.0.1 with real IP address
<VirtualHost 213.39.50.27:80>
     DocumentRoot /home/akontos/djangoaskbot/
     ServerName 213.39.50.27

     #aliases to serve static media directly
     #will probably need adjustment
     Alias /m/ /home/akontos/djangoaskbot/static/
     Alias /upfiles/ /home/akontos/djangoaskbot/askbot/upfiles/
     <DirectoryMatch "/home/akontos/djangoaskbot/askbot/skins/([^/]+)/media">
        Order deny,allow
        Allow from all
     </DirectoryMatch>
     <Directory "/home/akontos/djangoaskbot/askbot/upfiles">
        Order deny,allow
        Allow from all
     </Directory>
     #must be a distinct name within your apache configuration
     WSGIDaemonProcess askbot2
     WSGIProcessGroup askbot2
     WSGIScriptAlias / /home/akontos/djangoaskbot/django.wsgi
     make all admin stuff except media go through secure connection
     <LocationMatch "/admin(?!/media)">
     RewriteEngine on
         RewriteRule /admin(.*)$ 213.39.50.27/admin$1 [L,R=301]
         </LocationMatch>
     CustomLog /var/log/httpd/askbot/access_log common
     ErrorLog /var/log/httpd/askbot/error_log
     LogLevel debug
</VirtualHost>
<VirtualHost 213.39.50.27:443>
     DocumentRoot /home/akontos/djangoaskbot
     ServerName 213.39.50.27
     <LocationMatch "^(?!/admin)">
         RewriteEngine on
         RewriteRule django.wsgi(.*)$ 213.39.50.27$1 [L,R=301]
     </LocationMatch>
     SSLEngine on
     #your SSL keys
     SSLCertificateFile /etc/httpd/ssl.crt/server.crt
     SSLCertificateKeyFile /etc/httpd/ssl.key/server.key
     Alias /admin/media/ /usr/local/lib/python2.6/site-packages/django/contrib/admin/media/
     WSGIScriptAlias / /home/akontos/django.wsgi
     CustomLog /var/log/httpd/askbot/access_log common
     ErrorLog /var/log/httpd/askbot/error_log
</VirtualHost>

Restarting apache gives: systemd[1]: Failed to start The Apache HTTP Server.

I'm using CentOS 7 if that helps.