CWP Account's Subdomains on Main Domain

563 Views Asked by At

I was surfing on the internet and I don't know what's going on anymore. I flipped across Google ;)

How to setting my VPS for all user's accounts? Could you help me?

Example:

Server "top" domain: srv1.myserver.com

  1. Customer domain: ubuntu001.com (now it's OK: www.myserver.com/~ubuntu001)
  2. Customer domain: garfield.net (now it's OK: www.myserver.com/~garfield)

I need this "format":

  1. ubuntu001.myserver.com OR ubuntu001.com.myserver.com
  2. garfield.myserver.com OR garfield.net.myserver.com

How to config my CWP VPS (apache vhosts)?

Thank you for all the guidelines.

UPDATE:

  1. Edit this conf file: /usr/local/apache/conf.d/vhosts/myserver.com.conf
  2. Add "ServerAlias" for VirtualHost block
  3. Restart Apache service on server
<VirtualHost 1.2.3.4:80>
    ServerName ubuntu001.com
    ServerAlias www.ubuntu001.com
    ServerAlias ubuntu001.myserver.com
    ServerAlias www.ubuntu001.myserver.com

    ServerAdmin [email protected]
    DocumentRoot /home/ubu001/public_html
    
    [...]
    
    <IfModule mod_setenvif.c>
        SetEnvIf X-Forwarded-Proto "^https$" HTTPS=on
    </IfModule>

    <Directory "/home/ubu001/public_html">
        Options -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
        AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
    </Directory>

    [...]
    
</VirtualHost>

I's OK: http://ubuntu001.myserver.com I's not working: httpS://ubuntu001.myserver.com

(the myserver.com is an example domain)

0

There are 0 best solutions below