Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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?

  2. #2
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    use alllow to setup who can access put it in the virtual block or anywhere in the main conf.

  3. #3
    Linux Guru
    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 ! -p tcp --dport 80 -j REJECT

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts