<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Sealyu

    --- 博客已遷移至: http://www.sealyu.com/blog

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評論 :: 0 Trackbacks
    1. 安裝 apach2 服務器。
    這個很簡單,從官網(wǎng)上下載源代碼,httpd-2.2.9.tar.gz,解壓縮后 configure , make ,make install. 會安裝在/usr/local/目錄下。
    使用命令/usr/local/apache2/bin/apachectl start     開啟apache服務。
    使用命令/usr/local/apache2/bin/apachectl stop     停止apache服務。
    使用命令/usr/local/apache2/bin/apachectl restart 重新啟動apache服務。

    2. 安裝python 2.5
    從官網(wǎng)上下載2.5版本,Python-2.5.2.tgz,解壓縮后./configure, make , make install.就可以完成安裝。默認安裝目錄為/usr/local/lib/python2.5/
    3. 安裝mod_python.
    ./configure –with-apxs=/usr/local/apache2/bin/apxs –with-python=/usr/bin/python2.5,再make, make install 即可。安裝完畢后會在目錄/usr/local/apache2/modules下有文件mod_python.so,這個在后面要使用到。
    4. 安裝django 1.0
    官網(wǎng)下 載1.0版本Django-1.0.tar.gz,解壓縮,使用命令python setup.py install 安裝,注意,如果機器里有以前的版本,一定要把以前的版本文件完全卸載活刪除,django 不會覆蓋以前的文件。默認安裝目錄為/usr/local/lib/python2.5/site-packages/django/
    5.安裝sqlite
    這里使用到的數(shù)據(jù)庫為sqlite3,所以要安裝相應的包,這里 從官網(wǎng)下載pysqlite-2.3.5.tar.gz,安裝很容易。
    6.配置文件.
    這里使用了最簡單的配置方法,直接修改/usr/local/apache2/conf/httpd.conf
    (1) ,默認端口,80,可以不修改。
    (2) 在有LoadModule example字樣的下面添加一下一行
    LoadModule python_module modules/mod_python.so
    (3) 配置ServerName,在有 #ServerName www.example.com:80字樣的下面添加一下行:
    ServerName yourIP:80
    (4) 這是最重要的一步了。在有字樣# This should be changed to whatever you set DocumentRoot to.的后面,修改<Directory> … </Directory>中間的內(nèi)容為:

    <Directory “/home/af/af“>
    #
    # Possible values for the Options directive are “None”, “All”,
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that “MultiViews” must be named *explicitly* — “Options All”
    # doesn’t give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    #Options Indexes FollowSymLinks
    #PythonHandler django.core.handlers.modpython
    PythonPath “['/home/af/af','/usr/local/lib/python2.5/site-packages'] + sys.path”
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE aftest.settings
    SetHandler python-program
    PythonDebug On

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    #AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    #Order allow,deny
    Allow from all

    </Directory>

    其中藍色部分為要修改和添加的部分,/home/af/af是Django 工程所在的目錄,aftest為項目名稱。
    (5)添加media。這里以安裝Django自己提供的admin為例。
    在上一步的</Directory>下面再添加
    Alias /media /usr/local/lib/python2.5/site-packages/django/contrib/admin/media
    <Location “/media”>
    Options None
    SetHandler None
    Allow from all
    </Location>

    即可。

    配置完畢。

    posted on 2008-11-06 15:59 seal 閱讀(564) 評論(0)  編輯  收藏 所屬分類: Python
    主站蜘蛛池模板: 成年人性生活免费视频| 99免费观看视频| 日韩高清免费观看| 亚洲不卡中文字幕| 波多野结衣免费在线| 亚洲a视频在线观看| 在线看片免费不卡人成视频| 亚洲沟沟美女亚洲沟沟| 女人体1963午夜免费视频| 国产偷国产偷亚洲清高动态图| 国产免费牲交视频免费播放| 免费又黄又爽又猛的毛片| 人妻巨大乳hd免费看| 国产精品酒店视频免费看| 超清首页国产亚洲丝袜| 老外毛片免费视频播放| 国产在线国偷精品产拍免费| 亚洲中文字幕久久久一区| 国产成人精品久久免费动漫| 亚洲综合激情九月婷婷| 免费无码黄动漫在线观看| 特级毛片爽www免费版| 亚洲国产日韩成人综合天堂 | 亚洲一级黄色视频| a级特黄毛片免费观看| 亚洲欧洲国产成人精品| 好吊妞在线成人免费| 乱淫片免费影院观看| 亚洲一区综合在线播放| 成人一a毛片免费视频| 一级一片免费视频播放| 亚洲综合精品香蕉久久网97| 国产精品久久久久久久久久免费| 美女被艹免费视频| 久久精品国产亚洲Aⅴ香蕉| 无码免费一区二区三区免费播放| 亚洲高清一区二区三区| 亚洲高清国产拍精品青青草原| 久久久久国产精品免费网站| 亚洲国产AV无码一区二区三区| 国产高清在线免费视频|