Apache2.4+ configuration virtual host cannot access the directory
吾王。
吾王。 2020-03-02 00:02:08
0
2
1180

I originally wanted to configure a virtual host, but found that the apache version was 2.4. I had never used it before, and I didn’t know how to configure a virtual host. I tried a lot of methods on Baidu to no avail.

After I configured the virtual host, I kept accessing the root directory, which was not the result I wanted.

Website root directory:/var/www/html/

The directory I need to access:/var/www/html/web/tp5/public

Every time When I visit demo1.com, I always go to /var/www/html

and I have set up many methods to no avail!

----------My process is as follows-----

Server version: Apache/2.4.25 (Debian)

In When configuring the virtual host, I modified the configuration of /etc/hosts

127.0.0.1 www.demo1.com

and then opened vhost at the bottom of /etc/apache2/apache2.conf .

Finally, a new xx.conf file was created under /etc/apache2/sites-enabled/, with the following content:

<VirtualHost *:80>
ServerName www .demo1.com

ServerAdmin www.demo1.com

DocumentRoot "/var/www/html/web/tp5/public/"
ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>


# #Then visit and restart the apache2 service and open the

www.demo1.com URL.

Still visit /var/www/html/.


Please help! Thanks!

吾王。
吾王。

reply all(2)
吾王。

21312231kjljkllkj


a is

吾王。

To add, my apache2.4 does not have an httpd.conf file at all!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template