apache / php cannot write in folder

Support for security such as Firewalls and securing linux
Post Reply
gluehbirne
Posts: 3
Joined: 2016/01/20 15:24:16

apache / php cannot write in folder

Post by gluehbirne » 2016/01/20 15:31:41

Hi there,

i am quite new in linux servers. probably aou are asick of these guys but everybody started once :-)

so - i try to install an issue tracking system on CentOS7 with httpd, mariadb an php5. Now everything was fine - html-docs can be displayed, phpinfo is shown and wordpress can be installed. i thought ok - thats it - but when i try to install osticket or itop there are problems. php / apache cannot create files.

User apache is owner of the complete directory /var recursive and permissions are 777. it is quite frustration and i am try to find a solutin for the last 5 hours - it is really frustrating. for centos pro´s this could be a marginal problem :-)

i tried to deactivate selinux - but now centos seems to be crashed.

for any help thanks in advance

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

Re: apache / php cannot write in folder

Post by TrevorH » 2016/01/20 15:58:31

User apache is owner of the complete directory /var recursive and permissions are 777. it is quite frustration and i am try to find a solutin for the last 5 hours - it is really frustrating. for centos pro´s this could be a marginal problem :-)

i tried to deactivate selinux - but now centos seems to be crashed.
Frankly, given all that lot, I'd wipe your system and start over. This time do not disable selinux, do not change the ownership of /var and do not set permissions of 777 on anything.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

gluehbirne
Posts: 3
Joined: 2016/01/20 15:24:16

Re: apache / php cannot write in folder

Post by gluehbirne » 2016/01/20 16:14:14

I know - it is not recommended and not safe. The Server online runs in LAN. First of all i have to get the Systems installed, after that the full permissions can ne deleted. My topic is to get installed the Systems in this testing network. So security is not that important.

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

Re: apache / php cannot write in folder

Post by TrevorH » 2016/01/20 16:37:10

Security is always important and it;s very possible that the changes you made are actually causing your issues.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

gluehbirne
Posts: 3
Joined: 2016/01/20 15:24:16

Re: apache / php cannot write in folder

Post by gluehbirne » 2016/01/20 16:50:58

So - why should full permission bei the reason for that? I also tried it with less permissions. Something is wrong with php and Apache i guess. Security is important for sure - But i tried several things

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: apache / php cannot write in folder

Post by gerald_clark » 2016/01/21 13:18:14

Your changes have masked the original problem, and you have dug a hole that is very difficult to climb out of.

Post Reply

Return to “CentOS 7 - Security Support”