The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SuPHP ban access to htdocs

Discussion in 'General Discussion' started by someone235, Jul 25, 2014.

  1. someone235

    someone235 Member

    Joined:
    Jul 25, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, I have this line in .htaccess :
    Code:
    RewriteRule ^sites/([^/]+)/sitemap.xml$ /usr/local/apache/htdocs/sitemap.php?slug=$1
    
    But SuPHP prevents me from accessing "/usr/local/apache/htdocs/" from other sites. Someone knows how to solve it?
    Thanks in advance
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,450
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    root owns that directory.

    I'm curious why you'd put a sitemap there. Can you explain a bit?

    Thanks.
     
  3. someone235

    someone235 Member

    Joined:
    Jul 25, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Most of my domains use the same files, so I put all the files I need in htdocs, and then I don't need to update my DNS for every domain that is pointed to my server.
    But I need an alternative way to access the sites without the domains (until the DNS is updated), so I want that the URL /http://myprimarydomain.com/sites/domain.com will point to the same file as /http://domain.com, but the problem is that myprimarydomain.com is not in htdocs, and uses a different user, so it cannot access htdocs files.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    My advice would be to update the "hosts" file on your personal computer if you need a method to access your websites before the name servers are updated. The method you are considering currently is not secure.

    Thank you.
     
  5. someone235

    someone235 Member

    Joined:
    Jul 25, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I cannot make my primary user own htdocs somehow?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    It's not recommended without sacrificing the security of your system. If you did plan to complete this type of setup, you may want to consider using another PHP handler such as DSO.

    Thank you.
     
Loading...

Share This Page