The creation of the Apache virtual directory and the opening of the authentication function
Experimental environment: Service side: centos6.5 IP192.168.10.10
Client: Win7
1.echo "test01" >/var/www/html/index.html//Change homepage to test01
Vim/etc/httpd/conf/httpd.conf
To add a recognizable Web file type
Vim vuser.conf//Custom Create virtual directory
Alias/test "/opt/test"
<directory "/opt/test/" >
Options Indexes multiviews FollowSymLinks
AllowOverride None
AuthName "Hello"
AuthType Basic
Authuserfile/etc/httpd/user
Require Valid-user
</Directory>
echo "This is VDir Test" >/opt/test/index.html//Create page in opt/test/"This is VDir test"
Client Access Service-side ip:http://192.168.10.10/test/
Virtual Directory creation succeeded
2. Turn on the authentication feature
Htpasswd-c/etc/httpd/user Baixiaosheng//Create a virtual user Baixiaosheng and set a password
Vim vuser.conf
Service httpd restart//Restart services
The client accesses the service side again
You need to verify your identity to access the site
The creation of the Apache virtual directory and the opening of the authentication function