Results 1 to 3 of 3
I'm trying to mimic my web server on my local server for testing PHP/MySQL setups, but I can't get it to work. Basically, PHP cannot write to or open a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-30-2004 #1
- Join Date
- Jun 2004
Two permissions questions
I'm trying to mimic my web server on my local server for testing PHP/MySQL setups, but I can't get it to work. Basically, PHP cannot write to or open a file in my site directory. So, I have two questions:
How can I setup the htdocs directory so that I can edit/create the files in it and the user nobody (for apache) can edit/create files?
Also, how can I set up httpd.conf so that it will only allow the localhost to connect, and no one from the outside?
- 06-30-2004 #2
use alllow to setup who can access put it in the virtual block or anywhere in the main conf.
- 06-30-2004 #3
- Join Date
- Oct 2001
- Täby, Sweden
Apache often runs as a user called either apache or www, which means that the PHP scripts will also run as that user, and that user will require write access to your htdocs to accomplish what you want.
I'm not sure how to set up apache to only allow localhost, but at least you can set up an iptables firewall that does the same:
iptables -A INPUT -s ! 127.0.0.1/32 -p tcp --dport 80 -j REJECT