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

    2. 安裝python 2.5
    從官網(wǎng)上下載2.5版本,Python-2.5.2.tgz,解壓縮后./configure, make , make install.就可以完成安裝。默認(rèn)安裝目錄為/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 即可。安裝完畢后會(huì)在目錄/usr/local/apache2/modules下有文件mod_python.so,這個(gè)在后面要使用到。
    4. 安裝django 1.0
    官網(wǎng)下 載1.0版本Django-1.0.tar.gz,解壓縮,使用命令python setup.py install 安裝,注意,如果機(jī)器里有以前的版本,一定要把以前的版本文件完全卸載活刪除,django 不會(huì)覆蓋以前的文件。默認(rèn)安裝目錄為/usr/local/lib/python2.5/site-packages/django/
    5.安裝sqlite
    這里使用到的數(shù)據(jù)庫(kù)為sqlite3,所以要安裝相應(yīng)的包,這里 從官網(wǎng)下載pysqlite-2.3.5.tar.gz,安裝很容易。
    6.配置文件.
    這里使用了最簡(jiǎn)單的配置方法,直接修改/usr/local/apache2/conf/httpd.conf
    (1) ,默認(rèn)端口,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>

    其中藍(lán)色部分為要修改和添加的部分,/home/af/af是Django 工程所在的目錄,aftest為項(xiàng)目名稱。
    (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 閱讀(571) 評(píng)論(0)  編輯  收藏 所屬分類: Python
    主站蜘蛛池模板: 亚洲人成网址在线观看| 国产亚洲婷婷香蕉久久精品 | 亚洲性无码一区二区三区| 亚洲香蕉网久久综合影视| 国产产在线精品亚洲AAVV| 国产高清在线精品免费软件| 亚洲精品二区国产综合野狼| 精品国产污污免费网站入口| 国产亚洲AV夜间福利香蕉149 | 亚洲乱色熟女一区二区三区丝袜| 国产vA免费精品高清在线观看| 免费A级毛片无码A∨男男| 曰批全过程免费视频观看免费软件| 免费va人成视频网站全| jizz在线免费播放| 日本亚洲欧洲免费天堂午夜看片女人员 | 日本免费一二区在线电影| 亚洲综合一区二区精品导航 | 成年女人18级毛片毛片免费观看| 日本亚洲免费无线码| 日本免费网站在线观看| 一级中文字幕免费乱码专区 | 女人18一级毛片免费观看| 久久亚洲欧美国产精品| 2020因为爱你带字幕免费观看全集| 精品日韩亚洲AV无码一区二区三区| 久久午夜免费视频| 国产精品自拍亚洲| 亚洲AV无码一区东京热| 久草视频在线免费| 国产AV无码专区亚洲AV毛网站 | 亚洲av无码无在线观看红杏| 国产大片91精品免费观看不卡| 亚洲日本一线产区和二线| 亚洲一级Av无码毛片久久精品| 亚洲美国产亚洲AV| 亚洲精品制服丝袜四区| 99re热免费精品视频观看| 一区免费在线观看| 亚洲最大黄色网站| 成年在线观看网站免费|