The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

addon domain / servername problem

Discussion in 'General Discussion' started by webmeister, Jan 31, 2004.

  1. webmeister

    webmeister Member

    Joined:
    Aug 5, 2002
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1


    Is there a way to get cpanel to use the right server_name for addon domains?

    Problem: cpanel addon domains produce virtualserver containers in the httpd.conf file that use both the main account domain name and the new addon domain name as part of the httpd.conf servername directives... this produces urls like http://newdomain.com.accountdomain.com which confuse the websurfer and the search engines... for example...

    <VirtualHost 127.0.0.1>
    BytesLog domlogs/addon.com.accountdomain.com-bytes_log
    ServerName addon.com.accountdomain.com
    ServerAlias www.addon.com.accountdomain.com
    ServerAlias addon.com *.addon.com
    ServerAdmin wwwadmin@accountdomain.com
    DocumentRoot /home/accountname/public_html/addon.com
    CustomLog domlogs/addon.com.accountdomain.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/addon.com/cgi-bin/
    User username
    Group username
    </VirtualHost>


    Unless there is a great reason to do otherwise, at least from my viewpoint as a programmer, cpanel should be writing something like:

    <VirtualHost 127.0.0.1>
    BytesLog domlogs/addon.com-bytes_log
    ServerName addon.com
    ServerAlias www.addon.com
    ServerAlias addon.com *.addon.com
    ServerAdmin wwwadmin@accountdomain.com
    DocumentRoot /home/username/public_html/addon.com
    CustomLog domlogs/addon.com combined
    ScriptAlias /cgi-bin/ /home/username/public_html/addon.com/cgi-bin/
    User username
    Group username
    </VirtualHost>

    The main issue is that cpanel should be writing

    ServerName addon.com
    ServerAlias www.addon.com
    ServerAlias addon.com *.addon.com

    If there is a way to force this by configuration please advise. Also consider this a "bug fix" request ;-) ... some scripts need to know what server they are running on and these double-size url's are a pain from a programmers perspective.

    Thanks!
    DC
     
  2. vwiley1

    vwiley1 Well-Known Member

    Joined:
    Oct 4, 2003
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    ...

    I would also like to see this fixed. This can cause problems. Here is an example of a problem it is causing.

    One of my clients has 3 domains. He wants to keep the domain I set his cpanel account up with totally out of the picture.

    When people go to: http://addondomain.com/

    They are automatically redirected to http://addondomain.clientsdomain.com/

    He does not want people going to his add on domain to know anything about his main domain.

    How do I fix this?
    Prevent it from happening again?
     
  3. webmeister

    webmeister Member

    Joined:
    Aug 5, 2002
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    yes... this is a simple easy fix for cpanel to just rewrite the couple of lines that write those entries in the httpd.conf ...
     
Loading...

Share This Page