3/24/2018 - 10:17 AM

Apache Configuration for new DEV site

// create directories to serve content inside apache root folder
sudo mkdir -p /var/www/

// change directories ownership to add write permissions to our current user
sudo chown -R $USER:$USER /var/www/

// add read permissions to the general web directory
sudo chmod -R 755 /var/www

// create sample pages for our site
nano /var/www/

    <title>Welcome to!</title>
    <h1>Success!  The virtual host is working!</h1>

// copy the sample apache conf file to configure each website
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/

// open the file and edit the contents
sudo nano /etc/apache2/sites-available/

<VirtualHost *:80>
    DocumentRoot /var/www/
    <Directory /var/www/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

// enable the configuration files
sudo a2ensite

// restart apache
sudo service apache2 restart