Centos 7 / Webmin / Apache

General support questions
Post Reply
scatterbrainz
Posts: 11
Joined: 2018/12/23 22:00:34

Centos 7 / Webmin / Apache

Post by scatterbrainz » 2019/06/11 10:06:28

Hey Folks,

I'm running centos 7 server on a box, I've got httpd installed and running, in addition I have Webmin for remote functionality. The goal is to load all my coding files onto the server, and have apache serve them up as a virtual host. So it closely mimics a real hosting environment.

So when I go into webmin - I create a virtual host, where it says "#rootdirectory" , i put in my project folder directory, which is NOT in the /var/www directory but rather /home/nfs-srv/project. When I try to access the web page via 192.xxx.xxx.xx:80 as a designated port it bombs?

Anyone know what I'm missing ?

Thanks a bunch

Best...

SB

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Centos 7 / Webmin / Apache

Post by MartinR » 2019/06/11 11:00:05

If the line starts with a hash sign (#) it is commented out, so will have no effect whatsoever. Try removing the hash.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos 7 / Webmin / Apache

Post by TrevorH » 2019/06/11 14:24:40

If you aim to use /home as a source for serving http data then you need to tell selinux that you are going to do so. By default it treats all accesses by httpd to directories and files under /home as an attack and will block it. You need to enable the httpd_enable_homedirs boolean using setsebool -P. You'll also need to "fix" permissions to allow it so you may need to add the "others" +x bit on the directories leading down to your content (assuming that they are not already owned by httpd). That in itself is a security exposure which is one of the reasons it's disabled by default.

There's a reason why userdirs are disabled by default. It's probably much better, more secure and easier all round just to use the default /var/www directory for your content.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply