1

I'm writing an apache module that does the following:

1) User requests a page (index.html)

2) Apache module will act as a filter that counts the number of words in index.html and then append the number of words at the footer of the html file.

3) Overwrite index.html with the one that has the footer, which is the new index.html

4) Serve the http request to the user.

Basically I'm having problem for step 3 when I'm using fwrite to append the footer to the index.html but to no avail. I suppose its a file access permission error.

I would like to know what's the best way to go about overcoming this issue because I've learnt that allowing write access for www directory is a high security risk.

kapa
  • 77,694
  • 21
  • 158
  • 175

1 Answers1

0

chmod 755

This should allow read and execution status to everyone, and allow changes only to the owner of the file. Ensure that the file owner is the same as the owner of the module. Can you post the current permission and owner of the file, and the current owner or user running apache?

Brett McLain
  • 2,000
  • 2
  • 14
  • 32
  • root@cong-VirtualBox:/var/www# ls -ld drwxr-xr-x 2 root root 4096 2011-12-10 12:00 Is this the one? I'm new to linux so any guidance would be greatly appreciated :D Thanks – user1015850 Dec 12 '11 at 23:39