1

I am trying to create a website in the latest version of Fedora Linux. I want the website to point to something in my home directory. After doing some Googling, I can acheive this with a SymLink. The problem I'm having is that I'm receiving a "Forbidden" Message

I do NOT have an Apache config file for some reason. But I read that I was supposed to configure the httpd.conf equivalent. So without further ado, here is my https.config file in addition to my .htaccess. I can't get the quote tag to work so you'll just have to read it in normal text on pastebin.

/etc/httpd/conf/httpd.conf https://pastebin.com/j4Lvqy3q

.htaccess https://pastebin.com/HhfDcbg5

I created the symlink

sudo ln -s /home/archive /var/www/html/

Once I have configured the files, I changed permissions on the directories

sudo chmod -R 777 /home/archive
sudo chown -R archive:archive /home/archive

and restarted httpd

sudo systemctl restart httpd

It didn't work. It has every reason to work and I followed all the instructions, yet it failed. So I decided to play around with it. I noticed that the symlink works if it points to a directory WITHIN the webroot. But it only fails when pointing to a directory outside of it.

So the symlinks themselves work, it's just something to do with permissions either in the config file or the filesystem. The above steps should have taken care of that so I don't know what else to do.

Oh, and just for fun I tried

sudo chown -R apache:apache /home/archive
sudo systemctl restart httpd

That didn't work either

  • What was happened with physical/original non symlinked directory /var/www/html/ ? It won't be overridden with symlink as you did. (BTW, never use 777 permissions on exposed to the internet servers) – Alex Aug 11 '18 at 18:18
  • I don’t understand what you mean. The /var/www/html directory has 755 permissions. It is also owned by the root user and group. I don’t think that is a problem because I can access my normal non symlink files and folders. I used 777 for the non webroot direcory because I don’t care about security. I just want it to work. One I get it to work, THEN i’ll worry about security. – user21303 Aug 11 '18 at 18:34
  • I noticed something interesting. I copied the archive directory to the archive directory to /archiveroot and added in entries and a symlink to the arhiveroot directory. When i try to access the archive symlink, the error says I don’t have permissions to access archive/index.html. When i try to access the archiveroot symlink, it only says I cannot access archive root but without the index.html. Not sure if that helps. Just fooling around and gathering information – user21303 Aug 11 '18 at 19:15
  • Add Allow from all and Require all granted to the section <Directory "/var/www/html/archive">...</Directory> – Alex Aug 11 '18 at 19:34
  • I’m sorry but that did not work – user21303 Aug 11 '18 at 19:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.