4
votes
3answers
168 views

File permissions

I have a PHP script running which makes symlinks. To confirm which user it is: file_put_contents("testFile", "test"); $user = fileowner("testFile"); unlink("testFile"); echo "running as user '" . ...
0
votes
0answers
303 views

Reading apache error logs from php

I have apache2 logs at :/var/log/apache2/error.log which has permission: -rw-r----- 1 root adm 127140 Mar 20 12:54 /var/log/apache2/error.log for the sake of accessing from php I changed the ...
3
votes
2answers
135 views

Changing default permissions for wget?

I'm using a PHP script to call shell_exec and execute wget to download some files to /var/www/dir/. (Internal tool, so security isn't much of an issue) The directory has 777 permissions. But when I ...
0
votes
1answer
604 views

Allow www-data to perform specific commands

I need a PHP script to perform git pull however I am not naive enough to give it permissions on git. I've wrapped git pull in a script which www-data has permissions for, but I'm not sure how to give ...
0
votes
1answer
81 views

File permissions when mixing command line and server

I have a PHP server which creates folders and files for certain things. I also run supporting code from the command line operating on the same folders and files. The problem is that when running from ...
0
votes
2answers
388 views

How can I access the log via a php script?

I have a statistics-file on my apache server on /var/www/vhosts/test/statistics/logs/access_log I tried using echo system('cat /var/www/vhosts/test/statistics/logs/access_log'); in a php ...
0
votes
2answers
457 views

How do I make PHP securely load files from the server root home folder on CentOS?

So I built what I thought would be this awesome reporting page in PHP that loads data from some CSV text files and creates nice Google charts and tables for our clients. I then thought it would be ...
2
votes
2answers
252 views

I can not remove folder from server

Accidentall I created the folder on remotely server (Server OS is Linux) using php: mkdir("folder_name",0); Now I can not delete this folder from server. I think this is from permission, because 0 is ...
4
votes
2answers
684 views

How to set secure permissions for multiple users and multiple websites?

On a Gentoo 3.2.12 server with apache2+php, there are several websites running: /www /website1 /website2 ...etc The apache user should have read-only access to all the websites. There ...
2
votes
0answers
486 views

proper permissions under HTTP root with Apache2 + FastCGI + Suexec

I currently have a setup which runs Apache2 + FastCGI PHP + Suexec. As an example, I'm using /mnt/data/www/vhosts/inflex.co.uk/htdocs as a DocRoot for one of my virtual hosts. I have a script ...
1
vote
2answers
4k views

Giving PHP permission to write to files and folders

UPDATED FOR FURTHER CLARITY: According to http://expressionengine.com/user_guide/installation/installation.html, it says: For most Unix hosts the following is typical, but you may check with your ...
1
vote
2answers
1k views

How to set up file permissions/ownership for FTP/Apache/PHP on CentOS

I have basic understanding of chmod and CentOS file permissions. 777 stands for 111111111 and rwx for each root, group, user, etc. What I can't get my head around is setting up Apache, FTP and PHP to ...