Server Setup

Virtual Server Configuration for Apache Webserver

In Apache webserver, you can set virtual server configuration to allow several domains to access the same concrete5 installation on your server. This guide assumes you are under Debian Linux regarding the folder structure but the Apache configuration will work in any Apache installation, although the configuration files might be stored in different locations.

Assuming you have concrete5 installed in /home/user/public_html/, this is how you setup a virtual server to map multiple domains into that folder (and concrete5 installation):

  1. Login to your server with root-account (or sudo)
  2. Make a new file with the same filename as your main-level domain in /etc/apache/sites-available/
    • E.g.  /etc/apache/sites-available/yourdomain.com
  3. Write the configuration given below to that file
  4. Save that file and run "a2ensite yourdomain.com" with the filename you just created, i.e. replace "yourdomain.com" with your actual domain
  5. Restart the Apache server process with the command service apache2 restart

The virtual server configuration you need to put into the Apache configuration file is something like this (just an example, your actual configuration may differ):

<VirtualHost *:80>
    ServerName yourdomain.com
    # *.yourdomain.com for all the sub-domains
    # separate additional addresses with space
    ServerAlias *.yourdomain.com www.other-domain.com www.third-domain.com
    ServerAdmin webmaster@service.com

    # The root directory of your concrete5 installation
    DocumentRoot /home/user/public_html/
</VirtualHost>

Domain setup: Setting up a DNS wildcard

If you need to map all the sub-domains for your domain, this is the correct DNS setup to do so: 

yourdomain.com.     IN A        123.123.123.123
*.yourdomain.com.   IN CNAME    yourdomain.com.

If you don't have straight access to modify the DNS configuration files on your name server and need to do this through a GUI, you can probably set the wildcard just by adding a CNAME record for *.yourdomain.com that will point to the main domain that you've already setup properly. This is supported by many of the DNS service providers but we cannot guarantee it will work with every service provider.