Posted By

ping_ch on 02/24/09


Tagged

project apache webserver setup


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dariusm5


Setup new web project


 / Published in: Bash
 

URL: init-site

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.

  1. #!/bin/bash
  2.  
  3. if [ $# -ne 1 ]
  4. then
  5. echo "Usage - $0 project name"
  6. echo ""
  7. exit 1
  8. fi
  9.  
  10. echo "
  11. 127.0.0.1 $1" >> /etc/hosts
  12. echo "
  13. <VirtualHost *:80>
  14. ServerAdmin me@localhost
  15. DocumentRoot /home/stefan/wwwroot/cake/$1/webroot/
  16. ServerName $1
  17. </VirtualHost>
  18.  
  19. " >> /etc/apache2/sites-enabled/all
  20.  
  21. apache2ctl restart

Report this snippet  

You need to login to post a comment.