Apache umask 002 not changing permissions

7,400

That's one of the standard ways to specify the umask for Apache in CentOS. If your init script (/etc/rc.d/init.d/httpd) sources the /etc/sysconfig/httpd file, either the umask is not specified or something is overriding it.

How are the files being created?

Share:
7,400

Related videos on Youtube

Admin
Author by

Admin

Updated on September 17, 2022

Comments

  • Admin
    Admin over 1 year

    I have used

    [root ~]$ echo "umask 002" >> /etc/sysconfig/httpd
    [root ~]$ service httpd restart
    

    restarted apache many times but whenever i install something from script the directories are still not group writable.

    What should i do

    I have checked the file the umask 002 is at the end of file

    • DevGambit
      DevGambit almost 14 years
      setting up an ftp server seems like it really would be easier for you. and potentially more secure. as you mentioned in a comment on my deleted question; you want to allow people to create files in their home directories. why does it have to be through httpd?
    • Admin
      Admin almost 14 years
      Actually that's web host server. Now i am using joomla. I need to install new plugins and extensions , those extension create their own directories and files. I found that if need to change e files i don't have proper permission , i have to go to root to change those permissions
    • DevGambit
      DevGambit almost 14 years
      well, yeah, that's kind of how the linux world works. you use root to admin globally, not /everything/ on the system will be run as your non-privileged user. i'm guessing the plugins were installed as user www-data ?
    • DevGambit
      DevGambit almost 14 years
      apache runs as user www-data on most systems, or some form, thereof. when a script on an httpd server creates files, it is creating them as the user the server is running as (www-data) or the user who owns the files IF you are using something like SuPHP. otherwise, as root, you need to give your httpd server a directory to write to, so the scripts can install their modules and the like. you ultimately use the web interface to manage those apps, and you should not have to do anything at the shell level. aside from configuration, perhaps, as root, unless script is in /home/user/public_html
  • Warner
    Warner almost 14 years
    Ah, interesting. I did a quick search of the 2.2 docs on the Apache site and couldn't find anything. You've had some good answers, don't let that discourage you!
  • Admin
    Admin almost 14 years
    The files are created by webiste script insdie the /home/user/www folder
  • Warner
    Warner almost 14 years
    By what? PHP script, Perl script? CGI? mod_perl? What are they doing? This could affect the performance.
  • Admin
    Admin almost 14 years
    By PHP script , more info is given my other comments to cpbills
  • Dylan Pierce
    Dylan Pierce over 8 years
    Just want to chime in because I'm having this same issue but 5 years later. Did you ever find a solution?