Beispiel #1
0
def setup():
  file = _generateConfigFile()
  puts("--- nginx temp config file: ")
  print file.getvalue()
  
  _p(file, "/etc/nginx/sites-available/lmt.conf", use_sudo=True)  
  _s("ln -f -s /etc/nginx/sites-available/lmt.conf /etc/nginx/sites-enabled")
  _s("/etc/init.d/nginx reload") 
  


  # copy html files
  _s("cp -f -R %(REPRO_DIR)s/static_html %(INSTALL_DIR)s%(HTML_DIR)s" % conf)
  file = _generateHTMLSettings()
  _p(file, "%(INSTALL_DIR)s%(HTML_DIR)s/js/lmt.settings.js" % conf, use_sudo=True)  #local
  _s("chown -R %(SYS_USER)s:%(SYS_GROUP)s %(INSTALL_DIR)s/*" % conf)
  _s("chmod -R 774 %(INSTALL_DIR)s%(HTML_DIR)s/*" % conf)  

  # merge php
  with _cd("%(INSTALL_DIR)s%(HTML_DIR)s"%conf):
    _s("echo '<!DOCTYPE html>' > lmt.html")
    _s("echo '<html lang='en'>' >> lmt.html")
    _s("cat head.html >> lmt.html")
    _s("cat body.php >> lmt.html")
    _s("echo '</html>' >> lmt.html")
Beispiel #2
0
def setup():
  _s("mkdir -p %(INSTALL_DIR)s/run" % conf)
  file = _gen_start_script()
  _p(file, "%(INSTALL_DIR)s/run/start_guni.sh" % conf, use_sudo=True)  #local
  _s("chown -R %(SYS_USER)s:%(SYS_GROUP)s %(INSTALL_DIR)s/*" % conf)
  _s("chmod 744 %(INSTALL_DIR)s/run/start_guni.sh" % conf)
  
  
  #file = _gen_upstart_conf()
  #_p(file, "/etc/init/guni-lmt.conf" % conf, use_sudo=True)  #local
  #_s("ln -s -f /lib/init/upstart-job /etc/init.d/guni-lmt")
  #_s("initctl reload-configuration")
  
  
  file = _gen_supervisor_script()
  _p(file, "/etc/supervisor/conf.d/guni", use_sudo=True)

  _s("supervisorctl reload")
Beispiel #3
0
def setup():
  #rabbitmq server
  with settings(warn_only=True):
    _s("rabbitmqctl add_user %(BROKER_USER)s %(BROKER_PSW)s" % conf)
    _s("rabbitmqctl add_vhost %(BROKER_VHOST)s" % conf)
    _s('rabbitmqctl set_permissions -p %(BROKER_VHOST)s %(BROKER_USER)s ".*" ".*" ".*"' % conf)
 
  # celery deamon
  
  file = _gen_default_config()
  _p(file, "/etc/default/celeryd", use_sudo=True)
  
  
  file = _gen_init_d_script()
  _p(file, "/etc/init.d/celeryd", use_sudo=True)
  _s("chmod 777 /etc/init.d/celeryd")
  _s("mkdir -p /var/run/celery/")
  _s("chown lmt:www-lmt /var/run/celery/")