Need to implement secure /var/www/html and /usr/lib/cgi-bin in Apache
I have installed apache on my ubuntu. The htdocs folder is in /var/www/html
I am using a cgi script (running in browser) to write files inside multiple directories of /var/www/html.
If I give 755 permission(looks safest because only owner has write permissions) to directories inside /var/www/html then I am not able to write into them using cgi script because cgi script owner is www-data which does not have permission to write into them.
If I give 777 permissions to these directories then everything works fine but this does not look a secure way at all because projects of /var/www/html folder is accessible using browser globally and 777 means anyone can write into them.
What should be the ownership and permissions of /var/www/html and the directories inside /var/www/html, so projects are secured enough and cgi script should be worked fine.
Please help.
Thank You
|