What i am missing here? where is the fault

Hello Manjaro Community , I am Rajrup, yesterday i’ve downloaded apache and php php-apache, everything was ok , but i am facing some issues with the configuration
default configuration for httpd.conf document root and directory is

<Directory />
    Options Indexes FollowSymLinks
    AllowOverride none
    Require all denied
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/http"
<Directory "/srv/http">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    #
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

i want to change the default document root and Directory path to my home directory,
I tried my best possible to do that change but it is not working ,
It’s keeps saying me access denied , but when i run through that default directory everything is working ,
Now my question is what i am missing , how to set the default apache root path to home directory?

httpd is run as user http

http does not have access to your $HOME - and for good reason.

Best is to bind mount the directory you want to serve (and only that one) from your $HOME to /srv/http (or any subdirectory created in there).
Make sure, the directory and files are world readable.

1 Like

Thanks a lot , now it’s working
and yes i had to sudo chown to that directory.
linux is really very secure

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.