Page 1 of 1

[SOLVED] How to change the WEB site directory?

Posted: 2019/09/01 18:45:23
by Amatøren
I have small system disks so I want my WEB directory to be on may 44 TB RAID6 disk. The raid is up and working.

I deleted the directory html (/var/www/html) and replaced it with a link called html that points (redirect) to /mnt/raid6/www/html

I have also tried to change DocumentRoot to /mnt/raid6/www/html in httpd.conf.

(Yes, I restarted the service after every change.)


The default demo WEB page is working. The problem is my own web page (it works on my old server where the directory html is on the system disk (default installation) ).

Now i got:

Code: Select all

Forbidden

You don't have permission to access /epg/ on this server.
epg is a sub directory under html.

Re: How to change the WEB site directory?

Posted: 2019/09/01 19:55:39
by TrevorH
I deleted the directory html (/var/www/html) and replaced it with a link called html that points (redirect) to /mnt/raid6/www/html
That's going to cause you problems. The directory /var/www/html is owned by the httpd package and it will try to recreate it with the correct ownership and permissions (by its definition, not yours). That will blow up with an error if it is a symlink. You're probably better off bind mounting a directory to it.

Re: How to change the WEB site directory?

Posted: 2019/09/01 20:00:47
by Amatøren
Thanks.

In fstab? Possible for an example?

Re: How to change the WEB site directory?

Posted: 2019/09/01 20:14:40
by TrevorH
Like

Code: Select all

/existing/directory/fullof/data /var/www/html none bind 0 0 
Test using mount --bind /thing/to/mount /place/to/mountit

Re: How to change the WEB site directory?

Posted: 2019/09/01 20:40:29
by Amatøren
Thanks!

I will test it out tomorrow. No I see what I did wrong.

I got a clue from Google search, but didn't got the time to test it. It's the same as your tip.

Re: How to change the WEB site directory?

Posted: 2019/09/02 14:30:46
by Amatøren
Mounting OK, but still same problem to access WEB page.

Code: Select all

mount --bind /mnt/raid6/www/html/ /var/www/html/

Re: How to change the WEB site directory?

Posted: 2019/09/02 15:18:08
by TrevorH
Try restorecon -RFv /var/www/html to reset teh selinux contexts to what they should be.

Re: How to change the WEB site directory?

Posted: 2019/09/02 19:19:21
by Amatøren
Thanks again!

That fixed it!