From 966ae31c547a5121d9156e58fcc9ea21c2ed0ba8 Mon Sep 17 00:00:00 2001 From: Mihail Shumilov Date: Wed, 24 Sep 2014 14:53:52 +0300 Subject: [PATCH] Update prepare-precise64.sh fix erros on provision added ssl --- carcass/vagrant/prepare-precise64.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/carcass/vagrant/prepare-precise64.sh b/carcass/vagrant/prepare-precise64.sh index dbbcb62..36102c4 100644 --- a/carcass/vagrant/prepare-precise64.sh +++ b/carcass/vagrant/prepare-precise64.sh @@ -37,7 +37,7 @@ rm -rf /etc/apache2/sites-enabled/* # Enabling mod_rewrite on server ## `cd` is just for symlink to have same format as others inside `mods-enabled/` cd /etc/apache2/mods-enabled/ -ln -s ../mods-available/rewrite.load rewrite.load +ln -sn ../mods-available/rewrite.load rewrite.load # Make the apache load under our user account. sed -ri 's/^(export APACHE_RUN_USER=)(.*)$/\1vagrant/' /etc/apache2/envvars @@ -47,9 +47,18 @@ sed -ri 's/^(export APACHE_RUN_GROUP=)(.*)$/\1vagrant/' /etc/apache2/envvars touch /etc/apache2/conf-available/globalname.conf echo "ServerName boilerplate" > /etc/apache2/conf-available/globalname.conf cd /etc/apache2/conf-enabled -ln -s ../conf-available/globalname.conf globalname.conf +ln -sn ../conf-available/globalname.conf globalname.conf # Creating database mysql -u root -p${DB_PASS} -e "create database if not exists ${DB_NAME}"; - +#setup ssl +openssl req -new -x509 -days 30 -keyout server.key -out server.pem +cp server.key{,.orig} +openssl rsa -in server.key.orig -out server.key +rm server.key.orig +cp server.pem /etc/ssl/certs/ +cp server.key /etc/ssl/private/ +chmod 0600 /etc/ssl/private/server.key +a2enmod ssl +a2ensite default-ssl