Questions tagged [vhosts]

A virtual host of a HTTP/HTTPS webserver (virtual host in Apache, server block in nginx, ...)

A virtual host of a HTTP/HTTPS webserver (virtual host in Apache, server block in nginx, ...). Use this tag if your question refers to configuration and/or bugs in relation to the virtual host you configured for your application.

The term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.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.

https://httpd.apache.org/docs/2.4/vhosts/

1009 questions
207
votes
8 answers

How to redirect to a different domain using Nginx?

How can I redirect mydomain.example and any subdomain *.mydomain.example to www.adifferentdomain.example using Nginx?
deb
  • 12,326
  • 21
  • 67
  • 86
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
82
votes
2 answers

nginx - set multiple server_name with ssl-support

I'd love to use nginx to serve a website with multiple domain names and SSL: webmail.example.com webmail.beispiel.de Both use the same vhost so I only set the server_name twice. Problem is, that I need nginx to serve the correct ssl certificate…
PascalTurbo
  • 2,189
  • 3
  • 24
  • 41
53
votes
9 answers

Apache giving 403 forbidden errors

Ok, so i've previously set up two virtual hosts and they are working cool. they both house simple web projects and work fine with http://project1 and http://project2 in the browser. Anyway, I've come to add another vhost. I edited the /etc/hosts…
user2672288
46
votes
3 answers

How should I organize multiple Express servers on the same system?

I'm using one server to host multiple Node.js web apps, which are distributed across multiple domains. My current practice is to run an Express server for each app on a different port, and to run a base server that simply routes (redirects) requests…
Aaron
  • 2,049
  • 4
  • 28
  • 35
38
votes
3 answers

Hosting multiple local sites with XAMPP

I'm new to using XAMPP so this may be simple to some people. I have a few php projects that I would like to be able to debug locally and view in the browser (not concurrently, but without having to change config files/copy project folders each time…
Greg
  • 21,235
  • 17
  • 84
  • 107
29
votes
2 answers

How do you comment out a block of text in the vhosts file?

How do you comment out a block of text in the vhosts file? Do I have to put pound/hash symbols (#) in front of EVERY line?
EMuentes
  • 562
  • 1
  • 8
  • 18
27
votes
1 answer

Apache Multiple Sub Domains With One IP Address

This has probably been asked but I can't find a straight answer, or the ones I found don't work. I have one domain mydomain.com, resolving to an IP; let's call it 8.8.8.8. The DNS settings also point two subdomains to that IP address with an A…
Jongosi
  • 2,305
  • 1
  • 28
  • 31
21
votes
3 answers

Virtual Hosts XAMPP [Linux Ubuntu] not working

I tried to create a virtual host magento.developers.com in Ubuntu 12.04 using XAMPP. First I have edited the /opt/lampp/etc/extra/httpd-vhosts.conf and added the following lines: ServerAdmin webmaster@magento.developers.com …
Ahmed Jolani
  • 2,872
  • 2
  • 20
  • 24
18
votes
1 answer

Same server, both SSL and non-SSL

Is it possible to have both SSL protocol and non-SSL protocol running on the same server in Apache 2.x? So if I access http://example.com (non-SSL) and https://example.com (SSL) they would both be available. If so, would I need to create a virtual…
Eduard Luca
  • 6,514
  • 16
  • 85
  • 137
16
votes
4 answers

How to use vhosts alongside node-http-proxy?

I'm running Nodejs and Apache alongside each other. node-http-proxy is listening on port 80 and then forwarding requests to either Apache(:9000) or to Express(:8000). My virtual hosts on Apache look like: DocumentRoot…
gxc
  • 4,946
  • 6
  • 37
  • 55
16
votes
1 answer

Move .htaccess content into vhost, for performance

I was wondering if performance can be increased if I move .htaccess file content into a vhost file of apache2? This is the content of my .htaccess Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteCond…
DavidW
  • 5,069
  • 14
  • 46
  • 68
16
votes
1 answer

proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy

I have added ProxyPass in the virtual-host and end up with below error in the error.log file. proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the…
Techie
  • 44,706
  • 42
  • 157
  • 243
16
votes
3 answers

Sharing one port among multiple node.js HTTP processes

I have a root server running with several node.js projects on it. They are supposed to run separately in their own processes and directories. Consider this file structure: /home +-- /node +-- /someProject | www.some-project.com | +--…
buschtoens
  • 8,091
  • 9
  • 42
  • 60
15
votes
1 answer

a2ensite 'Site: ___ does not exist' error, even with .conf file

System: Ubuntu 14.04 LAMP running on Parallels VM set up with Vagrant I'm writing my first non-trivial shell script to add new web projects to a dev VM on my Mac laptop. Create a default folder structure in /var/www/ Add a .conf vhost file to…
jslanger
  • 433
  • 1
  • 4
  • 8
1
2 3
67 68