Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: A VPN and how to secure a webpage question

  1. #11
    Join Date
    Feb 2008
    Beans
    251
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: A VPN and how to secure a webpage question

    OK, try putting a <location> directive in the <VirtualHosts> section for this domain. I would put this in the main configuration file where I have defined all my VirtualHosts. In my case that is: /etc/apache2/apache2.conf

    Something like:

    Code:
    <VirtualHost *:80>
        ServerName your-url.com
        DocumentRoot /var/www/test
        CustomLog /var/log/apache2/access.log common
        <location />            
            Deny from all
            AuthType Basic 
            AuthName "Enter Password"
            AuthUserFile /home/cackles/scrappass
            require valid-user
        </location>
    </VirtualHost>

    let us know how you get on!

  2. #12
    Join Date
    May 2008
    Beans
    122

    Re: A VPN and how to secure a webpage question

    Still loads the page and this time when I refresh I get the forbidden page instead of the password box.

    I dont put my vhosts into the apache.conf, I make individual files and a2ensite them.

    My document root is in the home dir, not the www. Could this be the problem? I changed the example from /var/www/test to its dir in the code.
    Someday something constructive will go here.

  3. #13
    Join Date
    Dec 2008
    Location
    Duluth, GA
    Beans
    135
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: A VPN and how to secure a webpage question

    Are you restarting Apache after making changes to the configuration files? That needs to be done so that the changes you make go into effect.

    You probably know this but I just wanted to post this for the sake of those who don't know.

    Code:
    sudo restart apache2

  4. #14
    Join Date
    Feb 2008
    Beans
    251
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: A VPN and how to secure a webpage question

    @cackles, I'm not sure then... if I get a chance I'll try to replicate your setup on a spare box and test it.

    ps. better practice is to reload apache, rather than restart, to avoid downtime:

    Code:
    sudo service apache2 reload

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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