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 wiki.archlinux.org 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 127.0.0.1 and hopefully the php config file with all settings are presented there.

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>

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