Questions tagged [virtualhost]

The term Virtual Host refers to the practice of running more than one web site (such as www.company1.com and www.company2.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

The term Virtual Host refers to the practice of running more than one web site (such as www.company1.com and www.company2.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

Apache was one of the first servers to support IP-based virtual hosts right out of the box. Versions 1.1 and later of Apache support both IP-based and name-based virtual hosts (vhosts). The latter variant of virtual hosts is sometimes also called host-based or non-IP virtual hosts.

3113 questions
314
votes
11 answers

Site does not exist error for a2ensite

I have cmsplus.dev under /etc/apache2/sites-available with the following code, ServerAdmin master@server.com ServerName www.cmsplus.dev ServerAlias cmsplus.dev DocumentRoot /var/www/cmsplus.dev/public …
Anshad Vattapoyil
  • 23,145
  • 18
  • 84
  • 132
248
votes
3 answers

nginx missing sites-available directory

I installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can't seem to find the /etc/nginx/sites-available directory. Is there something I need to do in order to create it? I know Nginx is up and…
Fr0ntSight
  • 2,696
  • 3
  • 17
  • 14
174
votes
9 answers

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

I've got a XAMPP installation running on Windows 7. As soon as I add a VirtualHost to httpd-vhosts.conf, BOTH the 'regular' http://localhost AND the new dropbox.local aren't working. This is what I added to my httpd-vhosts.conf:
Highmastdon
  • 6,960
  • 7
  • 40
  • 68
151
votes
8 answers

How to debug an apache virtual host configuration?

Once again, I have a problem with my apache virtual host configuration. (The default configuration is used instead of my specific one). The problem is not really the misconfiguration but how to solve it. Does anyone has good advices to do resolve…
GaetanZ
  • 2,819
  • 3
  • 21
  • 20
131
votes
12 answers

Apache VirtualHost 403 Forbidden

I recently tried to set a test server up with Apache. The site must run under domain www.mytest.com. I always get a 403 Forbidden error. I am on Ubuntu 10.10 server edition. The doc root is under dir /var/www. The following are my settings: Content…
Yuchen Wang
  • 1,682
  • 2
  • 14
  • 16
126
votes
9 answers

Create subdomains on the fly with .htaccess (PHP)

I am looking to create a system which on signup will create a subdomain on my website for the users account area. e.g. johndoe.website.example I think it would be something to do with the .htaccess file and possibly redirecting to another location…
Ben McRae
  • 3,551
  • 13
  • 36
  • 31
124
votes
11 answers

error_log per Virtual Host?

On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts with separate log files. We cannot seem to separate the php error_log between virtual hosts. Overriding this setting in the of the httpd.conf does not seem to do…
Michael Stum
  • 177,530
  • 117
  • 400
  • 535
110
votes
14 answers

How can I eliminate slow resolving/loading of localhost/virtualhost (a 2-3 second lag) on Mac OS X Lion?

Since setting up my development environments on Mac OS X Lion (brand new macbook air purchased in January 2012), I have noticed that resolving to a virtual host is very slow (around 3 seconds) the first time but after that is fast as long as I…
Adam Gries
  • 1,751
  • 3
  • 14
  • 12
99
votes
16 answers

how to create virtual host on XAMPP

I am sure this question is being asked many times but I am not encounter with a problem. I am using XAMPP where I configure Zend framework. XAMPP is running on port 8081 as 80 is being occupied by some Windows process I need to use virtual host for…
Paras Arora
  • 1,171
  • 2
  • 8
  • 16
85
votes
3 answers

Virtualhost For Wildcard Subdomain and Static Subdomain

I have an odd situation where I want to have the URLs app1.example.com, example.com and *.example.com all using a different virtual host. This is what I have (excluding example.com because it just makes it messier). ServerName…
Dave
  • 1,658
  • 3
  • 17
  • 19
81
votes
3 answers

Nginx TCP forwarding based on hostname

With the release of TCP load balancing for the Nginx community version, I would like to mix OpenVPN and SSL pass-through data. The only way for Nginx to know how to route the traffic is via their domain name. vpn1.app.com ─┬─► nginx at 10.0.0.1…
James Wong
  • 4,529
  • 4
  • 48
  • 65
80
votes
12 answers

Apache VirtualHost and localhost

I'm working with XAMPP on Mac OS X. I'm trying to run a Symfony website properly for a client, and I really don't know Symfony (yet). I just want to install and launch it. I've changed my /etc/hosts file this way: 127.0.0.1 www.mysite.local And the…
Angelica Rosa
  • 1,215
  • 1
  • 11
  • 15
66
votes
6 answers

Access to Laravel 5 app locally from an external device

I've looked for a solution in the web, but I've not found a solution yet. I need to access to my Laravel 5 app from my iPhone, but I'm in develop, so I don't want to publish my app on a web server. If you have a link to follow, that you assure it…
Bellots
  • 1,703
  • 3
  • 19
  • 29
65
votes
6 answers

Apache: Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

When configure apache2 virtual hosts for ssl/https connection, after adding configuration and enable the configuration with this command " a2ensite pm.university.com.conf " i got this error "Invalid command 'SSLEngine', perhaps misspelled or defined…
Dung
  • 19,199
  • 9
  • 59
  • 54
64
votes
6 answers

Do I have to duplicate the Virtualhost directives for port 80 and 443?

I have a long and intricate list of directives, and I have to duplicate them into separate groups for ports 80 and 443 because I'm using SSL. Whenever I update my mod_rewrite rules I have to remember to do it in both…
scotts
  • 4,027
  • 3
  • 29
  • 26
1
2 3
99 100