幾乎是一模一樣啦,不過最後的地方我有特別標示清楚
1. FreeBSD是7.2,先更新完ports
2. Ports安装Apache2.2
#cd /usr/ports/www/apache22/ #make install clean3. Ports安裝python2.6 (FreeBSD 預設沒有安裝python還讓我蠻吃驚的)
#cd /usr/ports/lang/python26/ #make install clean4. Ports安裝mod_wsgi
#cd /usr/ports/www/mod_wsgi #make install clean5. Ports安装Django1.1
#cd /usr/ports/www/py-django #make install clean裝完他會提供你可以裝的database
我想試試看sqlite3
6. Ports安裝sqlite3
#cd /usr/ports/databases/py-sqlite3 #make install clean7. 設定http.conf
在家目錄裡面建立一個django的資料夾當作我們的目錄
#mkdir -p /usr/local/www/apache22/django #cd /usr/local/www/apache22/django #django-admin.py startproject cms增加httpd.conf以下內容
WSGIScriptAlias /cms /usr/local/www/apache22/django/cms/django.wsgi8. 接著建構django.wsgiWSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all
import os, sys sys.path.append('/usr/local/www/apache22/django') os.environ['DJANGO_SETTINGS_MODULE'] = 'cms.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()9. 看一下http://localhost/cms是否成功!~
0 意見:
張貼留言