logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: apache config vhost ?
Author
yeniugo



Joined: 31 Mar 2018
Posts: 1
Location: china

PostPosted: Sat 31 Mar '18 17:17    Post subject: apache config vhost ? Reply with quote

Code:
<VirtualHost _default_:443>
DocumentRoot "/var/www/a"
ServerName a.example.com
</VirtualHost>
<VirtualHost _default_:443>
DocumentRoot "/var/www/b"
ServerName b.example.com
</VirtualHost>

but if their have other domains point to this vps,it always point to the site same as a.example.com,and what can i do?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3053
Location: Hilversum, NL, EU

PostPosted: Sun 01 Apr '18 11:24    Post subject: Reply with quote

The first vhost is used for all requests received on that address and port for which no other vhost has a matching ServerName or ServerAlias.

Also read: https://httpd.apache.org/docs/2.4/vhosts/examples.html#default
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Tue 03 Apr '18 9:39    Post subject: Reply with quote

The issue is "_default_"

you can have only one of it Wink
Back to top


Reply to topic   Topic: apache config vhost ? View previous topic :: View next topic
Post new topic   Forum Index -> Apache