Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

How to give access to apache to write to a file?

I have created a form that reads and writes settings from:

/etc/mail/spamassassin/local.cf

It reads the settings specified in my config.php file, but it wont let me change them.

I need ti give access to APACHE to write to that file.

How do i accomplish this by SSH?

This file must be writable by the web server!
0
speednow
Asked:
speednow
  • 2
  • 2
1 Solution
 
nociSoftware EngineerCommented:
Try "chown apache /etc/mail/spamassassin/local.cf" + 'chmod u+w ....'
Be sure the original reader belong to the group that can still read the file.

Be advised that everybody that can access your webserver can update that file.....
0
 
speednowAuthor Commented:
chown: `apache': invalid user
0
 
speednowAuthor Commented:
Follow Up??
0
 
BlazCommented:
Maybe you can try user nobody instead of apache. Or better yet - figure out under which user your apache servers runs.

"ps -elf | grep httpd"

The third column should give you the user.
0
 
nociSoftware EngineerCommented:
In the httpd.conf (or config file that is supplied to the apache process) there is u "User xxx"
statement. Lookup that line and use the username mentioned there.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now