Masoud Hosseini apache server

How to install apache on ubuntu:

let’s write a more friendly than an official apache document :

it’s simple, just follow steps below (Debian bases distributes):

  1. go to path : /etc/apache2/sites-available/
cd /etc/apache2/sites-available/

2. make a copy of the default configuration file (000-default.conf).

for every domain or subdomain that is assigned to this server IP address you need to make a copy of the default file and edit it as I explained in continue:

sudo cp 000-default.conf masoud.me.conf

3 . open the file that you created :

sudo nano masoud.me.conf

change documentRoot to the path you want to load you project

and change serverName to URL that is pointing to this file

4 . save and exit

4.5 . test your changes and be sure that your changes wont make down all apache sites :

sudo apachectl configtest

5 . now you need to add it to sites-enabled

for this you need to execute the command below :

sudo a2ensite masoud.me.conf

6 . important part is to disable the default file :

sudo a2dissite 000-default.conf

7. now you need to reset or reload apache :

service apache2 reload

Reference :

https://ubuntu.com/tutorials/install-and-configure-apache#2-installing-apache

Leave a Reply

Your email address will not be published. Required fields are marked *