From: Rafał Długołęcki Date: Mon, 19 Aug 2013 12:35:07 +0000 (+0200) Subject: Fixed script for apache2.4 X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=3e4c8a19893657ec383c590227e7e4f0b9e09dc0;p=prj-utils.git Fixed script for apache2.4 --- diff --git a/prj-site-make b/prj-site-make index 741783c..d346be7 100755 --- a/prj-site-make +++ b/prj-site-make @@ -4,7 +4,8 @@ sql_user = rdlugoleck_${name} $(eval sql_password := $(shell pwgen -1 -s 50)) apache_sites = '/etc/apache2/sites-available' project_dir = `pwd`/${name} -host = ${name}.localhost +host = ${name} +host_conf = ${name}.conf help: echo "Usage: prj-site OPERATION NAME [type] " @@ -37,13 +38,13 @@ create-permissions: create-directories echo "> Setting group permissions of {project}/www to www-data, need root permissions to do that." sudo chgrp -R www-data ${project_dir}/www -${apache_sites}/${host}: +${apache_sites}/${host_conf}: echo "> Creating project's site configuration" - sudo cp ${apache_sites}/dummy.localhost ${apache_sites}/${host} + sudo cp ${apache_sites}/dummy.conf ${apache_sites}/${host_conf} -create-vhost: ${apache_sites}/${host} - sudo sed -e "s/dummy/${name}/g" -i ${apache_sites}/${host} - sudo sed -e "s@/var/www/${name}@${project_dir}/www@" -i ${apache_sites}/${host} +create-vhost: ${apache_sites}/${host_conf} + sudo sed -e "s/dummy/${name}/g" -i ${apache_sites}/${host_conf} + sudo sed -e "s@/var/www/${name}@${project_dir}/www@" -i ${apache_sites}/${host_conf} sudo a2ensite ${host} sudo service apache2 reload @@ -54,14 +55,14 @@ remove-directories: sudo rm -r ${project_dir} remove-vhost: - if test -f ${apache_sites}/${host}; then \ + if test -f ${apache_sites}/${host_conf}; then \ echo "> Removing apache configuration file"; \ - sudo rm ${apache_sites}/${host}; \ + sudo rm ${apache_sites}/${host_conf}; \ fi; enable: enable-${type} echo "[+] Enabling ${name}" - if test -f /etc/apache2/sites-available/${host}; then \ + if test -f ${apache_sites}/${host_conf}; then \ echo "> Enabling project's vhost..."; \ sudo a2ensite ${host}; \ sudo service apache2 reload; \ @@ -103,7 +104,7 @@ symfony2: create-directories create-vhost cd ${project_dir} && php composer.phar install chmod -R 777 ${project_dir}/app/cache chmod -R 777 ${project_dir}/app/logs - sudo sed -e "s@${project_dir}/www@${project_dir}/web@" -i ${apache_sites}/${host} + sudo sed -e "s@${project_dir}/www@${project_dir}/web@" -i ${apache_sites}/${host_conf} create-drupal: create-directories echo "[+] Drupal installation begins..."