User:Wenzel/Bouncer:Tuxedo Deployment: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with '== Deployment hints for Bouncer's Tuxedo Branch == [http://github.com/fwenzel/tuxedo/ Source code]: * <code>git clone git://github.com/fwenzel/tuxedo.git</code> * Make a virtua…')
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Deployment hints for Bouncer's Tuxedo Branch ==
== Deployment hints for Bouncer's Tuxedo Branch ==


[http://github.com/fwenzel/tuxedo/ Source code]:
* Check out the [http://github.com/fwenzel/tuxedo/ source code]:
* <code>git clone git://github.com/fwenzel/tuxedo.git</code>
** <code>git clone git://github.com/fwenzel/tuxedo.git</code>
** <code>git submodule update --init</code>


* Make a virtualenv (probably with <code>--no-site-packages</code>), then <code>easy_install pip</code>.
* Deploying Tuxedo is very similar to what the [http://jbalogh.github.com/zamboni/topics/production/ Zamboni docs] describe for AMO.
* Make a virtualenv, activate it, then <code>easy_install pip</code>.
* <code>pip install -r requirements.txt</code>
* <code>pip install -r requirements.txt</code>
** <code>MySQL-python</code> can be installed via pip, or globally by installing the pyMySQLdb (?) rpm.


* Create a file <code>local_settings.py</code> in the tuxedo dir and put the settings into it that you want to change from settings.py, here's mine:
* Create a file <code>local_settings.py</code> in the tuxedo dir and put the settings into it that you want to change from settings.py, here's mine:
<pre>
<pre>
$ cat local_settings.py
$ cat local_settings.py
DEBUG = False
DATABASE_ENGINE = 'mysql'          # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_ENGINE = 'mysql'          # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'mybouncerdb'      # Or path to database file if using sqlite3.
DATABASE_NAME = 'mybouncerdb'      # Or path to database file if using sqlite3.
Line 24: Line 30:
</pre>
</pre>


* When upgrading from an older version of Bouncer, follow the steps "Upgrading an older version of Bouncer" in the [http://github.com/fwenzel/tuxedo/blob/master/README.md README].
* When upgrading from an older version of Bouncer, start off with a copy of the old DB, then follow the steps "Upgrading an older version of Bouncer" in the [http://github.com/fwenzel/tuxedo/blob/master/README.md README].
*
 
* (with DEBUG=True in your settings file, you should now be able to run <code>./manage.py runserver</code> and see a working web app. You should be able to log in.)
 
* Deploy to a web server. The Zamboni docs have some [http://jbalogh.github.com/zamboni/topics/production/#setting-up-mod-wsgi hints about Apache+mod_wsgi].
* The tuxedo API uses HTTP basic auth. Make sure to enable the [http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#User_Authentication mod_wsgi setting] that'll pass the HTTP auth credentials on to the application.
* At the time of writing, these hints don't cover the <code>/media/</code> and <code>/admin-media/</code> dirs. Those are not to be served through mod_wsgi, but can be added to the same vhost with mod_alias. See the section about it in [http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#serving-media-files Django docs].
** map <code>/media/</code> to the <code>tuxedo/media</code> dir, and
** <code>/admin-media/</code> to <code>.../the-tuxedo-virtualenv/lib/python2.6/site-packages/django/contrib/admin/media/</code>

Latest revision as of 06:45, 9 March 2010

Deployment hints for Bouncer's Tuxedo Branch

  • Deploying Tuxedo is very similar to what the Zamboni docs describe for AMO.
  • Make a virtualenv, activate it, then easy_install pip.
  • pip install -r requirements.txt
    • MySQL-python can be installed via pip, or globally by installing the pyMySQLdb (?) rpm.
  • Create a file local_settings.py in the tuxedo dir and put the settings into it that you want to change from settings.py, here's mine:
$ cat local_settings.py

DEBUG = False

DATABASE_ENGINE = 'mysql'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'mybouncerdb'       # Or path to database file if using sqlite3.
DATABASE_USER = 'fred'              # Not used with sqlite3.
DATABASE_PASSWORD = 'fred'          # Not used with sqlite3.
DATABASE_HOST = 'server'            # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''                  # Set to empty string for default. Not used with sqlite3.

DATABASE_OPTIONS = {
    "init_command": "SET storage_engine=INNODB",
}

CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
  • When upgrading from an older version of Bouncer, start off with a copy of the old DB, then follow the steps "Upgrading an older version of Bouncer" in the README.
  • (with DEBUG=True in your settings file, you should now be able to run ./manage.py runserver and see a working web app. You should be able to log in.)
  • Deploy to a web server. The Zamboni docs have some hints about Apache+mod_wsgi.
  • The tuxedo API uses HTTP basic auth. Make sure to enable the mod_wsgi setting that'll pass the HTTP auth credentials on to the application.
  • At the time of writing, these hints don't cover the /media/ and /admin-media/ dirs. Those are not to be served through mod_wsgi, but can be added to the same vhost with mod_alias. See the section about it in Django docs.
    • map /media/ to the tuxedo/media dir, and
    • /admin-media/ to .../the-tuxedo-virtualenv/lib/python2.6/site-packages/django/contrib/admin/media/