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

Apache2 multiple hostnames redirected to one

I'm trying to redirect multiple hostnames to only one, for example, if you enter any of: foo.example.com www.example.com bar.example.com eample.com you must be redirected to www.example.com I have installed a virtual host with www.example.com as…
alcuadrado
  • 233
  • 1
  • 3
  • 6
13
votes
4 answers

How to disable default VirtualHost in apache2?

In apache2 by design, any http request with an unknown Host will be directed to the first loaded VirtualHost. Is there a way to disable this feature? Said differently, I want to have a web server where the user may only get to explicitly named…
Harvey
  • 233
  • 1
  • 2
  • 6
12
votes
5 answers

Virtualhost not working on different port

I'm trying to host my website on single server running centos7.1. I'm able to virtualhost on port 80 but when I change port of second-site to 8080 it points to first-site. However, for URL http://62.210.xx.xx:8080/ its working correctly, pointing to…
Tall boY
  • 221
  • 1
  • 3
  • 13
12
votes
3 answers

How to set apache virtualhost to work with ipv6?

I've got server with 1 ipv4 address and with a few ipv6 addresses. One domain is redirected to ipv4 A record I set up apache ports.conf like this: Listen ip.v4.address:80 NameVirtualHost ip.v4.address:80 and virtualhost file:
sheldy
  • 121
  • 1
  • 1
  • 3
11
votes
2 answers

How to automate zabbix web scenarios for vhosts?

I'm new to Zabbix and enterprise monitoring. I've just finished installing Zabbix 2.4. I'm trying to monitor the state of all our vhosts dislocated on different servers. Until now the only solution I came up with is to manually add a Web scenario to…
SharpEdge
  • 210
  • 2
  • 8
11
votes
4 answers

Need help trouble shooting Https webserver error - SSL Handshake failed

I followed this guide: http://hints.macworld.com/article.php?story=20041129143420344 Here is my virtual host definition SSLEngine on SSLProxyEngine On RequestHeader set Front-End-Https "On" CacheDisable * …
NullVoxPopuli
  • 305
  • 1
  • 4
  • 13
11
votes
5 answers

Apache virtual host based on *source* IP

Is it possible to configure Apache for different virtual hosts based on the source IP? (i.e. same interface, same hostname, but two different virtual hosts, with different content, based on source IP.) The motivation for this is so that my IP…
ithinkihaveacat
  • 1,624
  • 3
  • 14
  • 18
11
votes
3 answers

Separate php.ini file for each Apache virtual host?

Is it possible to have a separate php.ini file that overrides the default php.ini file for each virtual host? I'm running Apache/2.2.14, PHP 5.3.2-1. For example, I have several vhosts pointing to domains in my /var/www/…
Calvin
  • 403
  • 1
  • 4
  • 15
11
votes
1 answer

Apache SSL VirtualHosts on a single IP using UCC/SAN certificate

I need to host several Apache virtual hosts with SSL from a single IP. Now - I understand that because SSL wraps around the HTTP request, there's no way to know which host is being requested until a public key has been sent to the client first. This…
Mikuso
  • 265
  • 1
  • 3
  • 7
10
votes
2 answers

How can I set up Encrypted SNI on my own servers?

I have Web servers that run multiple virtual hosts, and I'd like to keep eavesdroppers from telling which virtual host a client is accessing. There's already a TLS extension for solving this problem: encrypted SNI. I see that Cloudflare supports it…
10
votes
2 answers

_default_ VirtualHost overlap on port 80

I have added 2 virtual hosts to my apache2 conf file as below: DocumentRoot /var/www/html/site1 ServerName www.site1.com ServerAlias site1.com DocumentRoot /var/www/html/site2 …
David
  • 841
  • 3
  • 14
  • 31
10
votes
3 answers

Connection Refused for Apache 2.4 Virtual Host

I have Apache 2.4 running on Mac OS X. apachectl configtest give me: Syntax OK. I have two virtual hosts set up, one called localhost, one called test.dev. DocumentRoot "/Users/psychomachine/Development/_localhost" …
Tench
  • 361
  • 2
  • 3
  • 8
10
votes
4 answers

Webserver randomly serves different vhosts

We've got nginx running on Ubuntu Trusty. It serves several websites over https, running on one ip address. Randomly, although it seems slightly related to work load, sometimes single requests turn up on the wrong vhost. This leads to requests on…
Thom Wiggers
  • 292
  • 1
  • 13
10
votes
3 answers

Apache not finding folder on File System; Appending "\xe2\x80\x9d" to end of File Paths

I have three Virtual Hosts running in apache2 on my personal Macintosh running OS X Mavericks and I have ran into a knot of confusion. They are configured in my httpd-vhosts.conf file as follows: DocumentRoot…
Uncle Nerdicus
  • 123
  • 1
  • 2
  • 6
10
votes
2 answers

Allow access to PhpMyadmin only on a specified virtualhost

I'm working on a multiple virtualhost Environment. I've installed PhpMyadmin for Mysql Remote Control. Environment is configurate as below: one.domain.com two.domain.com onlyphpmyadmin.domain.com Now, if i accesso to one of the three domains…
alesdario
  • 326
  • 1
  • 4
  • 11