Questions tagged [virtualhost]

Questions relating to virtual hosting; that is, serving content for multiple logically-separate entities from the same machine. Usually relates to name-based virtual hosting in the web server, but can also cover other protocols such as SMTP or IMAP.

HTTP Virtual Hosting

In HTTP, virtual hosting refers to the serving of content for multiple domains from a single server. The most common form of virtual hosting is properly called "name-based virtual hosting", where the content to be shown is based on the domain name being requested. Less frequently, virtual hosting can be done by using the destination IP address to select which content to show (this is most commonly used when hosting HTTPS websites).

Guides for configuring virtual hosting in a number of common web servers include:

Mail Virtual Hosting

Mail service can also benefit from a form of virtual hosting. In this instance, the receiving SMTP server performs local delivery based on the entireity of the e-mail address (rather than just the local-part), and users login to their POP3/IMAP server using a username that includes their domain (this is usuallythe user's e-mail address) rather than a bare username, and the server looks up the login details and configuration information for the user based on that fully-qualified name. This allows multiple users with the same local-part to use the same server.

Most "integrated" mail services support this feature "by default"; that is, users always use their full e-mail address to login. However, most standalone mail servers do not support this by default and require additional configuration.

Further Reading

2749 questions
30
votes
6 answers

Best way to prevent default server?

I have a number of vhosts, and I'd like to "turn off" the default vhost, either by blank page, error page, or generally whatever is the most efficient use of Nginx's resources, whilst only allowing other vhosts to be access via pre-defined domains.
DanH
  • 827
  • 2
  • 9
  • 26
30
votes
4 answers

.htaccess is ignored even though VirtualHost has "AllowOverride All"

I'm running a LAMP server on Fedora 13 that's working fine; however, I just added an ".htaccess" file to my current site's docroot folder that is being completely ignored. I've tried half a dozen different tests, including this one: RewriteEngine…
Brian Lacy
  • 1,113
  • 4
  • 15
  • 23
27
votes
5 answers

Conflict between SNI and HTTP provided domains

I have recently moved a WordPress website with a small store from a hosting provider to a server of my own running Ubuntu Server 12.04.2 LTS and Apache 2.2.22. I require SSL for the store. I set up a couple of simple vhosts on a new IP for the…
flickerfly
  • 2,753
  • 3
  • 25
  • 27
27
votes
8 answers

How can I see how much bandwidth each Apache Virtual Host is using?

I have Apache set up to serve several Virtual Hosts, and I would like to see how much bandwidth each site uses. I can see how much the entire server uses, but I would like more detailed reports. Most of the things I have found out there are for…
pkaeding
  • 810
  • 2
  • 13
  • 23
27
votes
5 answers

How to find all hostnames in DNS attached to one IP?

If I have multiple hosts configured on one machine (a la apache's VirtualHosts), how can I do a lookup on the IP and find all domains configured to reach it? For example, I have several web and email domains hooked-to my server. How can I find all…
warren
  • 18,369
  • 23
  • 84
  • 135
26
votes
7 answers

Resolving to virtual host very slow on Mac OS X Lion

Since upgrading to Mac OS X Lion (from Snow Leopard), I have noticed that resolving to a virtual host is very slow (between about 3 seconds). I have found a number of tips (e.g., not using the .local TLD) that might resolve this, but they do not…
Bart Jacobs
  • 263
  • 1
  • 3
  • 9
25
votes
1 answer

What is the difference between server_name _ and server_name "" in Nginx?

I want to set a default catch-all server block to handle any host names that do not match my exact server_name values. But I'm unsure which one should I use. server { listen 80 default_server; server_name ""; # this is by default if no…
NARKOZ
  • 998
  • 3
  • 15
  • 23
25
votes
5 answers

A domain I've never heard of resolves to my website

I've discovered (via looking at mod_pagespeed cache entries) that a completely random domain I've never heard of before is resolving to my website. If I visit this domain, my website loads. The DNS for that domain is pointing to my server's…
i-CONICA
  • 648
  • 1
  • 9
  • 22
24
votes
4 answers

How can I solve the apache2 httpd error "mixing * ports and non-* ports with a NameVirtualHost address is not supported"

Here is the error I get when booting up Apache2: * Starting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [Wed Oct 21 16:37:26 2009] [error] VirtualHost *:80 --…
rcampbell
  • 1,035
  • 4
  • 14
  • 24
23
votes
5 answers

How can I list the current Apache 2 virtual hosts from the command line?

I want to to retrieve a list of the virtual hosts which are currently loaded and listening for requests i.e not just grepping the config files. It looks like apache2ctl -S does this but I am not 100% sure if that is just returning what is contained…
codecowboy
  • 1,307
  • 7
  • 18
  • 31
22
votes
6 answers

Nginx. How do I reject request to unlisted ssl virtual server?

I have a wildcard SSL certificate and several subdomains on the same ip. Now I want my nginx to handle only mentioned server names and drop connection for others so that it'd look like nginx is not running for unlisted server names (not responding,…
andbi
  • 343
  • 1
  • 3
  • 9
22
votes
3 answers

Turn off error and access logs for one virtual host

If I dont set a error log inside a virtual host it will default to the default error/access log. Is there a way to turn this off for one virtual host?
John Magnolia
  • 1,723
  • 6
  • 28
  • 46
22
votes
1 answer

How to set up multiple websites / virtual hosts on MAMP?

How do you configure MAMP to manage/host multiple websites at one time for development?
philfreo
  • 987
  • 2
  • 9
  • 22
21
votes
3 answers

"Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile]" error

After recently upgrading Apache2 to version 2.2.31 I found a strange behaviour in SSL VirtualHost setup. A few of the website I'm hosting were showing the certificate for the default host even if the client was Server Name Identification aware, and…
usr-local-ΕΨΗΕΛΩΝ
  • 2,359
  • 7
  • 34
  • 52
21
votes
6 answers

Redirect to SSL only if browser supports SNI

I have Apache 2.2 with mod_ssl and a bunch of sites in HTTPS on the same IP/port with VirtualHosting, so client must support SNI to connect to those virtual hosts. I would like to configure my server the following way: When a user types…
usr-local-ΕΨΗΕΛΩΝ
  • 2,359
  • 7
  • 34
  • 52