Create a Xiangkejin Zhangsan two users
You can see two users created in a file:
Establish a virtual directory and configure user authentication
① creating a virtual directory/xiangkejin
② in the main configuration file httpd.conf file of Apache, add the following statement
Alias/xiangkejin "/xkj"
<directory "/XKJ" >
AuthType Basic
AuthName "This is a private website"
Authuserfile/etc/httpd/password
Require Valid-user
</Directory>
Service httpd Restart Remember to restart
To access the virtual directory in the browser:
Enter the account password that you previously set to access it. ———————————————— This is the next blog post just add a user authentication, in the previous blog, how can not access the virtual directory,
No permissions are displayed. And here it is, strange? I don't know why.
Configuration of the virtual host:
IP address-based virtual host:
Create another network card, now there are two network cards, each assigned an IP address.
First Open the port:
Configuration:
Then enter the address in the browser, an IP address corresponding to a site.
Domain-based virtual hosting:
To access the domain name entered in the browser successfully, set the domain name IP address mapping relationship in the Hosts file.
Linux (12) ___apache Server user authentication, virtual host configuration