/ Published in: Bash
                    
                                        
A small script that sets up a new VirtualHost with Apache and adds an entry for the site to your hosts file. 
You need to adjust the paths to your needs.
Must be run as root.
                You need to adjust the paths to your needs.
Must be run as root.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Usage - $0 project name"
echo ""
exit 1
fi
echo "
127.0.0.1 $1" >> /etc/hosts
echo "
<VirtualHost *:80>
ServerAdmin me@localhost
DocumentRoot /home/stefan/wwwroot/cake/$1/webroot/
ServerName $1
</VirtualHost>
" >> /etc/apache2/sites-enabled/all
apache2ctl restart
URL: init-site
Comments
 Subscribe to comments
                    Subscribe to comments
                
                