Kubla:Deployment
From MozillaWiki
Kubla » Deployment
Contents
Pre-deployment Checklist
- Server prerequisites
- php5
- mysqli
- mbstring extension (yum install php-mbstring)
- gd extension (yum install php-gd)
- Python dependencies:
- pysvn (no package, have to install manually)
- MySQLdb (yum install MySQL-python)
- cse (no package, have to install manually)
- PHPSerialize
Setting up mozilla.com sites
- Trunk (this step should already be done)
- checkout http://svn.mozilla.org/projects/mozilla.com/trunk/
- cp includes/config.inc.php-dist to includes/config.inc.php and fill in variables
- Point *.www-trunk.stage.mozilla.com to this site.
- Stage
- checkout http://svn.mozilla.org/projects/mozilla.com/tags/stage/
- cp includes/config.inc.php-dist to includes/config.inc.php and fill in variables
- Point *.www.stage.mozilla.com to this site.
- Production (this step should already be done)
- checkout http://svn.mozilla.org/projects/mozilla.com/tags/production/
- cp includes/config.inc.php-dist to includes/config.inc.php and fill in variables
- Point *.mozilla.com to this site.
Setting up Kubla
- Checkout svn+ssh://svn.mozilla.org/projects/kubla/tags/production/
- Create an sql database and give a user full permissions to it
- cp sites/default/settings.php-dist to sites/default/settings.php, and give apache temporary write permissions
- Load https://kubla.mozilla.com/, choose the Mozilla Setup, and follow the directions. (mozilla.com uses mysqli)
- Add LDAP auth to apache. Your vhost should look similar to:
<VirtualHost kubla.mozilla.com:443> ServerName kubla.mozilla.com ServerAdmin webmaster@kubla.mozilla.com DocumentRoot /data/kubla.mozilla.com php_value memory_limit 64M SSLEngine On <Directory /data/kubla.mozilla.com> AllowOverride All AuthType Basic # Not localizable :( AuthName "Kubla Login: Use your LDAP username and password" AuthBasicProvider ldap AuthLDAPBindDN uid=binduser,ou=logins,dc=mozilla AuthLDAPBindPassword xxxxxxxxxxxxxxxxxxxxx AuthLDAPURL ldap://ldap.mozilla.org/dc=mozilla?mail AuthzLDAPAuthoritative Off Require valid-user </Directory> </VirtualHost>
- Setup Kublad
- cp scripts/kublad.conf-dist scripts/kublad.conf
- Fill in appropriate values. Add a 'listenPort' value if you need to change the default port (8778)
- run python scripts/kubald.py --verbose and make sure the daemon stays running (check the log file if it exits). Please think through permissions at this stage and make sure this is running as the appropriate user!
- Add https://hostname:port/heartbeat to nagios. This will return a 200 normally, if the daemon detects something amiss, it will return a 500.
- Anytime you start kublad, make sure the trunk and prod paths are completely up to date. kublad can keep them up to date, but it doesn't go back over time and update old files.
- cp scripts/kublad.conf-dist scripts/kublad.conf
- Setup the SVN commit hook
- Copy scripts/svn_hooks/kubla-post-commit.py to your SVN hooks/ directory
- Copy scripts/svn_hooks/kubla-post-commit.conf-dist to your SVN hooks/ directory and remove the -dist.
- Fill in appropriate values in kubla-post-commit.conf
Post-deployment Checklist
- (note: this is currently broken due to httpauth) Create a cron job (I'd suggest at least every hour), similar to:
cd /data/kubla.mozilla.com/ /usr/bin/php /data/kubla.mozilla.com/cron.php
- Create a cron job to `svn update` the production copy of mozilla.com
- Have a look at the status report page: https://kubla.mozilla.com/admin/logs/status