webserver.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:djangoeurope-fabfile 作者: wservices 项目源码 文件源码
def install_lighttpd(*args, **kwargs):
    home = run('echo $HOME')
    lighttpd_dir = os.path.join(home, 'lighttpd')
    lighttpd_port = kwargs.get('port')

    run('mkdir -p %s' % lighttpd_dir)
    run('wget https://templates.wservices.ch/lighttpd/lighttpd.conf -O %s' % (os.path.join(lighttpd_dir, 'lighttpd.conf')))
    run('wget https://templates.wservices.ch/lighttpd/port.conf -O %s' % (os.path.join(lighttpd_dir, 'port.conf')))
    append(os.path.join(lighttpd_dir, 'port.conf'), 'server.port = %s' % lighttpd_port)
    if not exists(os.path.join(lighttpd_dir, 'django.conf')):
        run('wget https://templates.wservices.ch/lighttpd/django.conf -O %s' % (os.path.join(lighttpd_dir, 'django.conf')))

    run('mkdir -p ~/init')
    if not exists('~/init/lighttpd'):
        run('wget https://templates.wservices.ch/lighttpd/init -O ~/init/lighttpd')
        run('chmod 750 ~/init/lighttpd')

    if exists('~/lighttpd/lighttpd.pid'):
        run('~/init/lighttpd restart')
    else:
        run('~/init/lighttpd start')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号