Ask Your Question
1

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

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

SpiRaiL gravatar image

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

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>
 ServerAdmin you@example.com
 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
 </DirectoryMatch>
 <Directory "/srv/askbotDjango/askbot/upfiles">
    Order deny,allow
    Allow from all
 </Directory>
 <Directory "/srv/askbotDjango/static/">
    Order allow,deny
    Allow from all
 </Directory>
 #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]
     </LocationMatch>
 CustomLog /var/log/apache2/askbot/access_log common
 ErrorLog /var/log/apache2/askbot/error_log
 LogLevel debug
</VirtualHost>

 <VirtualHost 127.0.0.1:443>
 ServerAdmin you@example.com
 DocumentRoot /srv/askbotDjango
 ServerName example.com
 <LocationMatch "^(?!/admin)">
     RewriteEngine on
     RewriteRule django.wsgi(.*)$ http://#MY IP ADDR HERE#:8080$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 / /srv/askbotDjango/django.wsgi
 CustomLog /var/log/apache2/askbot/access_log common
 ErrorLog /var/log/apache2/askbot/error_log
</VirtualHost>

The same happens if i run on port 80.

If i run the server with the test script:

`python manage.py 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/setup.py';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
1

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

bgenevaux gravatar image

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

Comments

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

SpiRaiL gravatar imageSpiRaiL ( 2012-08-01 09:54:02 -0500 )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 gravatar imagebgenevaux ( 2012-08-02 02:38:08 -0500 )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 gravatar imageSpiRaiL ( 2012-08-02 03:38:24 -0500 )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 gravatar imageSpiRaiL ( 2012-08-02 03:48:09 -0500 )edit

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

Evgeny gravatar imageEvgeny ( 2012-08-02 08:44:31 -0500 )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

Stats

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

Seen: 1,089 times

Last updated: Aug 02 '12