Plesk Event Handler for New Subdomain


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/bin/bash
  2.  
  3. SUB="/home/httpd/vhosts/$1/subdomains/$2"
  4.  
  5. if [ ! -d $SUB/conf ]; then
  6. mkdir $SUB/conf
  7. fi
  8. echo "ServerAlias $2" >> $SUB/conf/vhost.conf
  9. cat << __EOT > $SUB/conf/vhost.conf
  10.  
  11. ServerAlias $2
  12. <Directory $SUB/httpdocs>
  13. php_admin_value open_basedir none
  14. </Directory>
  15.  
  16. __EOT
  17.  
  18. /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=$2.$1
  19. service httpd restart

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.