Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.68 KB | None | 0 0
  1. echo -n "Write the name of the new site!"
  2. read site_name
  3. # Information collection done!
  4.  
  5. # Setting up directories for the new website
  6. mkdir /var/www/$site_name
  7. cp /opt/www_data/index.php /var/www/$site_name/
  8. chown -R www-data /var/www/$site_name/*
  9. # Directory setup done!
  10.  
  11. # Apache2 Config!
  12. sed -e "s/$site_name/new_site/g" /opt/www_data/new_site >/etc/apache2/sites-available/$site_name
  13. ln -sf /etc/apache2/sites-available/$site_name /etc/apache2/sites-enabled/$site_name
  14. # Apache2 config done!
  15.  
  16. # Restarting apache to apply the new settings!
  17. echo -n "Apache is now being restarted!"
  18. /etc/init.d/apache2 reload
  19. # End of Apache2 restart
  20.  
  21. echo -n "All operations are now completed!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement