Skip to content
Snippets Groups Projects
Commit d7f276a0 authored by Jan Čermák's avatar Jan Čermák
Browse files

dev: updated vagrant config and bootstrap to use Ubuntu 14.04

parent 5ab78888
Branches master
No related merge requests found
......@@ -10,8 +10,7 @@ Vagrant.configure("2") do |config|
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
config.vm.box = "quantal64"
config.vm.box_url = "http://cloud-images.ubuntu.com/quantal/current/quantal-server-cloudimg-vagrant-amd64-disk1.box"
config.vm.box = "ubuntu/trusty64"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
......
......@@ -8,6 +8,7 @@ init_db=true
# fix locale errors
echo -e "\nexport LANGUAGE=en_US.UTF-8\nexport LANG=en_US.UTF-8\nexport LC_ALL=en_US.UTF-8" >> /etc/bash.bashrc
locale-gen en_US.UTF-8
export LC_ALL=en_US.UTF-8
dpkg-reconfigure locales
# set timezone to CET
......@@ -16,36 +17,39 @@ ln -sf /usr/share/zoneinfo/Europe/Prague /etc/localtime
# install DSC requirements & some development stuff
apt-get update
apt-get install -y postgresql libapache2-mod-wsgi python-psycopg2 python-geoip memcached python-memcache python-pip mc
pip install Django==1.5.1
apt-get install -y postgresql apache2 libapache2-mod-wsgi python-psycopg2 python-geoip memcached python-memcache python-pip mc
# setup database
# create user, same as:
# sudo -u postgres createuser -P dsc
# with password = pass
sudo -u postgres psql -c "CREATE ROLE dsc PASSWORD 'md529ab8c246640632cb7ebcc0e91eac627' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;"
sudo -u postgres psql -c "CREATE ROLE dsc PASSWORD 'md529ab8c246640632cb7ebcc0e91eac627' NOSUPERUSER CREATEDB NOCREATEROLE INHERIT LOGIN;"
sudo -u postgres createdb -O dsc dsc
if $init_db ; then
python /vagrant/create_tables.py
/vagrant/dsc/manage.py syncdb --noinput
fi
if $create_vhost ; then
apt-get install -y libgeoip-dev python-dev postgresql-server-dev-9.1 python-virtualenv
mkdir /usr/local/pythonenv
cd /usr/local/pythonenv
apt-get install -y libgeoip-dev python-dev postgresql-server-dev-9.3 python-virtualenv
mkdir /opt/virtualenv/
cd /opt/virtualenv/
sudo virtualenv --no-site-packages BASELINE
virtualenv --no-site-packages BASELINE
echo "WSGIPythonHome /usr/local/pythonenv/BASELINE" > /etc/apache2/conf.d/python-virtualenv-baseline
touch /etc/apache2/conf.d/python-virtualenv-baseline
echo "WSGIPythonHome /opt/virtualenv/BASELINE" > /etc/apache2/conf.d/python-virtualenv-baseline
virtualenv --no-site-packages DSCNG
/usr/local/pythonenv/DSCNG/bin/pip install python-memcached Django==1.5.1 psycopg2==2.4.5
/usr/local/pythonenv/DSCNG/bin/easy_install http://geolite.maxmind.com/download/geoip/api/python/GeoIP-Python-1.2.8.tar.gz
cp /vagrant/dev_tools/vagrant/vagrant_vhost /etc/apache2/sites-available/default
/opt/virtualenv/DSCNG/bin/pip install python-memcached Django==1.5.8 psycopg2==2.5.3 GeoIP==1.3.1
chown -R vagrant:vagrant /opt/virtualenv/
cp /vagrant/dev_tools/vagrant/vagrant_vhost /etc/apache2/sites-available/000-default.conf
service apache2 reload
fi
if $init_db ; then
. /opt/virtualenv/DSCNG/bin/activate
python /vagrant/create_tables.py
/vagrant/dsc/manage.py syncdb --noinput
fi
\ No newline at end of file
......@@ -9,25 +9,22 @@
Alias /media/ /vagrant/dsc/media/
Alias /static/ /vagrant/dsc/static/
WSGIDaemonProcess dsc processes=2 threads=15 display-name=%{GROUP} python-path=/usr/local/pythonenv/DSCNG/lib/python2.7/site-packages:/vagrant/dsc/
WSGIDaemonProcess dsc processes=2 threads=15 display-name=%{GROUP} python-path=/opt/virtualenv/DSCNG/lib/python2.7/site-packages:/vagrant/dsc/
WSGIProcessGroup dsc
WSGIScriptAlias / /vagrant/dsc/dsc/wsgi.py
<Directory /vagrant/dsc/static>
Order deny,allow
Allow from all
Require all granted
</Directory>
<Directory /vagrant/dsc/media>
Order deny,allow
Allow from all
Require all granted
</Directory>
<Directory /vagrant/dsc/dsc>
<Files wsgi.py>
Order allow,deny
Allow from all
Require all granted
</Files>
</Directory>
</VirtualHost>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment