简体   繁体   中英

Apache httpd.conf strange behavior and virtual host setup

I want to setup a virtual host and couldn't.

Checking better, I discovered that the server always opens the index page from the root, no matter what it is in the httpd.conf file or even in the httpd-vhosts.conf file.

As a test I deleted everything from the httpd.conf file and saved it as empty file and restarted Apache. It still opens the index.php file from the root. So how does it know the root, if there's nothing in the config file, in the first place..?

I cleared the cache with htcacheclean, but same result.

If I setup a virtual host with root in a subfolder and access it at http://site1.localhost , it doesn't open the index from the site1 subfolder, but again only the one from the root.

More than that, instead of site1 I can type anything, literally, and it wouldn't give error, it will open the same index.php file in the root.

What could be the problem..?

I figured it out. The server was working fine. It was that when I restarted it from shortcut in Programs, after making modifications in httpd.conf and other files, it was not actually restarting, like I believed.

I restarted it from the Services, and then it worked... quite weird behavior.. Anyway, thanks for caring.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM