Skip to content

Instantly share code, notes, and snippets.

@degami
Created May 7, 2013 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save degami/5532501 to your computer and use it in GitHub Desktop.
Save degami/5532501 to your computer and use it in GitHub Desktop.
svn_import_update
sviluppo@dev:~$ cat /usr/local/bin/update_svn_proj.sh
#/bin/bash
VHOSTSDIR="/var/www/vhosts/";
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
projectname=$1
vhostpath=$VHOSTSDIR/$projectname
svn co --username=<SVNUSERNAME> --password=<SVNPASSWD> --non-interactive --trust-server-cert --no-auth-cache http://localhost/repos/$projectname $vhostpath
chown -R www-data:www-data $vhostpath
chmod -R g+rw $vhostpath
#############################################################
cat /usr/local/bin/import_svn_proj.sh
#/bin/bash
VHOSTSDIR="/var/www/vhosts/";
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
projectname=$1
vhostpath=$VHOSTSDIR/$projectname
svn co --username=<SVNUSERNAME> --password=<SVNPASSWD> --non-interactive --trust-server-cert --no-auth-cache http://localhost/repos/$projectname $vhostpath
chown -R www-data:www-data $vhostpath
chmod -R g+rw $vhostpath
cat /etc/apache2/conf/skel_conf | sed "s/__projectname__/$projectname/g" > /etc/apache2/sites-available/$projectname.conf
ln -s /etc/apache2/sites-available/$projectname.conf /etc/apache2/sites-enabled/0001-$projectname.conf
service apache2 restart
#############################################################
cat /etc/apache2/conf/skel_conf
<VirtualHost *:80>
ServerName __projectname__.dev1.faberadv.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/vhosts/__projectname__
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/vhosts/__projectname__>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/__projectname__-error_log
CustomLog ${APACHE_LOG_DIR}/__projectname__-access_log combined
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment