Apache

Tags: @server @apache @domain

To add a new domain

  1. Create a conf file:
    1. nano /etc/apache2/sites-available/faaiz.org.conf
    2. Inside the conf file:

<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	ServerName faaiz.org
	ServerAlias www.faaiz.org
	DocumentRoot /var/www/faaiz.org
	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

  1. create your site directory: > sudo mkdir /var/www/faaiz.org
  2. assign ownership: > sudo chown -R $USER:$USER /var/www/faaiz.org
  3. assign permissions: > sudo chmod -R 755 /var/www/faaiz.org
  4. make index page: > touch /var/www/faaiz.org/index.html
  5. enable site: > sudo a2ensite faaiz.org.conf
  6. reload apache: > sudo systemctl reload apache2 or restart apache2