Get the App
SLTechnology News&Howtos  ›  Servers  › 

Simple knowledge summary of Apache virtual directory

Shulou Source: shulou.com Published: 2022-06-02 01:55:42 09月13日 Update

Virtual directory function of Apache:

It is known that we put the web application in the default hdocs directory of Apache, and Apache will manage it automatically. If we want to put the web application in another directory and Apache can still access it, we need to use the virtual directory function of Apache.

Experimental environment:

One RHEL6.5, one window7 or window10

Experimental procedure

Here, let's first check whether the system comes with httpd. Generally, it comes with RHEL6.5, so we don't need to install it.

Enter the main configuration file to modify

Modify the listening port and domain name of the master configuration file

Start the httpd service and turn off the firewall

Write a statement and put it in the site directory of httpd

Use window7 to open a web page to visit our server IP. Here we can see that the server has provided a web page.

In the conf.d directory, we can create a file that ends with .conf for management.

Write the following statement in this file

Then restart the httpd service, create a test directory under the opt directory and write a statement in this directory

Logging in using window7 here

Here we have implemented logging in without authentication, but in certain situations, sometimes we need to use a password to log in. Here we can do the following.

Enter the file we wrote earlier and turn on the authentication function

Create an identity user and restart the service

Here we need to log in with a password

Enter the password and we go to the previous website.

Tags: Directory file service login function password statement identity server system web page experiment application management configuration authentication no occasion domain name step Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Huawei Microsoft Apple Xiaomi