1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Subdomains issue

Discussion in 'Plesk for Linux - 8.x and Older' started by djason, May 30, 2008.

  1. djason

    djason Guest

    Hi I have a question to make regarding the subdomains creation!!!!

    I have created a subdomain via Plesk 8.4, but I cant visit my subdomains when I am typing www.subdomain.domain.tld, but i can see them when i type subdomain.domain.tld.

    Can you help me on how to solve this???

    Thank you in advance
  2. meto

    meto Guest

    I've made myself a bash scritp to cover that, but you have tu run it for every subdomain.


    #cd /var/www/vhosts/$2/subdomains/$1/conf

    if !(grep -q "ServerAlias www.$1.$2" /var/www/vhosts/$2/subdomains/$1/conf/vhost.conf > /dev/null 2&>1)
    echo ServerAlias www.$1.$2 >> /var/www/vhosts/$2/subdomains/$1/conf/vhost.conf

    /opt/psa/admin/bin/websrvmng --reconfigure-vhost --vhost-name=$2 > /dev/null 2&>1

    /usr/local/psa/bin/dns.sh --add $2 -cname www.$1 -canonical $1.$2.

    /usr/init.d/bind9 restart > /dev/null 2&>1

    /usr/sbin/apache2ctl -k graceful > /dev/null 2&>1

    echo Subdomain $1.$2 has been set up!

    You use it like this (for forum.domain.com, name of file with above script: wwwdomain): ./wwwdomain forum domain.com
  3. djason

    djason Guest

    Thank you for your reply meto!!!

    I ve done almost the same without writing a script, I made the changes into the conf file of the domain and it worked, but when I restarted the apache everything was changed again and became as it was before the changes that I made... isnt that strange?

    Is this a bug of 8.4 version??

    Thank you anyway I ll copy your script and I will see how it works.
  4. meto

    meto Guest

    It does for me :) Its not a bug its a FEATURE! :p Subdomains NEVER had www prefix included (as far as i remember, wich is PLESK 7.5 Reloaded).