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.

Password protect (http auth) all domains on server

Discussion in 'General Discussion' started by rpilb, Mar 12, 2016.

  1. rpilb

    rpilb Registered

    Joined:
    Mar 12, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Root Administrator
    Hi

    How can I password protect all domains/sites on a server with http auth?

    I added the following into httpd.conf but pressing cancel on the auth popup will show the page contents without any assets loading.

    <Directory "*">
    AuthType Basic
    AuthName "Restricted Content"
    AuthUserFile /.htpasswd
    Require valid-user
    </Directory>
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    What method are you using to make changes to the Apache configuration? It's important to use the instructions at:

    Advanced Apache Configuration - EasyApache - cPanel Documentation

    Also, I believe the directory has to be specific, as opposed to entering a wildcard character. How many accounts do you need to protect?

    Thank you.
     
  3. rpilb

    rpilb Registered

    Joined:
    Mar 12, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    London
    cPanel Access Level:
    Root Administrator
    I edited the httpd.conf directly just to test it but reverted it back after - I did see the message about it being overwritten and making sure to run the distiller.

    Is there alternative to using a wildcard? The server is essentially a testing server - it needs to be locked off from Google to stop client websites being indexed, but access from any IPs so we can't lock it down that way. They're all setup on a subdomain i.e. website1.testingserver.com

    We can modify each account but it's quite tedious as there's 100+ on there at the moment.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    If the goal is to prevent Google or other search engines from indexing the websites, then you could setup rules to prevent that. There's a third-party thread on this at:

    Stop Google from indexing

    Thank you.
     
Loading...

Share This Page