Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello, Melissa! Thank you for your tutorial, it’s very useful! I noticed that there’re steps 3 and 5 and no step 4, is it a misprint?
Hey,
I have followed steps, tried both approaches without any success. The window just never pops up. I am using default LAMP stack on Ubuntu 16.04 to host a Laravel application.
Any suggestions? Common errors?
Hi thx for this excellent tutorial. But I have a issue since I did the changes and added the .htaccess file. I Don not have access to my in LAN address (192.168…) but works awesome with my example.com. is this normal? How can I fix this?
THanks
Jeff
Hi,
I followed your step to configure the virtual host, and I used ServerName in the default virtual host, and I found someone accessed my protected page without password authentication. I found the problem is that if the Host name does not match the virtual host, the password protection will not be in effect (Someone access directly with IP address instead of domain name). Since this tutorial confused me, I think you probably consider pointing out the possible security problem.
Thank you!
Anyone knows why it shows the authentication on the site homepage? How i can fix this?
Thank you for the great tutorial. I have just 1 Problem. When I set up the password authentication like in the Tutorial, it doesn’t work for https. So what I did is, I added a new VirtualHost to the 000-default.conf File, created an SSL certificate and basically added the same content as in the VirtualHost for http. However, I can still connect to this Directory without password authentication. Do I have to add the VirtualHost to another file? Or is there something else I have to do? (I used option 1)
Hi, I had setup SSL through LetsEncrypt prior to this, (following the official guide!). That made another .conf file for SSL which is really the one calling the shots now, since I said Yes to the ssl installation wizard’s offering to force all incoming http:// connections to https:// . So, following the instructions given here (I’ll stick to the preferred Option 1 only) didn’t have any effect because nobody’s seeing the http: thing here now!
Instead, I edited : sudo nano /etc/apache2/sites-available/000-default-le-ssl.conf which had been auto-created by the LetsEncrypt SSL setup process, and putting :
<Directory "/var/www/html">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
… at the end, before </VirtualHost> closing tag, did the job for me. Note that once you’re in, the server remembers you. (how do we set a timed forget?) So to test this out properly, visit from an incognito window, close it and start another incognito next time. Also, the “users” you create in the paswd file aren’t the same as the users you’ve created on your server system.
Now, I still have a question : I have web apps running on port numbers, redirected to /folder/ paths using this Virtualhost config as per this official tutorial:
ProxyPreserveHost On
ProxyPass /openrefine/ http://127.0.0.1:3333/
ProxyPassReverse /openrefine/ http://127.0.0.1:3333/
And that’s what I want to password-protect! How do I password-protect something that’s not a Directory but a reverse proxy?
EDIT Figured it out! https://stackoverflow.com/a/7759655/4355695
Replace <Directory> with <Location>:
<Location "/openrefine/">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Location>