Page 2 of 3

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 11:18:41
by TrevorH
Actually I didn't really look at what you were doing and I think it's too broad in any case. I'd reverse the semanage command by running it again but instead of using -a, use -d to delete the one you added.

sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/packages(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/application/config(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/application/files(/.*)?'
sudo restorecon -RFv /var/www/html/concrete5-8.0.3

I'd also suggest moving the directory so that it's called just concrete5 (and adjusting the commands above) and doesn't include the entire release number in it or you'll be repeating these commands every time you need to update it and it installs into a slightly differently named directory...

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 11:47:43
by FazzaGBR
TrevorH wrote:I'd reverse the semanage command by running it again but instead of using -a, use -d to delete the one you added.
Done! :)
TrevorH wrote:I'd also suggest moving the directory so that it's called just concrete5
Also Done! :)
TrevorH wrote:sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/packages(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/application/config(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/application/files(/.*)?'
sudo restorecon -RFv /var/www/html/concrete5-8.0.3
I'm getting: file_spec option is needed for add when I run the first command :(

Your help with this is much appreciated - I'm new to Linux and I'm on a very sharp learning curve!

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 11:51:21
by TrevorH
I cut and pasted the command from your quote and ran it and it worked for me.

sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/packages(/.*)?'

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 11:53:58
by FazzaGBR
TrevorH wrote:I cut and pasted the command from your quote and ran it and it worked for me.

sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/concrete5-8.0.3/packages(/.*)?'
Strange as I get this:

Image

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 11:59:48
by TrevorH
What's with the # marks around the filename pattern? Those should be single quotes.

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 12:09:58
by FazzaGBR
TrevorH wrote:What's with the # marks around the filename pattern? Those should be single quotes.
No idea how that happened! Well spotted - it's time for some more Cold and Flu capsules in 20 minutes so that might make me more awake!!

Image

As you can see the commands worked successfully (as far as I can tell), I've rebooted again (just in case) but after opening a new browser windows it's still saying the same thing :(

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 15:59:00
by FazzaGBR
Not sure but I think I might be getting somewhere.

If I run setenforce 0 that error goes away and just leaves me with the PDO error. Hopefull this will mean something to someone and they might be able to point me in the right direction on what I need to do so I can re-enable SELinux (setenforce 1)?

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 16:08:43
by pjsr2
Don't disable selinux, but read up on how to diagnose and address selinux issues.
Read the HowTo: https://wiki.centos.org/HowTos/SELinux

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 19:27:47
by TrevorH
You used applications where the directory is called application.

Re: Directories Must Be Writeable By Your Web Server

Posted: 2017/12/06 21:26:06
by FazzaGBR
TrevorH wrote:You used applications where the directory is called application.
I've corrected that, re-enabled SELinux, rebooted the server and the error is back.