Chinaunix首页 | 论坛 | 博客
  • 博客访问: 206560
  • 博文数量: 32
  • 博客积分: 3319
  • 博客等级: 中校
  • 技术积分: 340
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-26 21:40
文章分类

全部博文(32)

文章存档

2010年(31)

2009年(1)

分类: Python/Ruby

2010-05-10 11:37:25

1.安装配置lighttpd

pywugw@pywugw-laptop:~$ sudo apt-get install lighttpd



pywugw@pywugw-laptop:~$ cd /etc/lighttpd/
pywugw@pywugw-laptop:/etc/lighttpd$ sudo cp lighttpd.conf lighttpd.conf.bak

pywugw@pywugw-laptop:/etc/lighttpd$ sudo vi lighttpd.conf



修改配置如下:

server.modules = (
            "mod_access",
            "mod_alias",
            "mod_access",
            "mod_accesslog",
            "mod_compress",
            "mod_rewrite",
            "mod_fastcgi",
)

$HTTP["remoteip"] =~ "192.168.32.26" {
    server.document-root = "/home/pywugw/dj"
    fastcgi.server = (
         "/pywugw.fcgi" => (
            "main" => (
                "host" => "192.168.32.26",
                "port" => 8000,
                "check-local" => "disable"
            )
        ),
    )

    url.rewrite-once = (
       "^(/.*)$" => "/pywugw.fcgi$1",
    )
}



2. 安装flup和Django

pywugw@pywugw-laptop:~/Downloads$ wget http://www.saddi.com/software/flup/dist/flup-1.0.2.tar.gz
pywugw@pywugw-laptop:~/Downloads$ tar -zxvf flup-1.0.2.tar.gz
pywugw@pywugw-laptop:~/Downloads$ cd flup-1.0.2/
pywugw@pywugw-laptop:~/Downloads/flup-1.0.2$ sudo python setup.py install

pywugw@pywugw-laptop:~/Downloads$ wget http://www.djangoproject.com/download/1.1.1/tarball/
pywugw@pywugw-laptop:~/Downloads$ tar -zxvf Django-1.1.1.tar.gz
pywugw@pywugw-laptop:~/Downloads$ cd Django-1.1.1/
pywugw@pywugw-laptop:~/Downloads/Django-1.1.1$ sudo python setup.py install

pywugw@pywugw-laptop:~$ pwd
/home/pywugw
pywugw@pywugw-laptop:~$ django-admin.py startproject dj
pywugw@pywugw-laptop:~$ cd dj
pywugw@pywugw-laptop:~$ python manage.py runfcgi method=threaded host=192.168.32.26 port=8000



3. 重启lighttpd生效

pywugw@pywugw-laptop:~$ sudo /etc/init.d/lighttpd restart




阅读(2293) | 评论(0) | 转发(0) |
0

上一篇:PHP获取时间区间

下一篇:winxp/win7修复MBR

给主人留下些什么吧!~~