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
8
votes
2 answers

Tracking Apache by VirtualHost

I have an apache webserver running many VirtualHosts. Recently it has been bogging down and becoming unresponsive, and I'm wondering how I can determine which VirtualHosts are causing most of the issue. We have had occasions in the past where a bug…
Brent
  • 22,857
  • 19
  • 70
  • 102
8
votes
3 answers

Catch-All HTTPS Vhost on Apache 2.4

Is it possible to configure a catch-all (default) HTTPS Vhost on Apache 2.4? I currently have 4 domains, and an HTTP catch all but as soon as I try to add any sort of configuration my other vhosts break. Here is what my config looks…
Nicolas Bouvrette
  • 211
  • 1
  • 2
  • 9
8
votes
4 answers

Global Apache Alias, ignoring virtual hosts

I have a global entry Alias /.well-known/acme-challenge /var/www/letsencrypt/.well-known/acme-challenge/ in my apache configuration, outside any virtual host. This way, the above Alias is effective for all virtual hosts. Unfortunately, there are…
Joachim Breitner
  • 3,779
  • 3
  • 18
  • 21
8
votes
1 answer

is "ServerAdmin email@domain.tld" required in the VirtualHost in Apache?

I rather not have ServerAdmin in my VirtualHost because all it does is attract spam. has no use what so ever. can it be ignored ?
user235927
  • 83
  • 1
  • 3
8
votes
1 answer

Set up Apache2 to server multiple directories on the same domain based on URL path

I want to host two different sites on the same IP, same server, and same domain using Apache2 on Ubuntu Linux. Let's say I have the following directories which represent sites that will serve content: /srv/www/blog/ #for the…
Ben McCormack
  • 705
  • 4
  • 9
  • 16
8
votes
1 answer

mod_deflate - Optimal configuration for most browsers

I was wondering if someone here could help me determine the optimal standard configuration for using mod deflate with Apache. Basically, mod_deflate recommends using the following configuration for getting started right away: Compress only a few…
Jason Huntley
  • 1,253
  • 3
  • 10
  • 22
8
votes
2 answers

How to check CentOS 6 Server VM Host after a power falure?

This afternoon, someone at our office decided to pull the plug out of our server because it was storming outside. They didn't shut it down, they just pulled the plug out while it was running. The server has 4 SATA drives in a software RAID 10…
Nick
  • 4,503
  • 29
  • 69
  • 97
8
votes
2 answers

Apache: Virtual hosts with multiple locations with multiple document roots: is it possible?

Ok, so here's my problem: I've set up myself a virtualhost with an appropriate server name. I also have, for example, Squirrelmail and SVN installed on the same machine. I want to get to the default page by typing http :// mydomain , get to my mail…
user905747
  • 193
  • 1
  • 2
  • 4
8
votes
1 answer

If directive not working in apache VirtualHost conf, says "Invalid command"

Why?? ServerAdmin admin@mydomain.com DirectoryIndex index.php Redirect / https://www.mydomain.com:443/ ..... Save, and then…
NotGaeL
  • 277
  • 1
  • 3
  • 14
8
votes
4 answers

Using VirtualDocumentRoot *only* if a suitable document root exists

I'd like to set up an environment where Apache virtual hosts can be dynamically created without reloading the configuration. I can do this with mod_vhost_alias, I set up my default virtual host something like this UseCanonicalName…
Paul Dixon
  • 1,516
  • 3
  • 23
  • 37
8
votes
2 answers

Is there a way to access a specific server with the hostname in a round-robin setup?

I have a cluster of Apache webservers using round-robin for primitive load balancing. Is there a way to have firefox or chrome request that server name from a specific IP? If you just enter the http://1.2.3.4 , it doesn't get the ServerName, and if…
Bryan Agee
  • 1,209
  • 2
  • 11
  • 27
7
votes
4 answers

Apache Named VirtualHosts with wildcards

I want to map www.example.com to a specific virtual host and then I want all other subdomains of example.com to go to another virtual host. To do this I created these hosts: ServerName…
Derek Ekins
  • 223
  • 3
  • 8
7
votes
1 answer

Apache mod_proxy: Multiple virtual hosts disable each other

I have an Ubuntu 12.04 server, which had Redmine already installed on a stand-alone apache (everything under /opt/redmine). I wanted to install an instance of Jenkins on the same system, without modifying the existing set-up too much. I want the two…
Max Hohenegger
  • 171
  • 1
  • 1
  • 4
7
votes
2 answers

How to stop HTTPS requests for non-ssl-enabled virtual hosts from going to the first ssl-enabled virtualhost (Apache-SNI)

I hope that title is clear. How do I prevent HTTPS requests for non-ssl-enabled virtual hosts from going to the first ssl-enabled virtualhost (setup is Apache-SNI). For example, using my abbreviated config below, requests for https://example.com (a…
Jeff
  • 1,416
  • 3
  • 28
  • 50
7
votes
1 answer

Warning when adding multiple VirtualHosts on port 443 - "_default_ VirtualHost overlap on port 443, the first has precedence"

I'm running Ubuntu 12.10 and I have the following 4 VirtualHost entries in /etc/apache2/apache2.conf The 4 VirtualHost entries are for 2 separate sites, test.example.com and test2.example.com, one entry each for HTTP and one for HTTPS.
Sparky
  • 213
  • 2
  • 6
  • 12