This commit is contained in:
zalun 2010-02-07 01:37:12 +00:00
Родитель 4e9ff1890b
Коммит 0496173bfe
3 изменённых файлов: 56 добавлений и 0 удалений

15
INSTALL
Просмотреть файл

@ -109,6 +109,21 @@ Adding third party projects
$ sudo ln -fs $SRC/grappelli $SITE_PACKAGES/grappelli
fi
###################
Configuring Apache
1. Edit WSGI script
* /path/to/projects/FlightDeck/apache/config_local.wsgi
* replace /path/to/projects to real path
2. Edit Apache config (Ubuntu way)
# copy config file
$ sudo cp /path/to/projects/FlightDeck/tools/apache-example.conf /etc/apache2/sites-available/flightdeck
# edit and change paths in /etc/apache2/sites-available
# enable site
$ sudo a2ensite flightdeck
$ sudo /etc/init.d/apache2 reload
# browse http://flightdeck.localhost
#####################

Просмотреть файл

@ -0,0 +1,16 @@
import os, sys
apache_configuration= os.path.dirname(__file__)
project = os.path.dirname(apache_configuration)
workspace = os.path.dirname(project)
sys.path.append(workspace)
sys.path.append('/path/to/projects/FlightDeck/flightdeckenv/lib/python2.6/site-packages/')
sys.path.append('/path/to/projects/FlightDeck/')
sys.path.append('/path/to/projects/FlightDeck/flightdeck/')
os.environ['DJANGO_SETTINGS_MODULE'] = 'flightdeck.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

25
tools/apache-example.conf Normal file
Просмотреть файл

@ -0,0 +1,25 @@
<VirtualHost *:80>
ServerAdmin john@example.com
ServerName flightdeck.localhost
<Directory /path/to/projects/FlightDeck/apache/>
Order deny,allow
Allow from all
Options Indexes FollowSymLinks
</Directory>
<Location "/adminmedia">
SetHandler default
</Location>
Alias /adminmedia /path/to/projects/FlightDeck/flightdeck/adminmedia
LogLevel warn
ErrorLog /path/to/projects/FlightDeck/logs/apache_error.log
CustomLog /path/to/projects/FlightDeck/logs/apache_access.log combined
WSGIDaemonProcess flightdeck.localhost user=www-data group=www-data threads=25
WSGIProcessGroup flightdeck.localhost
WSGIScriptAlias / /path/to/projects/FlightDeck/apache/config_local.wsgi
</VirtualHost>