How to set http based authentication on a website ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to set http based authentication on a website ?

there should a authentication before the website opens .

8th Jan 2021, 1:26 AM
raunak j
raunak j - avatar
4 Answers
+ 1
How you configure HTTP authentication depends on what HTTP server you're using and what operating system it is installed on. If that combination is Apache HTTP Server on Ubuntu, this article should be great: https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-16-04 Digital Ocean's articles generally worked well for me but I didn't test that specific one. More related information is on the Apache HTTP Server website: https://httpd.apache.org/docs/2.4/howto/auth.html If you have a different server or operating system, try to Google "<server name> <operating system name> HTTP authentication" and if that doesn't work, be specific about that here.
8th Jan 2021, 7:56 AM
Josh Greig
Josh Greig - avatar
0
Josh Greig can't it be done without making a server
8th Jan 2021, 7:58 AM
raunak j
raunak j - avatar
0
Josh Greig directly from html we can create a authentication right ??
8th Jan 2021, 7:58 AM
raunak j
raunak j - avatar
0
No, you can't do HTTP authentication without an HTTP server. Without an HTTP server, there is no HTTP. HTTP is a communication protocol that works between an HTTP client(usually your web browser) and an HTTP server(like Apache HTTP Server, IIS, Apache Tomcat...). An HTML file sitting in a folder on your file system can be opened by a web browser but the browser is reading your HTML directly from the file system and without using HTTP. Obviously, if you're not using HTTP, you can't use HTTP authentication. This doesn't mean you need to pay for hosting to test things out. You can install and run an HTTP server on your computer for free. WAMP, XAMPP are great software packages for getting a locally run server up.
8th Jan 2021, 6:06 PM
Josh Greig
Josh Greig - avatar