Change apache directory in Manjaro

If you’ve installed the Apache HTTP server software on your local machine you might want to change the location where the webpages are located. I.e. move it to “/home/user/public_html” so it’s more accessable for development purposes.
The wasn’t clear to me about how to solve the forbidden errors I encountered. But the solution was actually simple:

In the file /etc/httpd/conf/httpd.conf change the path in DocumentRoot "/srv/http" and <Directory "/srv/http"> to your local folder (i.e. /home/user/public_html).
Also change User http to User jakob (in my case)

Than on your local machine add your user-name (jakob in my case) also to the group “http”

Last thing to do is restart the apache server with sudo systemctl restart httpd

To test the connection make a php-file and put <?php phpinfo(); ?> in it.
In your browser go to localhost or and hopefully the php config file with all settings are presented there.

2 Replies to “Change apache directory in Manjaro”

  1. Mvns schreef:

    Thanks a lot Man. Exactly what i was looking for.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

© 2021 Jakob Helmer - Powered by WordPress - @trails&tribulations