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
3
votes
3 answers

Apache Vhost Directives Optimized for Pagespeed

I currently use this setup in my vhost: SetOutputFilter DEFLATE BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html SetEnvIfNoCase Request_URI…
Hannes
  • 8,147
  • 4
  • 33
  • 51
3
votes
2 answers

Dokku subdomains all point to a single app

I've got multiple apps hosted on one server using Dokku. I've got vhosts subdomains enabled in Dokku so I want to acess my apps at: app1.mydomain.net app2.mydomain.net ...but when I point my browser…
KemanoThief
  • 617
  • 8
  • 23
3
votes
1 answer

Apache wildcard virtual host in windows (xampp)

I'm trying to create a new virtual host where any subdomain will point to the document root. It needs to be a wild card as new subdomains will be added progmatically. What I have so far in my vhost config (relevant part):
Asa Carter
  • 2,207
  • 5
  • 32
  • 62
3
votes
1 answer

Custom Domains in Chrome

I've got a vhosts file set up for my local machine where I use a made up domain (cascade.mtn) with a bunch of subdomains (rainier.cascade.mtn, hood.cascade.mtn, etc). In every other browser I can hit those domains just fine but in Chrome it just…
ryanstewart
  • 1,004
  • 10
  • 18
3
votes
1 answer

Don't have a2ensite on my ubuntu server

I have an ubuntu server running nginx. I just tried to enable a vhost config and discovered that i don't have the a2ensite command. I searched with find and whereis and it looks like i just don't have it. I realise i could hand-roll my own…
Max Williams
  • 32,435
  • 31
  • 130
  • 197
3
votes
1 answer

Nginx redirect reverse proxy 404

I have the following Nginx server block: server { listen 80; listen [::]:80; server_name example.com; root /usr/share/nginx/html; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header…
Zak
  • 1,910
  • 3
  • 16
  • 31
3
votes
1 answer

PHP Namespace collision with Phalcon, Vagrant, Apache2

I have this strange problem that I can best describe as "namespace leakage". I have setup a vagrant box running Apache2 with VHosts setup to replicate the production server in terms of domains & sub domains. I have edited my local machine's hosts…
Ally
  • 955
  • 1
  • 15
  • 33
3
votes
1 answer

http-vhosts.conf virtual host environment variables not working

I am running Apache 2.2.26 with PHP 5.4.24 on Mac OS X 10.9.4. I have several virtual hosts running on this system, and all of them run successfully. I'm trying to add environment variables to one of the virtual hosts, and I don't want them to be in…
David
  • 446
  • 1
  • 7
  • 18
3
votes
0 answers

Apache: File included inside vhost using Include directive does not evaluate variable defined in the vhost

After doing quite a lot of searching on google and here, I have not been able to find a solution to my problem. I used this article to learn how to create variables inside my vhost. It requires mod_define to be installed. I have a number of…
Pavan Prasad
  • 31
  • 1
  • 3
3
votes
1 answer

vhosts or hosts file issue - going to localhost 'homepage' (using WAMPServer)

I am trying to setup an mobile app that I have received from another dev locally on my machine, this is a cordova based mobile app that is basically html5/javascript etc.. I have added the following line to my .hosts file: 127.0.0.1…
Zabs
  • 13,852
  • 45
  • 173
  • 297
3
votes
2 answers

nginx "try_files" directive is not allowed here

What I want to achieve is pretty simple : If the subdomain starts with admin, try to serve directly from controller admin.php for all other cases, try to serve files with site.php. Note that I don't know domain names as a lot of domains are pointing…
sf_tristanb
  • 8,725
  • 17
  • 74
  • 118
3
votes
3 answers

set up a vhost with vagrant

I'm having troubles with setting a vhost with vagrant. I've configured my host file on my host (192.168.33.10 local.dev). Yet I don't know how to set up my vhost within my VM and how to access it. And I don't want to use puppet or chef or other as I…
Matheus
  • 225
  • 1
  • 4
  • 8
3
votes
1 answer

Can Express run Gulp or Grunt tasks when using vhosts?

I usually start my NodeJS servers with Gulp, with a task similar to: gulp.task('server', function(){ var port = gulp.env.port || 80; plugins.nodemon({ script: 'server.js', ignore: '*', }).on('start',…
elliottregan
  • 1,301
  • 1
  • 13
  • 33
3
votes
3 answers

IP based VirtualHost and Apache

I have this webserver that have an IP address xxx.xxx.xx.x, I also have a website I want to publish, but I do not have any domain for my website yet. So in my httpd-vhosts.conf file I have this setting: ServerName…
Martin at Mennt
  • 5,677
  • 13
  • 61
  • 89
3
votes
1 answer

Grails dynamic baseurl for multi-url webapp

Any one have an idea how to use a dynamic baseurl?? f.e: I have file.war and I want to deploy the same war for www.webapp1.com & www.webapp2.com I tried to use alias for my server.xml host, and I tried to use a separated host in server.xml.. but…
elacheche
  • 71
  • 2
  • 10