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.
2,751
questions
110
votes
5
answers
79k
views
Multiple SSL domains on the same IP address and same port?
This is a Canonical Question about Hosting multiple SSL websites on the same IP.
I was under the impression that each SSL Certificate required it's own unique IP Address/Port combination. But the ...
106
votes
3
answers
450k
views
What is .crt and .key files and how to generate them?
I've the following configuration:
SSLEngine on
SSLCertificateFile /etc/httpd/conf/login.domain.com.crt
SSLCertificateKeyFile /etc/httpd/conf/login.domain.com.key
SSLCipherSuite ALL:-ADH:+HIGH:+MEDIUM:...
72
votes
10
answers
124k
views
Apache Default/Catch-All Virtual Host?
If I have 3 domains, domain1.com, domain2.com, and domain3.com, is it possible to set up a default virtual host to domains not listed? For example, if I would have:
<VirtualHost 192.168.1.2 204....
72
votes
4
answers
294k
views
Redirect URL within Apache VirtualHost?
I have a dedicated server with Apache, on which I've set up some VirtualHosts. I've set up one to handle the www domain as well as the non-www domain.
My VH .conf file for the www:
<VirtualHost *&...
54
votes
2
answers
60k
views
difference between _default_:* and *:* in VirtualHost Context
I want to know the difference between "default:*" and "*:*" in VirtualHost Context.
<VirtualHost _default_:*>
#...
ServerName host.example.com
#...
</VirtualHost>
<...
48
votes
5
answers
93k
views
How can I tell which config file Apache is using?
I'm trying to set up virtual hosts on Mac OS X. I've been modifying httpd.conf and restarting the server, but haven't had any luck in getting it to work. Furthermore, I notice that it's not serving ...
48
votes
2
answers
163k
views
Serve http (port 80) and https (port 443) on same VirtualHost
I need to setup my VirtualHost on Apache to serve on both http and https (using standard ports)
If I enable the SSL Engine (as per below) - I get an error when on port 80.
The reason is, parts of ...
47
votes
6
answers
176k
views
Apache "Client denied by server configuration", despite allowing access to directory (vhost configuration)
in Apache on Ubuntu I've set up a vhost, but in the browser I keep getting a "403 Access forbidden" error; the log says "Client denied by server configuration: /home/remix/".
Looking for the solution ...
45
votes
1
answer
22k
views
nginx name-based virtual hosts on IPv6
I have an nginx server serving up nearly half a dozen different websites. It's running on a Linode that just got IPv6 native support (Dallas data center), and I'm trying to configure most of my sites ...
43
votes
1
answer
90k
views
Declaring multiple ports for the same VirtualHosts
Declare multiple ports for the same VirtualHosts:
SSLStrictSNIVHostCheck off
# Apache setup which will listen for and accept SSL connections on port 443.
Listen 443
# Listen for virtual host requests ...
39
votes
3
answers
88k
views
Wildcard vhosts on Nginx
I've just installed Nginx on my server and am extremely happy with the results, however I still cannot figure out how to insert wildcard virtual hosts.
This is the [directory] structure I'd like:
-- ...
35
votes
3
answers
90k
views
How to set a favicon.ico for a specific Virtual Host on Nginx?
I am using Nginx as my webserver for the first time. I didn't have any trouble to set it up and everything works great. The problem came when the designer asked me if he could send me "the icon in the ...
35
votes
5
answers
62k
views
Nginx disable .htaccess and hidden files but allow .well-known directory
I have a Nginx server, and disabled hidden files in the nginx_vhost.conf
## Disable .htaccess and other hidden files
location ~ /\. {
deny all;
access_log off;
...
32
votes
6
answers
45k
views
Best way to prevent default server?
I have a number of vhosts, and I'd like to "turn off" the default vhost, either by blank page, error page, or generally whatever is the most efficient use of Nginx's resources, whilst only allowing ...
32
votes
4
answers
53k
views
What are the differences between Floating IPs and Virtual IPs?
This might be a pedestrian question but what is the difference between a "Floating IP" address and a "Virtual IP" address? Are they synonyms?
32
votes
10
answers
91k
views
Why might Apache ignore a virtual host with a ServerName matching the requested URL?
I'm trying to add a second virtual host to my apache configuration, but cannot seem to get the new virtual host to be used.
My httpd.conf just contains the following line:
ServerName ...
30
votes
5
answers
97k
views
.htaccess is ignored even though VirtualHost has "AllowOverride All"
I'm running a LAMP server on Fedora 13 that's working fine; however, I just added an ".htaccess" file to my current site's docroot folder that is being completely ignored.
I've tried half a dozen ...
27
votes
5
answers
117k
views
How to find all hostnames in DNS attached to one IP?
If I have multiple hosts configured on one machine (a la apache's VirtualHosts), how can I do a lookup on the IP and find all domains configured to reach it?
For example, I have several web and email ...
27
votes
5
answers
69k
views
Conflict between SNI and HTTP provided domains
I have recently moved a WordPress website with a small store from a hosting provider to a server of my own running Ubuntu Server 12.04.2 LTS and Apache 2.2.22. I require SSL for the store. I set up a ...
27
votes
8
answers
31k
views
How can I see how much bandwidth each Apache Virtual Host is using?
I have Apache set up to serve several Virtual Hosts, and I would like to see how much bandwidth each site uses. I can see how much the entire server uses, but I would like more detailed reports.
...
26
votes
6
answers
70k
views
How can I list the current Apache 2 virtual hosts from the command line?
I want to to retrieve a list of the virtual hosts which are currently loaded and listening for requests i.e not just grepping the config files.
It looks like apache2ctl -S does this but I am not 100% ...
26
votes
7
answers
19k
views
Resolving to virtual host very slow on Mac OS X Lion
Since upgrading to Mac OS X Lion (from Snow Leopard), I have noticed that resolving to a virtual host is very slow (between about 3 seconds). I have found a number of tips (e.g., not using the .local ...
26
votes
1
answer
33k
views
What is the difference between server_name _ and server_name "" in Nginx?
I want to set a default catch-all server block to handle any host names that do not match my exact server_name values. But I'm unsure which one should I use.
server {
listen 80 default_server;
...
25
votes
5
answers
6k
views
A domain I've never heard of resolves to my website [duplicate]
I've discovered (via looking at mod_pagespeed cache entries) that a completely random domain I've never heard of before is resolving to my website.
If I visit this domain, my website loads. The DNS ...
24
votes
4
answers
49k
views
How can I solve the apache2 httpd error "mixing * ports and non-* ports with a NameVirtualHost address is not supported"
Here is the error I get when booting up Apache2:
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Wed ...
23
votes
6
answers
20k
views
Nginx. How do I reject request to unlisted ssl virtual server?
I have a wildcard SSL certificate and several subdomains on the same ip. Now I want my nginx to handle only mentioned server names and drop connection for others so that it'd look like nginx is not ...
22
votes
1
answer
37k
views
How to set up multiple websites / virtual hosts on MAMP? [closed]
How do you configure MAMP to manage/host multiple websites at one time for development?
22
votes
3
answers
24k
views
Turn off error and access logs for one virtual host
If I dont set a error log inside a virtual host it will default to the default error/access log. Is there a way to turn this off for one virtual host?
21
votes
2
answers
45k
views
ServerName wildcards in Apache name-based virtual hosts?
On our LAN I've set up several 'fake' TLDs in the DNS server, with the intention of using them for Apache name-based virtual hosting. I'd like to combine this with mass-virtual-hosting (i.e. ...
21
votes
3
answers
38k
views
"Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile]" error
After recently upgrading Apache2 to version 2.2.31 I found a strange behaviour in SSL VirtualHost setup.
A few of the website I'm hosting were showing the certificate for the default host even if the ...
21
votes
6
answers
17k
views
Redirect to SSL only if browser supports SNI
I have Apache 2.2 with mod_ssl and a bunch of sites in HTTPS on the same IP/port with VirtualHosting, so client must support SNI to connect to those virtual hosts.
I would like to configure my server ...
20
votes
3
answers
184k
views
Configuring SSL With Virtual Hosts under Apache and CentOS
I've got two websites being served from a CentOS instance. One of those has SSL enabled, the other is just served on port 80.
So, http://siteone.com and https://siteone.com both work fine, as does ...
18
votes
10
answers
82k
views
Nginx conflicting server name for subdomain
I currently have a vhost running on Nginx for foo.domain.com and everything works great.
I created a new file for a new sub-domain I want to add called bar.domain.com. I use the same settings for ...
18
votes
4
answers
37k
views
How to create a multi-domain self-signed certificate for Apache2?
I've got a little private webserver where I have several virtualhosts. I know that it's impossible to assign a certificate to each individual virtualhost, because the server finds out which ...
17
votes
8
answers
26k
views
"Catch-All" access log with Apache Virtual Hosts?
I have many virtual hosts set up on a web server, each one having its own error and access log. The relevant lines of httpd.conf are something like this:
ErrorLog /var/log/httpd-error.log
LogFormat "...
16
votes
6
answers
47k
views
Apache - listen only on specific domain, not IP
How can I configure apache so that it refuses connections coming directly to the IP address (http://xxx.xxx.xxx.xxx) instead of the vhost name http://example.com?
My VirtualHost configuration:
...
16
votes
2
answers
40k
views
Multiple SSL vhosts using wildcard certificate in nginx
I have two hostnames sharing the same domain name which I want to serve over HTTPs. I've got a wildcard-SSL certificate and created two vhost configs:
Host A
listen 127.0.0.1:443 ssl;
...
15
votes
2
answers
24k
views
How can I configure VirtualHost without restarting Apache web server?
I have mentioned here apache web server because i am using that one.
15
votes
3
answers
18k
views
Is it possible to set an SSLProtocol in Apache for a single VirtualHost (poodle)?
I'm trying to test a patch for the poodle vulnerability that involves disabling SSLv3 on my web server. In order to test this on a non-production environment first, I'm setting the SSLProtocol on a ...
15
votes
2
answers
23k
views
Should you edit/delete the default apache site config?
I've just followed this tutorial on setting up name-based virtulization in Apache, and it worked really well.
The tutorial basically got you to add a config file to sites-available called yourdomain....
14
votes
5
answers
30k
views
Dynamic nginx domain root path based on hostname?
I am trying to setup my development nginx/PHP server with a basic master/catch-all vhost config so that I can created unlimited ___.framework.loc domains as needed.
server {
listen 80;
...
14
votes
4
answers
37k
views
Can I define HTTP and HTTPS in the same VirtualHost in Apache conf?
I've got quite a big VirtualHost definition which I don't want to duplicate just so the site will also run over HTTPS.
Here's what I want to do:
<VirtualHost *>
ServerName example.com
...
13
votes
4
answers
30k
views
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 ...
13
votes
2
answers
9k
views
How do I "test" name-based virtual hosting?
Our website mysite.com is going to be hosted at a server with virtual hosting (name-based) at 10.20.30.40. However, the DNS records are currently pointing to 66.77.88.99.
I want to keep those DNS ...
13
votes
2
answers
60k
views
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 ...
13
votes
1
answer
53k
views
Location directive not working
For my NGINX server I have a virtual server set up just to dish out static content. At the moment I'm trying to set it up so that images have an expiry date. However, when I create a location ...
13
votes
2
answers
22k
views
Domain redirects to wrong site in nginx, multiple sites in config files
I have 2 websites setup on nginx, and the correct one should load depending on which domain is accessed.
For example:
website1.com
website2.com
However, when accessing either of these domains, they ...
12
votes
3
answers
25k
views
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....
12
votes
5
answers
40k
views
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....
12
votes
3
answers
15k
views
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 ...