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

How to create multiple domain name for the same website

Discussion in 'Plesk for Linux - 8.x and Older' started by Dj_Cure, Apr 4, 2005.

  1. Dj_Cure

    Dj_Cure Guest

    is it possible to add multiple alias to a single domain? for example, if i want www.example.com and www.example.net to point to the same file. one solution is to add

    ServerName example.com:80
    ServerAlias www.example.com
    ServerAlias example.net
    ServerAlias example.org
    ServerAlias example.tv
    UseCanonicalName Off

    to the file /home/httpd/vhosts/example.com/conf/httpd.include
    Is there any way to do this with plesk interface?

  2. SibProgrammer

    SibProgrammer Regular Pleskian Staff Member

    Nov 21, 2004
    Likes Received:
    You must add ServerAlias directive to /home/httpd/vhosts/example.com/conf/vhost.conf file.
    There is no solution to add such line via web interface.
  3. Dj_Cure

    Dj_Cure Guest

    Thank you for your help.
    I think this could be a nice feature to next plesk updates ;)
    Lost of websites have many domain names which goes to the same files. With the httpd.include configuration modification, or with the new domain + 1 frame redirector it's hard to keep a track of all the domain names for each website. :(
  4. pbigordon

    pbigordon Guest

    Possible...if we're talking about the same thing...

    You can set multiple domains to go to one domain by using "Standard Forwarding".
    In the main control panel click "Add New Domain". Type the domain name. Directly below it is the drop-down option for "Select template." Click that and choose "Create domain without template." Click "OK" The next screen will be "Hosting type", click the "Standard forwarding" radio button and "OK" again. ( You can click "Help" on the far left to read about the different types but this is the most common choice and in most instances what you're looking for). The next screen is "Preferences." Type the URL that you want this to go to, then "OK" again.
  5. DaanK

    DaanK Guest


    This way the domain is forwarded so the url will be changed.
    I assume that this is not always wanted.

    I Agree with Dj_Cure that this would be a nice feature for the next update. ;)
  6. pbigordon

    pbigordon Guest

    If you want the URL to stay the same you choose "Frame forwarding" instead.
  7. editor

    editor Guest

    Yes, you re right. But then I cannot manage the emails for


    What I can do with vhost.conf is only to "map" all these
    domainnames into 1 directory. But this is only for HTTP
    and not MAIL.

    Where can I configure the emails? For example, that

    pop3 of example.com

    All emails of


    should be automatically forwarded to

    postmaster@example.com (there is the POP3).

    Thank you for a suggestion.
  8. DaanK

    DaanK Guest

    what i was thinking of ,
    you could also create the other website in your plesk , and with the vhost.conf make them use the same directory

    i assume if you use
    DocumentRoot /usr/local/psa/vhosts/newdomain/httpdocs
    it will use that instead of the original dir in the http.include file

    didn't test , going to today i hope.
  9. editor

    editor Guest

    Yes, this will work. Use vhost.conf for such solutions. But this
    will be only a solution for HTTP and _not_ for MAIL, see my
    last lines before. We need also a conf for forwarding the
    MAILs or something like that. Hmm?
  10. jamesyeeoc

    jamesyeeoc Guest

    After creating the frame forwarded domains, the manual workaround for emails can be done by editing the /var/qmail/control/virtualdomains file.

    Each domain you create gets assigned a prefix number.

    If you want domain.com to be the 'master' and the .net, .org, etc to all go to the .com, then you would change the prefix numbers of the .net, .org, etc to the same number as the .com

    Currently there is no way (that I know of) to do it from the Control Panel, but you can do this via SSH root login to a shell prompt.

    Edit: Updated this info to be current and correct. My original post was way off, I must have been having a non-mental day...
  11. fiasco

    fiasco Guest

    Is the major advantage of this method:

    ServerName example.com:80
    ServerAlias www.example.com
    ServerAlias example.net
    ServerAlias example.org
    ServerAlias example.tv
    UseCanonicalName Off

    That you dont use your domain licenses or is still affected due to having to have DNS for each domain?

  12. DaanK

    DaanK Guest

    uhm , that's not entirely true i think.
    Since the domains are inside plesk , the mail will be handled by plesk.
    but if you want info@domain.com also to work on domain.tv , then you'r right , that won't work my way.

    that has to be done in the database as jamesyeeoc wrote

    well , since most of us , (that might include you) have plesk also running as dns , than the serveralias wont work.
    i don't know exactly how plesk counts it domains , but by dns would be an option i guess
    the point is , with server alias you would have to run a dns somewhere else for those domains.
  13. fiasco

    fiasco Guest

    By D

    well , since most of us , (that might include you) have plesk also running as dns , than the serveralias wont work.
    i don't know exactly how plesk counts it domains , but by dns would be an option i guess
    the point is , with server alias you would have to run a dns somewhere else for those domains.

    Does anyone know if plesk counts a domain (in license terms)
    by the DNS? Or in fact how does plesk define a domain?

  14. MikeParsons

    MikeParsons Guest

    If you want to just have the emails from the other domains simply delivered to a chosen one then simply add the other domains into the rcpthosts in qmail/control, so that the system knows they are valid email addresses and add a line in virtualdomains with the same prepend number as the site you want.

    so if examplecom appears in virtualdomains as


    then add lines


    So far I cannot find a method to access the emails using the other domain names but all emails to the same name get delivered to the one account and it can be acceesed via that account.

    Then restart qmail.
  15. editor

    editor Guest

    Hi jamesyeeoc

    I had again a look because of this theme. I am sorry, I am
    still a little bit confused how to solve this problem.

    for HTTP, this is clear and can be configured by uploading
    a vhost.conf into the /conf/-directory of the domainname

    But how again can the emails be forwarded? Thank you for
    a hint. :)
  16. BDMM

    BDMM Basic Pleskian

    Apr 28, 2005
    Likes Received:
    Here is how I do it.
    I am not responsible for any problems that may arise from following these instructions. I am not an expert, but hey it works for me. Please let me know if there are any security issues as I am paranoid. Also does anyone know if these files get overwritten with a Plesk or software upgrade.

    pico -w /home/httpd/vhosts/[domain.com]/conf/vhost.conf

    add ServerAlias domain.net

    run update command
    /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=domain.com

    pico -w /var/named/run-root/etc/named.conf

    add new zone for domain.net (easiest way is to copy zone for domain.com and replace all refs .com to .net)

    restart named
    service named restart

    either add domain.net to rcpthosts or add to morercpthosts

    pico -w /var/qmail/control/morercpthosts

    add domain.net

    rebuild qmail database

    add domain.net to virtualdomains to receive email for domain.net through domain.com
    pico -w /var/qmail/control/virtualdomains
    add domain.net:11 (where number is the same as that for domain.com)

    if you wish to reject bounced messages for domain.net you need to edit your .qmail-default for that domain.

    cd /var/qmail/mailnames
    add domain.net folder - check permissions/owner
    add .qmail-default file
    pico .qmail-default

    add following line
    |forward ${DEFAULT}@domain.com

    add domain.net to rejection list
    pico -w /var/qmail/control/rejectnonexist
    add domain.net

    service qmail restart

    if you do not add a .qmail-default file but add domain.net to rejectnonexist then all email for domain.net will bounce.

    Now if you have me@domain.com mailbox all mail to me@domain.net will go into that box. You should be able to read mail using either domain.com or domain.net mail addresses. Remember they are one in the same.

  17. xtended

    xtended Guest

    hi roo,

    thank you for that great thread! so i tried as you have written, but...:

    Hi. This is the qmail-send program at server01.xyz.com.
    I'm afraid I wasn't able to deliver your message to the following addresses.
    This is a permanent error; I've given up. Sorry it didn't work out.

    Sorry, no mailbox here by that name. (#5.1.1)

    any idea...?
  18. jamesyeeoc

    jamesyeeoc Guest

    Wow I forgot about this thread. My original post has been modified to reflect the correct changes needed for forwarded domains.

    You basically have to modify the /var/qmail/control/virtualdomains file.

    You will see the 'master' domain and it's prefix number. Change the other 'slave' or 'forwarded' domains prefix numbers to be the same as the master domain's prefix number.

    You still have to have all the domains listed in the /var/qmail/control/rcpthosts file.
  19. xtended

    xtended Guest

    thx for fast reply!

    but something doesn't work anyway!

    so.. .what i did....:

    in plesk i made virtual hosting for domain.com. the e-mail configuration in plesk sends all mails (catch-all) to info@domain.com.

    now, in /vhost.conf of domain.com i added "ServerAlias www.domain2.net".

    in /var/qmail/control/rcpthosts plesk ads domain.com and i added manually domain2.net

    then in /var/qmail/control/virtualdomains plesk has written domain.com:20 an i have add manually domain2.net:20

    thats all...
    if i write now an e-mail to info@domain2.net i get back:
    Sorry, no mailbox here by that name. (#5.1.1)


    remember: domain2.net has NO account in plesk!
  20. jamesyeeoc

    jamesyeeoc Guest

    After making the changes, you need to restart Qmail. Either from the control panel, or from the command line (service qmail restart).

    Until Qmail is restarted, it will not re-read it's control files.

    Hmm, I don't see in your earlier post where you stated which part of this thread you had done or not done. Many different things have been discussed. Regardless of whether you created domain2.net in Plesk or not, if you have done the serveralias and the changes to Qmail's rcpthosts and virtualdomains file, AND RESTARTED APACHE AND QMAIL, then it should all work.

    Basically manually making the ServerAlias and Qmail changes is bypassing Plesk's domain counting, which I don't believe to be against their AUP (since these domains are not being controlled by their software). No one touched on having to make manual changes to /etc/named.conf or the DNS zone files for the non-Plesk controlled domains.

    I do not recommend doing any of these things since Plesk will overwrite the files when changes are made to any domains in the control panel (Apache, Qmail, Bind/Named, etc) and your manual changes may be lost without notice.

    One thing not clearly covered in this thread is that somewhere on some nameserver, the MX records for domain2.net have to be pointing to your Plesk server, or the DNS lookups for the domain will not be served by a valid nameserver, unless you are using an external nameserver to hold that domain's DNS records.

    Also, since you are bypassing Plesk and making manual changes, I don't recall anyone in this thread warning about Plesk re-writing the Apache or Qmail files whenever any changes are made to domains in the control panel, which may cause your manual changes to be 'lost'.

    Assuming you have done this at the domain registrar level, and have manually made all required changes and restarted all services, it should work.

    I do have backup (store and forward) MX servers where I manually add the extra Qmail changes and the domains are not defined in Plesk, only in the Qmail files (requires additional changes to smtproutes and rcpthosts), and nothing even in the Apache files since it is ONLY for email backup.