Results 1 to 7 of 7

Thread: Apache problem

  1. #1
    Join Date
    Mar 2005
    Posts
    196

    Apache problem

    I use cPanel server and I have a problem:

    When php script creates a file it seems that its owner and group becaomes automatically 'nobody'. It makes more difficult to use these created files because of that.

    How could I change this setting?

  2. #2
    Join Date
    May 2006
    Location
    Teh Interweb
    Posts
    314
    In your apache config file you can set apache to run as a specific user and group in the VirtualHost directive.

    Example:


    Code:
    <VirtualHost 10.1.2.3>
           ServerAdmin webmaster@host.foo.com
           DocumentRoot /www/docs/host.foo.com
           ServerName host.foo.com
           ErrorLog logs/host.foo.com-error_log
           TransferLog logs/host.foo.com-access_log
           
    User: username
    Group: groupname
    
    </VirtualHost>

  3. #3
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    Look into using PHP suEXEC Support.

    Edit: Nevermind, that's what I get for skimming through a post.
    Last edited by Patrick; 05-29-2006 at 10:31 AM.

  4. #4
    Join Date
    Jan 2005
    Location
    Scotland, UK
    Posts
    2,681
    Quote Originally Posted by Pat H
    Look into using PHP suEXEC Support.

    Note: Davethedork, he's talking about files being created by PHP scripts... not running the Apache webserver as another user.
    Davethedork is correct in what he stated, that does not run apache as another user when in the virtual host directive.
    Server Management - AdminGeekZ.com
    Infrastructure Management, Web Application Performance, mySQL DBA. System Automation.
    WordPress/Magento Performance, Apache to Nginx Conversion, Varnish Implimentation, DDoS Protection, Custom Nginx Modules
    Check our wordpress varnish plugin. Contact us for quote: sales@admingeekz.com

  5. #5
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    9,072
    Quote Originally Posted by Scott.Mc
    Davethedork is correct in what he stated, that does not run apache as another user when in the virtual host directive.
    Oops, I skipped over his post and just saw the User/Group part and assumed it was for the primary Apache configuration.

    However, he would still have to know what site is creating these nobody files in order to change the User/Group.

  6. #6
    When I goto my httpd.conf and set apache to run as

    user apache
    group apache

    (Used to be nobody,nobody)

    All of my webpages return 403 errors..

    If I login to the server and try to su to user apache I get

    'this account is currently not available'

    But id apache

    returns that the group and user exists..

  7. #7
    Chmod all web directories to public_html to 755 fixed this, but is that what I should have done?

Posting Permissions

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