Questions tagged [virtual-hosts]

Virtual hosts or virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers).

Virtual hosts or virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers).

This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name. The term virtual hosting is usually used in reference to web servers but the principles carry over to other internet services.

One widely used application is shared web hosting.

There are two main types of virtual hosting, name based and IP based. Name based and IP based virtual hosting can be combined, a server may have multiple IP address and serve multiple names on some or all of those IP addresses. This technique can be useful when using SSL/TLS with wildcard certificates.

245 questions
302
votes
20 answers

Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local, site2.local etc, and have them all resolve…
EvilPuppetMaster
  • 7,052
  • 9
  • 31
  • 30
21
votes
5 answers

Disable directory listing on apache; but access to individual files should be allowed

I do not want to use .htaccess. How should I change my Directory attributes? ServerName abc.com DocumentRoot /usr/share/uploads Order allow,deny Allow from all …
Deepak Singhal
  • 9,577
  • 10
  • 50
  • 92
20
votes
7 answers

apache on windows virtual directory config help

I'm running Apache on Windows XP via Xampplite, and could use help configuring my virtual directory. Here's what I'm hoping to do on my dev box: I want my source files to live outside of the xampp htdocs dir on my local machine I can access the…
sprugman
  • 17,781
  • 31
  • 105
  • 160
19
votes
2 answers

Different VirtualHosts with the same port

I need to have two VirtualHosts with the same listen port for different projects and with different logs. Here's what I've got: DocumentRoot /home/projects/smk ErrorLog /var/log/apache2/smk-error.log …
ZiTAL
  • 2,989
  • 6
  • 32
  • 48
18
votes
3 answers

phpinfo() difference between master and local value

I have a clean install of a CentOs with php 5.2.13. In php.ini that is loaded and present in the header of phpinfo() I have safe_mode=off in the phpinfo() information I have // local value - safe_mode: On // master value - safe_mode: off the php…
Elzo Valugi
  • 24,234
  • 13
  • 88
  • 112
11
votes
2 answers

$_SERVER['HTTP_HOST'] contains port number too =/

I don't know maybe it's a bug. I have 2 virutalhosts on my server. virtualhost1.com virtualhost2.com if i open virtualhost1.com with port 80 (virtualhost1.com:80) $_SERVER['HTTP_HOST']='virtualhost1.com'; but if i open…
dynamic
  • 44,025
  • 53
  • 143
  • 223
10
votes
2 answers

Apache and ultimate config for nginx to serve all virtual hosts in the right way

I've just set up nginx to serve static request on one site, but I have lots of sites on my server and I wonder, should I right new nginx server configuration for all of them? What I'm doing now. I have file with all virtual hosts entries for Apache…
Dmitry Dushkin
  • 2,271
  • 4
  • 22
  • 36
10
votes
5 answers

Tomcat: Change the Virtual hosts programmatically?

Tomcat offers a build in "Virtual Hosting" Support: An Engine/Web-Application can be configured to be responsible for a list of Domains. These Domains have to be put into the server.xml/context.xml files with a special xml directive. => Is there any…
jan
  • 489
  • 1
  • 6
  • 11
9
votes
2 answers

Apache multiple domains setup

I've got a pretty straightforward issue with a linux based Apache 2.2 server I am setting up. I want to setup two totally different domains on the same server. But it only serves content from the first tag! I've searched StackOverflow and read…
Thread7
  • 1,015
  • 2
  • 12
  • 27
8
votes
4 answers

How do I create a VirtualHost on Zend Server?

I am using zend server and I added one VirtualHost into the extra/httpd-vhosts.conf file and removed # from the httpd.conf file. This is what I added into the extra/httpd-vhosts.conf file: NameVirtualHost *:80 ServerName…
Manjeet Patel
  • 183
  • 1
  • 3
  • 13
8
votes
6 answers

How can I setup different SSL-Certificates for vhosts on Apache?

I have a web-server, that serves different domain-names, but has only one IP-address assigned. That works fine with virtual hosts in Apache. Now I want SSL-encrypted connections for the websites. How can I set different SSL-certificates for the…
Mnementh
  • 47,129
  • 42
  • 140
  • 198
8
votes
1 answer

Apache Virtual Host is not working right

Somehow my Virtual host files are not working straight I can't tell why - I bet it's just a mailfunction in my good-morning brain :p Right now I got TWO sites enabled via a symbolic link to sites available in /etc/apache2/ directory like : 0 Nov 21…
Kris
  • 547
  • 3
  • 8
  • 24
7
votes
7 answers

Wamp Server: Multiple Virtual Hosts are not working on Windows

I have two virtual hosts on windows(for example: test1.dev and test2.dev). But it always load content of test1.dev for both virtual hosts. Following are my files: hosts: 127.0.0.1 localhost 127.0.0.1 test1.dev 127.0.0.1 …
Awan
  • 15,908
  • 33
  • 86
  • 126
7
votes
2 answers

Apache HTTPS reverse proxy with SNI without key on the proxy

example1.com and example2.com resolve to host0. host0 runs an Apache reverse proxy with two VirtualHosts. It delegates requests for example1.com to host1 and for example2.com to host2. Using http in all places, that clearly can be made to…
Johannes Ernst
  • 2,672
  • 2
  • 32
  • 50
6
votes
4 answers

Virtual Hosts - all redirect to the WAMP localhost 'home' page

I've setup the latest version of WAMP on my Windows 8 PC - I cannot seem to get multiple virtual hosts to work, every local URL I load will show the WAMP homepage. Can anyone explain what I am doing wrong? // My hosts file 127.0.0.1 localhost …
Zabs
  • 12,494
  • 42
  • 150
  • 262
1
2 3
16 17