Mozstrap Installation instruction: Tested on Ubuntu 12.04 and 14.04 with Nginx installed
- Install Dependencies:
apt-get update
apt-get install git mysql-server libmysqlclient-dev python-pip python-dev
- Clone moztrap:
git clone --recursive git://github.com/mozilla/moztrap
- Install virtualenvwrapper:
pip install virtualenvwrapper
- Install Moztrap dependencies:
cd moztrap
source "/usr/local/bin/virtualenvwrapper.sh"
bin/install-reqs
- Create Database:
mysql -e "CREATE DATABASE moztrap CHARACTER SET utf8"
mysql -e "grant all privileges on moztrap.* to moztrap@localhost IDENTIFIED BY 'password'"
Note: Replace password with your password for moztrap database
- Set the Moztrap settings:
cp moztrap/settings/local.sample.py moztrap/settings/local.py
vim moztrap/settings/local.py
- Setup database:
./manage.py syncdb --migrate
./manage.py create_default_roles
- Setup Nginx configuration:
vim /etc/nginx/sites-available/moztrap
and copy following settings:
upstream moztrap {
server 127.0.0.1:8000;
}
server {
# listen 80 default_server;
server_name moztrap.rtcamp.net;
access_log /var/log/nginx/moztrap_access.log;
error_log /var/log/nginx/moztrap_error.log;
root /root/moztrap;
location / {
try_files $uri $uri/index.html $uri.html @moztrap;
}
location @moztrap {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://moztrap;
}
}
Activate site configuration and reload Nginx
ln -s /etc/nginx/sites-available/moztrap /etc/nginx/sites-enabled/moztrap
service nginx reload
- Start Moztrap server:
nohup ./manage.py runserver > /dev/null &