Commits

Mikhail Korobov committed 22f1628

better apache config

Comments (0)

Files changed (5)

config_templates/apache.config

 <VirtualHost *:{{ APACHE_PORT }}>
     ServerName {{ SERVER_NAME }}
     ServerAlias www.{{ SERVER_NAME }}
-    ServerAdmin example@example.com
+    ServerAdmin {{ SERVER_ADMIN }}
 
     WSGIDaemonProcess {{ INSTANCE_NAME }} user={{ USER }} group={{ USER }} processes={{ PROCESSES }} threads={{ THREADS }}
     WSGIProcessGroup {{ INSTANCE_NAME }}
 
-    WSGIScriptAlias / {{ SRC_DIR }}/hosting/generated/django.wsgi
-    <Directory {{ SRC_DIR }}/hosting/generated>
+    WSGIScriptAlias / {{ ENV_DIR }}/var/wsgi/django.wsgi
+    <Directory {{ ENV_DIR }}/var/wsgi/>
         Order deny,allow
         allow from all
     </Directory>

fab_deploy/commands.py

 
 def touch():
     """ Reloads source code by touching the wsgi file """
-    wsgi_file = env.conf['ENV_DIR']+'/etc/django.wsgi'
+    wsgi_file = env.conf['ENV_DIR']+'/var/wsgi/django.wsgi'
     run('touch ' + wsgi_file)
 
 @inside_project

fab_deploy/deploy.py

     upload_config_template('hgrc', env.conf['SRC_DIR'] + '/.hg/hgrc')
 
 def make_wsgi():
-    upload_config_template('django.wsgi')
+    wsgi_dir = env.conf['ENV_DIR']+'/var/wsgi/'
+    run('mkdir -p ' + wsgi_dir)
+    upload_config_template('django.wsgi', wsgi_dir+'django.wsgi')
 
 
 @run_as('root')

fab_deploy/system.py

     run('/etc/init.d/apache2 stop')
     run('/etc/init.d/apache2 start')
 
-
 #@run_as('root')
 #def install_backup_system():
 #    run('aptitude install -y s3cmd ruby rubygems libxml2-dev libxslt-dev libopenssl-ruby')

fab_deploy/utils.py

     if 'INSTANCE_NAME' not in env.conf:
         env.conf['INSTANCE_NAME'] = env.user
 
-    if 'SERVER_NAME' not in env.conf:
-        env.conf['SERVER_NAME'] = env.hosts[0]
-
     defaults = dict(
         HG_BRANCH = 'default',
         DB_NAME = env.conf['INSTANCE_NAME'],
         SRC_DIR = HOME_DIR + '/src/' + env.conf['INSTANCE_NAME'],
         USER = env.user,
         HOST = env.hosts[0],
+        SERVER_NAME = 'env.hosts[0]',
+        SERVER_ADMIN = 'example@example.com',
     )
     defaults.update(env.conf)
     env.conf = defaults