First time here? Check out the FAQ!
1

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

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
SpiRaiL's avatar
11
SpiRaiL
asked 2012-08-01 05:12:28 -0600, updated 2012-08-02 03:49:27 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

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/
bgenevaux's avatar
201
bgenevaux
answered 2012-08-01 05:25:25 -0600
edit flag offensive 0 remove flag delete link

Comments

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 manage.py collectstatic when upgrading from the project directory.

Evgeny's avatar Evgeny (2012-08-02 08:44:31 -0600) edit
add a comment see more comments