• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Setup Password Authentication with Apache in Linuxmint 18.03

  • 0:33 systemctl status apache2.service
  • 0:46 htpasswd -c /etc/apache2/.htpasawd agil
  • 1:35 cat /etc/apache2/.htpasawd
  • 1:52 cd /var/www/html/
  • 2:34 /etc/apache2/site-available/test.conf
  • 3:03 a2ensite test.conf
  • 3:13 systemctl restart apache2.service
{{postValue.id}}

Password Authentication with Apache in Linuxmint 18.03

Password Authentication is a restrict from visitors without authentication where we can hide some important and critical information to the un-authenticated users.This article shows how to setup password authentication with Apache in Linuxmint 18.03.

Installation

Assuming that apache is already installed Use the following command to check the status of Apache.

linuxhelp ~ # systemctl status apache2.service 
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Wed 2018-09-19 14:11:52 IST; 3 months 30 days ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/apache2.service
           ├─3535 /usr/sbin/apache2 -k start
           ├─3538 /usr/sbin/apache2 -k start
           └─3539 /usr/sbin/apache2 -k start

Sep 19 14:11:51 linuxhelp systemd[1]: Starting LSB: Apache2 web server...
Sep 19 14:11:51 linuxhelp apache2[3513]:  * Starting Apache httpd web server apache2
Sep 19 14:11:51 linuxhelp apache2[3513]: AH00557: apache2: apr_sockaddr_info_get() failed for linuxhelp
Sep 19 14:11:51 linuxhelp apache2[3513]: AH00558: apache2: Could not reliably determine the server's full
Sep 19 14:11:52 linuxhelp apache2[3513]:  *
Sep 19 14:11:52 linuxhelp systemd[1]: Started LSB: Apache2 web server.
Sep 19 14:12:28 linuxhelp systemd[1]: Started LSB: Apache2 web server.
lines 1-18/18 (END)

Create user and The ' htpasswd' command allows you to create a password file. Here we will creating a hidden file .htpasswd within our /etc/apache2 configuration directory.

linuxhelp ~ # useradd agil
linuxhelp ~ # htpasswd -c /etc/apache2/.htpasawd agil
New password: 
Re-type new password: 
Adding password for user agil

You can view the username and the encrypted password for each user.

linuxhelp ~ # cat /etc/apache2/.htpasawd
agil:$apr1$aSLFUhkf$r9ggEF8Fkcsk7jddCBCUn.

Go to html location create some directory then, give permission and ownership

linuxhelp ~ # cd /var/www/html/
linuxhelp html # mkdir data data1
linuxhelp html # chown -R www-data:www-data *
linuxhelp html # chmod -R 775 *

Configure the virtual host for apache in following location, here create test.conf,

linuxhelp html # vim /etc/apache2/sites-available/test.conf
<virtualhost *:80>
Servername linuxhelp1.com
Documentroot /var/www/
<Directory  /var/www/>
AllowOverride all
AuthType Basic
AuthName " Restricted Content" 
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
</virtualhost>

Enable the site access

linuxhelp html # a2ensite test.conf 
Enabling site test.
To activate the new configuration, you need to run:
  service apache2 reload

Restart the web server to take effect

linuxhelp html # systemctl restart apache2.service

Open a browser and type the following URL http://domainname or ip address 1 2 If the user has not provided correct credentials or if we accidentally click cancel, Unauthorized window will appear 3 4 With this, the method to Setup Password Authentication with Apache in Linuxmint 18.03 comes to an end.

Tags:
jacob
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What to do after creating the environment variables of apache ant?

A

After creating environment variables, you need to run the following command to execute the variables.
# source /etc/profile

Q

What is Apache Web server and how it works?

A

Apache Web Server and its overall working in detail. Apache Web Server is an open source software that creates, deploys and manages the overall functioning of the web server.Apache can serve both dynamic as well as static contents.

Q

What is the most common license used for open source software?

A

The following OSI-approved licenses are popular, widely used, or have strong communities: Apache License 2.0. BSD 3-Clause "New" or "Revised" license. BSD 2-Clause "Simplified" or "FreeBSD" license.

Q

What is meant by Inter-server level devices?

A

These are devices that bypass servers in order to send signals directly from one place to another in an organized fashion, such as how a person is able to download one file from multiple computers at one time.

Q

What is meant by File Servers?

A

They are often responsible for the availability of stored files and their management as well as security. You can send and receive files at the user’s request. These are not like sharing servers; they are more like the filing cabinets of the Internet world.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Ganesh Konka ?
Zentya 6.1 http proxy configuration

please send link for creating zentyal 6.1 for http proxy and firewall as gateway.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.