Directories Must Be Writeable By Your Web Server

Issues related to applications and software problems
User avatar
TrevorH
Forum Moderator
Posts: 21167
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Directories Must Be Writeable By Your Web Server

Postby TrevorH » 2017/12/06 11:18:41

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...
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
FazzaGBR
Posts: 15
Joined: 2017/12/05 15:54:11

Re: Directories Must Be Writeable By Your Web Server

Postby FazzaGBR » 2017/12/06 11:47:43

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!

User avatar
TrevorH
Forum Moderator
Posts: 21167
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Directories Must Be Writeable By Your Web Server

Postby TrevorH » 2017/12/06 11:51:21

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(/.*)?'
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
FazzaGBR
Posts: 15
Joined: 2017/12/05 15:54:11

Re: Directories Must Be Writeable By Your Web Server

Postby FazzaGBR » 2017/12/06 11:53:58

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

User avatar
TrevorH
Forum Moderator
Posts: 21167
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Directories Must Be Writeable By Your Web Server

Postby TrevorH » 2017/12/06 11:59:48

What's with the # marks around the filename pattern? Those should be single quotes.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
FazzaGBR
Posts: 15
Joined: 2017/12/05 15:54:11

Re: Directories Must Be Writeable By Your Web Server

Postby FazzaGBR » 2017/12/06 12:09:58

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 :(

User avatar
FazzaGBR
Posts: 15
Joined: 2017/12/05 15:54:11

Re: Directories Must Be Writeable By Your Web Server

Postby FazzaGBR » 2017/12/06 15:59:00

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)?

pjsr2
Posts: 189
Joined: 2014/03/27 20:11:07

Re: Directories Must Be Writeable By Your Web Server

Postby pjsr2 » 2017/12/06 16:08:43

Don't disable selinux, but read up on how to diagnose and address selinux issues.
Read the HowTo: https://wiki.centos.org/HowTos/SELinux

User avatar
TrevorH
Forum Moderator
Posts: 21167
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Directories Must Be Writeable By Your Web Server

Postby TrevorH » 2017/12/06 19:27:47

You used applications where the directory is called application.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
FazzaGBR
Posts: 15
Joined: 2017/12/05 15:54:11

Re: Directories Must Be Writeable By Your Web Server

Postby FazzaGBR » 2017/12/06 21:26:06

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.