0

I have installed Apache, PHP5, and MySQL on my new Linux Lite install for my laptop. I have edited <Directory /> in apache2.conf to look like this:

<Directory />
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
</Directory>

And I have added a new <Directory> tag to point to where I have my files.

<Directory ~/Projects/hcr/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

I have also changed the DocumentRoot in sites-available/000-default.conf to look this: DocumentRoot ~/Projects/hcr

After doing that and restarting Apache, the previous error I was having, which was 403, goes away, but now I get 404 Not Found when there is an index.php file located in the directory.

1 Answer 1

2

I would not use the tilde character "~" to indicate your home directory, if that was your intention. The httpd process runs with a proper www-user and it will not know anything about your home directory. httpd will not find anything and that is why you get the 404 (not found) error reply. Furthermore the tilde is expanded in in linux shells. Remove the tilde thus you are referring to the directory from where your httpd serves by default, which depends on your distro. Examples are /var/www/... or srv/www/htdocs. This is the place from where web content shall be served.

1
  • Thanks! I changed the website directory to a new folder, /proj and update the config files. Nov 29, 2018 at 1:20

Not the answer you're looking for? Browse other questions tagged .