Quick steps to create a new Apache web site. The FQDN of the web site is “acme.org” 

  1. Create a virtual host file for the new site
       /etc/apache2/sites-available/acme.org

    <VirtualHost *:80>

            ServerAdmin webmaster@acme.org

            ServerName  acme.org

            ServerAlias www.acme.org

            # Indexes + Directory Root.

            DirectoryIndex index.html

            DocumentRoot /var/www/acme.org

            # Logfiles

            ErrorLog 

    /var/www/acme.org/logs/error.log

            CustomLog

    /var/www/acme.org/logs/access.log combined

    </VirtualHost>

  2. Create necessary folders & file
       /var/www/acme.org
       /var/www/acme.org/index.html

       /var/www/acme.org/mfa
       /var/www/acme.org/mfa/index.html

       /var/www/acme.org/logs

  3. Enable the new web site
       sudo a2ensite acme.org

  4. Restart Apache Server
       sudo /etc/init.d/apache2 restart 

  5. Test it

  • No labels