Ask Your Question

GET /m/default/media/style/style.css?v=2 HTTP/1.1" 404

asked 2012-08-01 05:12:28 -0600

SpiRaiL's avatar

updated 2012-08-02 03:49:27 -0600

Im getting this for basically any file that starts with /m/

==> /var/log/apache2/askbot/access_log <==
#MY IP ADDR HERE# - - [01/Aug/2012:14:25:43 +0200] "GET /m/default/media/style/style.css?v=2 HTTP/1.1" 404 2359

==> /var/log/apache2/askbot/error_log <==
[Wed Aug 01 14:25:44 2012] [debug] mod_deflate.c(615): [client #MY IP ADDR HERE#] Zlib: Compressed 14003 to 2098 : URL /m/common/media/js/jquery.history.js, referer: http://#MY IP ADDR HERE#:8080/questions/

The basic questions page comes up. But its just the raw html. No js, no media, nothing else.

This is when i run with this apache configuration.

<VirtualHost *:8080>
 DocumentRoot /srv/askbotDjango
 ServerName askbot

 #aliases to serve static media directly
 #will probably need adjustment
 Alias /static/ /srv/askbotDjango/static/
 Alias /upfiles/ /srv/askbotDjango/askbot/upfiles/
 <DirectoryMatch "/srv/askbotDjango/askbot/skins/([^/]+)/media">
    Order deny,allow
    Allow from all
 <Directory "/srv/askbotDjango/askbot/upfiles">
    Order deny,allow
    Allow from all
 <Directory "/srv/askbotDjango/static/">
    Order allow,deny
    Allow from all
 #must be a distinct name within your apache configuration
 WSGIDaemonProcess askbot2
 WSGIProcessGroup askbot2
 WSGIScriptAlias / /srv/askbotDjango/django.wsgi
 #make all admin stuff except media go through secure connection
    <LocationMatch "/admin(?!/media)">
 RewriteEngine on
     RewriteRule /admin(.*)$ https://#MY IP ADDR HERE#/admin$1 [L,R=301]
 CustomLog /var/log/apache2/askbot/access_log common
 ErrorLog /var/log/apache2/askbot/error_log
 LogLevel debug

 DocumentRoot /srv/askbotDjango
 <LocationMatch "^(?!/admin)">
     RewriteEngine on
     RewriteRule django.wsgi(.*)$ http://#MY IP ADDR HERE#:8080$1 [L,R=301]
 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 / /srv/askbotDjango/django.wsgi
 CustomLog /var/log/apache2/askbot/access_log common
 ErrorLog /var/log/apache2/askbot/error_log

The same happens if i run on port 80.

If i run the server with the test script:

`python runserver `hostname -i`:8000`

Then it seems to be working.

[EDIT] I just tried this command. There seems to be an error at the end.

sudo -E pip install --upgrade askbot

running install_data

creating /usr/local/man

error: could not create '/usr/local/man': File exists

  Rolling back uninstall of nose
Command /usr/bin/python -c "import setuptools;__file__='/srv/build/nose/';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-RPOhQj-record/install-record.txt failed with error code 1
Storing complete log in /home/q2a/.pip/pip.log
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-08-01 05:25:25 -0600

bgenevaux's avatar

Try to add these two lines :

Alias /m/admin/ /usr/local/lib/python2.6/site-packages/django/contrib/admin/media/
Alias /m/ /usr/local/lib/python2.6/site-packages/askbot/skins/

just before

Alias /static/ /srv/askbotDjango/static/
Alias /upfiles/ /srv/askbotDjango/askbot/upfiles/
edit flag offensive delete link more


Still no good. b.t.w. these is nothing below the site-packages folder. perhaps i have missed a step then?

SpiRaiL's avatar SpiRaiL  ( 2012-08-01 09:54:02 -0600 )edit

Did you run pip install askbot (or pip install <path-to-askbot-src>/) ? btw even installing a basic python environment add sth to the site-package folder for me ...

bgenevaux's avatar bgenevaux  ( 2012-08-02 02:38:08 -0600 )edit

Yes. but I had to use Sudo. So probably I have a permissions error when www-data user trys to get the files. Im not really sure which files are the ones to give the permission to.

SpiRaiL's avatar SpiRaiL  ( 2012-08-02 03:38:24 -0600 )edit

I just ran this, and most of it went in again, as an upgrade, but it fails at the end:

sudo -E pip install --upgrade askbot

Ill but the result in the edit on the origional question

SpiRaiL's avatar SpiRaiL  ( 2012-08-02 03:48:09 -0600 )edit

@SpiRaiL - you need to do python collectstatic when upgrading from the project directory.

Evgeny's avatar Evgeny  ( 2012-08-02 08:44:31 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-08-01 05:12:28 -0600

Seen: 5,592 times

Last updated: Aug 02 '12