-
-
Save xctheo/e98ebd3f8d1fd25a5c446494b6721a99 to your computer and use it in GitHub Desktop.
Revisions
-
xctheo revised this gist
May 12, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ server { root PATH/SITENAME/public; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -
xctheo revised this gist
May 12, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ server { listen 80; server_name SITENAME www.SITENAME; root PATH/SITENAME/public; location / { proxy_pass http://178.62.22.7:8080; -
xctheo revised this gist
May 12, 2017 . 2 changed files with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ #!/bin/sh WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" NGINXDIR="/etc/nginx/sites-available/" NGINXENABLEDDIR="/etc/nginx/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ #!/bin/sh WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" NGINXDIR="/etc/nginx/sites-available/" NGINXENABLEDDIR="/etc/nginx/sites-enabled/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" -
xctheo revised this gist
May 12, 2017 . 5 changed files with 13 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ #!/bin/sh WEBROOT="$HOME/www" VHOSTDIR="/etc/apache2/sites-available" NGINXDIR="/etc/nginx/sites-available" NGINXENABLEDDIR="/etc/nginx/sites-available" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" @@ -24,7 +24,7 @@ if [ "$1" != '' ]; then sudo cp "$NGINXDIR/template.conf" "$NGINXDIR$1$EXTENSION" echo "created $NGINXDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$NGINXDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; sudo ln -s "$NGINXDIR$1$EXTENSION" "$NGINXENABLEDDIR$1$EXTENSION" if [ ! -d "$WEBROOT$1/" ]; then sudo mkdir -p "$WEBROOT$1/public" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ #!/bin/sh WEBROOT="$HOME/www" VHOSTDIR="/etc/apache2/sites-available" NGINXDIR="/etc/nginx/sites-available" NGINXENABLEDDIR="/etc/nginx/sites-enabled" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" @@ -24,7 +24,7 @@ if [ "$1" != '' ]; then sudo cp "$NGINXDIR/template.conf" "$NGINXDIR$1$EXTENSION" echo "created $NGINXDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$NGINXDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; sudo ln -s "$NGINXDIR$1$EXTENSION" "$NGINXENABLEDDIR$1$EXTENSION" if [ ! -d "$WEBROOT$1/" ]; then sudo mkdir -p "$WEBROOT$1/public" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ server { listen 80; server_name SITENAME www.SITENAME; root PATH/SITENAME/public location / { proxy_pass http://178.62.22.7:8080; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ </Directory> DocumentRoot PATH/SITENAME/public <Directory PATH/SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ </Directory> DocumentRoot PATH/SITENAME/public <Directory PATH/SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted -
xctheo revised this gist
Apr 25, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" NGINXDIR="/etc/nginx/sites-available/" NGINXENABLEDDIR="/etc/nginx/sites-enabled/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" -
xctheo revised this gist
Apr 25, 2017 . 3 changed files with 44 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,11 @@ #!/bin/sh WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" NGINXDIR="/etc/nginx/sites-available/" NGINXENABLEDDIR="/etc/nginx/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then sudo cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" @@ -13,6 +16,16 @@ if [ "$1" != '' ]; then echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; if [ ! -f "$NGINXDIR$1.conf" ]; then sudo cp "$NGINXDIR/template.conf" "$NGINXDIR$1$EXTENSION" echo "created $NGINXDIR$1$EXTENSION" else sudo mv "$NGINXDIR$1.conf" "$NGINXDIR$1$EXTENSION.bak" sudo cp "$NGINXDIR/template.conf" "$NGINXDIR$1$EXTENSION" echo "created $NGINXDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$NGINXDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" {} \; sudo ln -s "$NGINXDIR$1$EXTENSION" "$NGINXENABLEDDIR$1$EXTENSION" if [ ! -d "$WEBROOT$1/" ]; then sudo mkdir -p "$WEBROOT$1/public" sudo chown -R www-data:www-data "$WEBROOT$1/" @@ -22,7 +35,9 @@ if [ "$1" != '' ]; then fi sudo a2ensite $1 $RESTARTCMD echo "reloaded apache" $RESTARTCMD_NGINX echo "reloaded nginx" elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsite " This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,11 @@ #!/bin/sh WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" NGINXDIR="/etc/nginx/sites-available/" NGINXENABLEDDIR="/etc/nginx/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" RESTARTCMD_NGINX="/usr/bin/sudo service nginx reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then sudo cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" @@ -13,6 +16,16 @@ if [ "$1" != '' ]; then echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; if [ ! -f "$NGINXDIR$1.conf" ]; then sudo cp "$NGINXDIR/template.conf" "$NGINXDIR$1$EXTENSION" echo "created $NGINXDIR$1$EXTENSION" else sudo mv "$NGINXDIR$1.conf" "$NGINXDIR$1$EXTENSION.bak" sudo cp "$NGINXDIR/template.conf" "$NGINXDIR$1$EXTENSION" echo "created $NGINXDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$NGINXDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" {} \; sudo ln -s "$NGINXDIR$1$EXTENSION" "$NGINXENABLEDDIR$1$EXTENSION" if [ ! -d "$WEBROOT$1/" ]; then sudo mkdir -p "$WEBROOT$1/public" sudo chown -R www-data:www-data "$WEBROOT$1/" @@ -22,7 +35,9 @@ if [ "$1" != '' ]; then fi sudo a2ensite $1 $RESTARTCMD echo "reloaded apache" $RESTARTCMD_NGINX echo "reloaded nginx" elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsite " This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ server { listen 80; server_name SITENAME www.SITENAME; location / { proxy_pass http://178.62.22.7:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } -
xctheo revised this gist
Feb 9, 2017 . 4 changed files with 15 additions and 26 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,17 +5,17 @@ EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then sudo cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION" else sudo mv "$VHOSTDIR$1.conf" "$VHOSTDIR$1$EXTENSION.bak" sudo cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; if [ ! -d "$WEBROOT$1/" ]; then sudo mkdir -p "$WEBROOT$1/public" sudo chown -R www-data:www-data "$WEBROOT$1/" echo "created $WEBROOT$1/" else echo "$WEBROOT$1/ already exists" @@ -30,6 +30,6 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then fi sudo chown -R www-data:www-data $WEBROOT # sudo chgrp -R www-data $WEBROOT sudo chmod -R g+rwxs $WEBROOT # sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,17 +5,17 @@ EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then sudo cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION" else sudo mv "$VHOSTDIR$1.conf" "$VHOSTDIR$1$EXTENSION.bak" sudo cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi sudo find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; if [ ! -d "$WEBROOT$1/" ]; then sudo mkdir -p "$WEBROOT$1/public" sudo chown -R www-data:www-data "$WEBROOT$1/" echo "created $WEBROOT$1/" else echo "$WEBROOT$1/ already exists" @@ -30,6 +30,6 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then fi sudo chown -R www-data:www-data $WEBROOT # sudo chgrp -R www-data $WEBROOT sudo chmod -R g+rwxs $WEBROOT # sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,12 +17,7 @@ Order allow,deny Allow from All </Directory> <IfModule mod_dir.c> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,12 +17,6 @@ Order allow,deny Allow from All </Directory> <IfModule mod_dir.c> -
xctheo revised this gist
Jan 30, 2017 . 4 changed files with 14 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,7 @@ if [ "$1" != '' ]; then cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir -p "$WEBROOT$1/public" chown -R :www-data "$WEBROOT$1/" @@ -29,4 +28,8 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "sudo addwebsite " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi sudo chown -R www-data:www-data $WEBROOT sudo chgrp -R www-data $WEBROOT sudo chmod -R g+rwxs $WEBROOT # sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,8 +12,7 @@ if [ "$1" != '' ]; then cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i -e "s,SITENAME,$1,g" -e "s,PATH,$WEBROOT,g" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir -p "$WEBROOT$1/public" chown -R :www-data "$WEBROOT$1/" @@ -29,4 +28,8 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "sudo addwebsite " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi sudo chown -R www-data:www-data $WEBROOT sudo chgrp -R www-data $WEBROOT sudo chmod -R g+rwxs $WEBROOT # sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ AllowOverride None </Directory> DocumentRoot PATH/SITENAME/public <Directory PATH//SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ AllowOverride None </Directory> DocumentRoot PATH/SITENAME/public <Directory PATH//SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted -
xctheo revised this gist
Jan 30, 2017 . 4 changed files with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #!/bin/sh WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" @@ -13,6 +13,7 @@ if [ "$1" != '' ]; then echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SITENAME/$1/" {} \; find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/VAR/$HOME/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir -p "$WEBROOT$1/public" chown -R :www-data "$WEBROOT$1/" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #!/bin/sh WEBROOT="$HOME/www/" VHOSTDIR="/etc/apache2/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" @@ -13,6 +13,7 @@ if [ "$1" != '' ]; then echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SITENAME/$1/" {} \; find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/VAR/$HOME/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir -p "$WEBROOT$1/public" chown -R :www-data "$WEBROOT$1/" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ AllowOverride None </Directory> DocumentRoot /VAR/www/SITENAME/public <Directory /VAR/www/SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ AllowOverride None </Directory> DocumentRoot /VAR/www/SITENAME/public <Directory /VAR/www/SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted -
xctheo revised this gist
Jan 12, 2017 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ServerAdmin webmaster@SITENAME ServerName SITENAME ServerAlias www.SITENAME <Directory /> Options FollowSymLinks This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ServerAdmin webmaster@SITENAME ServerName SITENAME ServerAlias www.SITENAME <Directory /> Options FollowSymLinks -
xctheo revised this gist
Jan 12, 2017 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ if [ "$1" != '' ]; then fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SITENAME/$1/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir -p "$WEBROOT$1/public" chown -R :www-data "$WEBROOT$1/" echo "created $WEBROOT$1/" else This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ if [ "$1" != '' ]; then fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SITENAME/$1/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir -p "$WEBROOT$1/public" chown -R :www-data "$WEBROOT$1/" echo "created $WEBROOT$1/" else -
xctheo revised this gist
Jan 12, 2017 . 6 changed files with 80 additions and 68 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,17 +5,17 @@ EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION" else mv "$VHOSTDIR$1.conf" "$VHOSTDIR$1$EXTENSION.bak" cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SITENAME/$1/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir "$WEBROOT$1/" chown -R :www-data "$WEBROOT$1/" echo "created $WEBROOT$1/" else echo "$WEBROOT$1/ already exists" @@ -28,4 +28,4 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "sudo addwebsite " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi # sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,31 @@ #!/bin/sh WEBROOT="/var/www/" VHOSTDIR="/etc/apache2/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION" else mv "$VHOSTDIR$1.conf" "$VHOSTDIR$1$EXTENSION.bak" cp "$VHOSTDIR/template.conf" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SITENAME/$1/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir "$WEBROOT$1/" chown -R :www-data "$WEBROOT$1/" echo "created $WEBROOT$1/" else echo "$WEBROOT$1/ already exists" fi sudo a2ensite $1 $RESTARTCMD echo "reloaded apache" elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsite " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi # sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,27 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,27 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ <VIRTUALHOST *:80> ServerAdmin webmaster@SITENAME ServerName SITENAME ServerAlias SITENAME <Directory /> Options FollowSymLinks AllowOverride None </Directory> DocumentRoot /var/www/SITENAME/public <Directory /var/www/SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted Order allow,deny Allow from All <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /app.php [QSA,L] </IfModule> </Directory> <IfModule mod_dir.c> DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm </IfModule> ErrorLog /var/log/apache2/SITENAME_error.log CustomLog /var/log/apache2/SITENAME_access.log combined </VIRTUALHOST> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ <VIRTUALHOST *:80> ServerAdmin webmaster@SITENAME ServerName SITENAME ServerAlias SITENAME <Directory /> Options FollowSymLinks AllowOverride None </Directory> DocumentRoot /var/www/SITENAME/public <Directory /var/www/SITENAME/public> # enable the .htaccess rewrites AllowOverride All Require all granted Order allow,deny Allow from All <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /app.php [QSA,L] </IfModule> </Directory> <IfModule mod_dir.c> DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm </IfModule> ErrorLog /var/log/apache2/SITENAME_error.log CustomLog /var/log/apache2/SITENAME_access.log combined </VIRTUALHOST> -
MauJFernandez revised this gist
Jun 22, 2014 . 2 changed files with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,4 +27,5 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsite " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi sed -i "127.0.0.1 $1.local" /etc/hosts This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,4 +27,5 @@ elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsitedev " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi sed -i "127.0.0.1 $1.dev.local" /etc/hosts -
MauJFernandez revised this gist
Jun 22, 2014 . 2 changed files with 57 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/bin/sh WEBROOT="/var/www/" VHOSTDIR="/etc/apache2/sites-available/" EXTENSION="-dev.conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1$EXTENSION" ]; then cp "$VHOSTDIR/skeletondev" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION" else mv "$VHOSTDIR$1.conf" "$VHOSTDIR$1$EXTENSION.bak" cp "$VHOSTDIR/skeletondev" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SKELETON/$1/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir "$WEBROOT$1/" chown -R mauro:mauro "$WEBROOT$1/" echo "created $WEBROOT$1/" else echo "$WEBROOT$1/ already exists" fi sudo a2ensite $1$EXTENSION $RESTARTCMD echo "reloaded apache" elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsitedev " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <VIRTUALHOST *:80> ServerAdmin webmaster@localhost ServerName SKELETON.dev.local <DIRECTORY /> Options FollowSymLinks AllowOverride None </DIRECTORY> DocumentRoot /var/www/SKELETON/web <DIRECTORY /var/www/SKELETON/web> # enable the .htaccess rewrites AllowOverride All Order allow,deny Allow from All DirectoryIndex app_dev.php <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /app_dev.php [QSA,L] </IfModule> </DIRECTORY> ErrorLog /var/log/apache2/project_error.log CustomLog /var/log/apache2/project_access.log combined </VIRTUALHOST> -
MauJFernandez created this gist
Jun 22, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/bin/sh WEBROOT="/var/www/" VHOSTDIR="/etc/apache2/sites-available/" EXTENSION=".conf" RESTARTCMD="/usr/bin/sudo service apache2 reload" if [ "$1" != '' ]; then if [ ! -f "$VHOSTDIR$1.conf" ]; then cp "$VHOSTDIR/skeleton" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION" else mv "$VHOSTDIR$1.conf" "$VHOSTDIR$1$EXTENSION.bak" cp "$VHOSTDIR/skeleton" "$VHOSTDIR$1$EXTENSION" echo "created $VHOSTDIR$1$EXTENSION and made a backup of the existing conf" fi find "$VHOSTDIR$1$EXTENSION" -type f -exec sed -i "s/SKELETON/$1/" {} \; if [ ! -d "$WEBROOT$1/" ]; then mkdir "$WEBROOT$1/" chown -R mauro:mauro "$WEBROOT$1/" echo "created $WEBROOT$1/" else echo "$WEBROOT$1/ already exists" fi sudo a2ensite $1 $RESTARTCMD echo "reloaded apache" elif [ "$1" = 'help' ] || [ "$1" = '' ]; then echo "usage:" echo "sudo addwebsite " echo "example: to create hostname.localhost just run the command 'sudo addwebsite hostname.localhost'" fi This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <VIRTUALHOST *:80> ServerAdmin webmaster@localhost ServerName SKELETON.local <DIRECTORY /> Options FollowSymLinks AllowOverride None </DIRECTORY> DocumentRoot /var/www/SKELETON/web <DIRECTORY /var/www/SKELETON/web> # enable the .htaccess rewrites AllowOverride All Order allow,deny Allow from All DirectoryIndex app.php <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /app.php [QSA,L] </IfModule> </DIRECTORY> ErrorLog /var/log/apache2/project_error.log CustomLog /var/log/apache2/project_access.log combined </VIRTUALHOST>