sudo apt-get install apache2
To host your own custom website, you will want to use the /var/www folder for your files.
First let's disabled the default websites Apache sets up for us:
sudo a2dissite default
sudo a2dissite default-ssl
sudo a2dissite 000-default
Then remove the default-ssl file:
sudo rm /etc/apache2/sites-available/default-ssl
We are only going to need the default file in the sites-available folder. Lets change the default file to accept SSL and also point all non-ssl requests to the SSL website.
Open it with nano:
sudo nano /etc/apache2/sites-available/default
and alter it to look like this:
<VirtualHost *:80>
Redirect permanent / https://mydomain.com/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
SSLEngine on
SSLCACertificateFile /etc/ssl/custom/certs/official-www-mydomain-com-ad-inter.crt
SSLCertificateFile /etc/ssl/custom/certs/official-www-mydomain-com.crt
SSLCertificateKeyFile /etc/ssl/custom/keys/official-www-mydomain-com.key
</VirtualHost>
</IfModule>
Now re-enable the default site:
sudo a2ensite default
Finally we want to reload & restart the web server:
sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart
Now you can just add any web files straight to the /var/www folder without having to restart the apache.