Quackers Posted October 19, 2015 Posted October 19, 2015 (edited) Any linux guru's know how do i give perl write permissions to certain directories? Trying to install some web based software and the install errors saying perl cannot write to the directories i've specified. Im familiar with the chmod and chown commands as i have to use these to give the apache account certain privileges, but i've never done anything with perl before. Edited October 19, 2015 by Quackers
LosOjos Posted October 19, 2015 Posted October 19, 2015 (edited) I'm no guru, but I'm pretty certain you don't give Perl any specific access, it inherits the access of the user who runs the script. So if you're running the script as yourself, you need access to the directories. If it's running as part of a web service, the server (e.g. Apache) needs access EDIT to add: this is Linux permissions in general, it's not Perl/Apache specific Edited October 19, 2015 by LosOjos
pcstru Posted October 19, 2015 Posted October 19, 2015 Any linux guru's know how do i give perl write permissions to certain directories? Trying to install some web based software and the install errors saying perl cannot write to the directories i've specified. Im familiar with the chmod and chown commands as i have to use these to give the apache account certain privileges, but i've never done anything with perl before. Which linux distribution are you running? What software are you trying to install and where?
LosOjos Posted October 19, 2015 Posted October 19, 2015 (edited) Are you running it under sudo? It's generally a bad idea to run anything as root unless you're certain you need to - it would give the script unfettered access to your system. It would also make any files created by an installation script owned by root which would make them inaccessible to Apache anyway Edited October 19, 2015 by LosOjos
cpjitservices Posted October 19, 2015 Posted October 19, 2015 are u trying to run a perl script if so try chmod+x ?
Quackers Posted October 19, 2015 Author Posted October 19, 2015 I've double checked the permissions and even as a temp measure just to try and get it working give 777 to both folders and it still errors. Can anybody see anything wrong? Its Cent OS, the httpd service is running as the user apache , so i've made apache the owner to /var/www/cgi-bin and /var/www/midas and yet the bloody thing still moans it don't have write permission.
Geoff Posted October 19, 2015 Posted October 19, 2015 Are you running selinux? As it might be getting in the way. 1
cpjitservices Posted October 19, 2015 Posted October 19, 2015 SELinux https://www.digitalocean.com/community/tutorials/an-introduction-to-selinux-on-centos-7-part-1-basic-concepts 1
Quackers Posted October 19, 2015 Author Posted October 19, 2015 Disabling SELinux has fixed it, thanks never even heard of that.
Geoff Posted October 19, 2015 Posted October 19, 2015 Yeah, it's a security system used to define access control policies. So you can say Apache only has access to these files and devices. It's really handy in stopping exploits and rootkits. For an internal server I would not bother unless there is a compliance reason to have it.
cpjitservices Posted October 20, 2015 Posted October 20, 2015 For a non production server use the following command: setenforce 0. This will disable SELinux until the next restart, You will need to edit the sysconfig file to disable SE completely.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now