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
8
votes
2 answers

Removal of the /var/www/icons alias from Apache config

I have a directory called /var/www/icons on my web server, which is also referenced as an alias in my Apache config as seen below: Alias /icons/ "/var/www/icons/" The directory contains a number of small PNGs and GIFs, which AFAIK are unused, along…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
7
votes
1 answer

AliasMatch and RegEx

I'm working with a centralized CMS on a dev server, the CMS is in /var/www/central-cms The site (I've many sites) is accessible by this url: http://web.localdomain.dev/site1/. How can I access the cms simply typing this url:…
Massimiliano Marini
  • 499
  • 1
  • 6
  • 16
7
votes
1 answer

Apache loads mod_ssl but ignored in my vhosts

I'm trying to secure my server's vhosts. I installed LE/Certbot fine, and had no issues. I installed/upgraded any dependencies to get certbot to work, again they ran fine. mod_ssl is installed and loaded. I ran phpinfo(), and in the LoadedModules…
Kingsley
  • 977
  • 2
  • 11
  • 27
7
votes
1 answer

Getting VHosts working with EasyPHP

So I've been trying to setup vhosts on my new Windows 10 Installation with EasyPHP Devserver 16.1. I've modified etc/vhosts to include my new domain (mysite.local), which works, but still points to the default easyphp directory. So I modified…
Chris
  • 282
  • 5
  • 19
7
votes
2 answers

Laravel Homestead vhost configuration

I am using Laravel homestead. For a project I need a special vhost configuration, where should I define this?
Alexander Cogneau
  • 1,286
  • 4
  • 12
  • 25
7
votes
2 answers

How to prevent PHP sessions being shared between different apache vhosts?

How to prevent PHP sessions from being shared between different Apache vhosts? I've set up different vhosts on an Apache 2.2 and everything works perfectly, until I realized that the PHP sessions are shared by default.
Sliq
  • 15,937
  • 27
  • 110
  • 143
7
votes
1 answer

Redirect Addresses to localhost by Pattern on Mac OS X

I'm not even 100% sure how to ask this question. The answer might be out there, but I can't find it. So I've set up virtual hosts for my Mac and I do all my development locally on my computer. I have a vhost folder in my Sites folder, and I have a…
CWSpear
  • 3,230
  • 1
  • 28
  • 34
6
votes
4 answers

.htaccess for site in sub-directory using Yii framework

I have looked at several examples of htaccess configs for websites within sub-directories, and tried most of them without 100% success. My setup is: using Yii framework htaccess at public_html/.htaccess site located inside public_html/mysite…
guivalerio
  • 81
  • 1
  • 6
6
votes
1 answer

Hostname-independent Yesod application

This is a very simple question: How do I run a Yesod application that can handle multiple hosts at the same time? A default Yesod setup can handle incoming connections from any host, but all URLs are rendered with approot prepended to them.…
dflemstr
  • 25,947
  • 5
  • 70
  • 105
6
votes
1 answer

Express won't serve static ejs files in vhosts

The closest I've been able to get is it will have the client download them. It will download the correct ejs files. It's driving me crazy because I feel like it should work but it will not. If I put html files in there they serve just fine. It's a…
Z2VvZ3Vp
  • 7,033
  • 6
  • 21
  • 35
6
votes
1 answer

CORS header not being served by Apache if there's a 404

I added the following to a vhost config in MAMP PRO: Header set Access-Control-Allow-Origin "*" (this is the only thing in the 'Additional parameters for ' box) Which works great, if I inspect the headers from simply loading an image from the…
John Hunt
  • 4,265
  • 8
  • 45
  • 59
6
votes
3 answers

Debugging why I get "You don't have permission to access" in Apache 2.4

I am trying to create a local environment in Linux/Ubuntu. I have install Apache 2.4.7 (using apt-get). I have changed my /etc/hosts to this: 127.0.0.1 example.dev 127.0.0.1 localhost ... I also added a file "example.dev.conf" to…
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
6
votes
2 answers

Grunt server does not use virtual host name for my app..vhost and httpd are set up but grunt is not using them

So I am trying to setup my app with a name rather than using 127 0 0 1. Every single time I run grunt, my address is http://127.0.0.1:9000/#/ ... I've tried many things and nothing is working...I always get redirected to that place. Here are my…
Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96
6
votes
1 answer

Apache 500 Internal Server Error on my virtual host

I have my web app projects located in a folder in /media/disk1/Projects. I want to serve them using an Apache virtualhost at http://lab/. This is how I set up my virtual host: 1. Copied /etc/apache2/sites-available/default to…
Timothy
  • 4,198
  • 6
  • 49
  • 59
5
votes
1 answer

xampp - mysite.local redirects to xampp folder

I've been battering my head against this all evening and can't see where I'm going wrong. I want to set a host, mysite.local, on xampp and have followed all the instructions, but I keep getting redirected to mysite.local/xampp. Any ideas where I'm…
bsod99
  • 1,287
  • 6
  • 16
  • 32
1 2
3
67 68