Search This Blog

Monday, November 21, 2022

Ubuntu - Apache2 403 forbidden after changing the directory path apache2.conf Solution

 Step 1 

Always better to create a folder under your home/user folder.

for ex:

    mkdir /home/drvijay/html

    cd /home/drvijay/

    chmod -R 775 html/

    chown drvijay:drvijay html/

 

Step 2

> sudo nano /etc/apache2/sites-available/000-default.conf

#Comment the older root path and add yours

#       DocumentRoot /var/www/html

        DocumentRoot /home/drvijay/html 


Step 3

> gedit /etc/apache2/apache2.conf

#add your block and comment the /var/www/html block



Step - 4

 systemctl restart apache2


Enjoy

http://localhost



No comments:

Hit Counter


View My Stats