Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Jun 2004
    Posts
    4

    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
    Location
    England
    Posts
    1,219
    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
    Location
    Täby, Sweden
    Posts
    7,578
    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:
    Code:
    iptables -A INPUT -s ! 127.0.0.1/32 -p tcp --dport 80 -j REJECT

Posting Permissions

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