How do you give execute permissions to Apache2 user and NOT to everyone else?
I have Ubuntu Server running and I am setting up a separate directory as a cgi-bin. I have the directory ready and I changed the file for the site. However, to get it to work, I need to change the permissions of the Python script I have in the folder so that Apache can execute it. However, I don’t want to give write or execute access to ANYONE other than root, me and Apache. I’m assuming this is possible, but how can it be done?
chown the files to whatever your Apache group is called (Usually www-data) and set permissions to only give user/group permissions:
chown -R www-data:www-data /path/to/cgi-bin
chmod -R 764 /path/to/cgi-bin
That sets it so only the www-data user and group can write the file, and only the www-data user can execute the file, everyone can read.
Check more discussion of this question.
Related posts:
- Apache doesn’t honor my file’s permissions?
- How to give PHP permissions to write to files without globally opening up permissions to the directory
- Copy a file’s owner permissions to group permissions
- Setting umask for www-data user (run via sudo) on Ubuntu 10.04 LTS
- phusion passenger, apache2 only works with www
Leave a comment
Recent Posts
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





