XiD Documentation Wiki [return to XiD]

You are here:Documentation»Server Management»Manually create a new site via command line

Manually create a new site via command line

The point of this article is to go through the manual steps of creating a new website on a typical Linux-based server

1. Create configuration file

Note: This is dependent on the server distro and apache install location

Create a new site configuration file in the sites-available folder. Duplicating an existing one is the easiest thing to do.

Example lines that need to be edited are below:

  • ServerName YOUR SITE NAME
  • ServerAlias ANY ALIASES HERE (i.e. www.yoursitename.com...not just yoursitename.com)
  • Change any site reference. i.e. /var/www/yoursitename.com (change any references)

Usually you can find the apache location in the /etc/apache2/ or /etc/httpd/ locations. On most setups there is a folder named 'sites-available'. This is where the config files need to go.

Enable the site

Once the config file is created, it is necessary to enable it via command line. When logged in enter the following commands:

  • sudo a2ensite your_site_config_filename
  • sudo /etc/init.d/apache2 restart (This will restart apache with the new config file)

References (Ubuntu docs):