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')
评论列表
文章目录