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
1
vote
1 answer

Apache: Dynamically set Documentroot inside Virtualhost Section based on reverse-DNS Notation

we want to setup one apache-server via VHosts to do the following: We want to route each of our mutliple domains to their corresponding location based on the domain-name (including subdomains, so the amount of Levels may vary) and their…
Leander Hass
  • 162
  • 2
  • 3
  • 13
1
vote
0 answers

Is it possible to have PHP create an alias in IIS (Internet Information Services)?

Is it possible to have PHP create an alias in IIS (Internet Information Services)? An example of what I'm trying to achieve using Apache would be using PHP to edit httpd-vhosts.conf and append the following line Alias /test.projectOne…
richie
  • 781
  • 2
  • 11
  • 24
1
vote
0 answers

How can i make a subdomain automatically when a user register

Hi i tried everywhere but i cant get the solution. i am using vhost and nodejs to make subdomain in vhost documentation they not provided how to make subdomain dynamically my actual question is how can i make a subdomain with the name of the user…
Tony George
  • 116
  • 14
1
vote
0 answers

how to configure vhost.conf for a subdomain?

I am operating a site created with Laravel. I tried to set up a subdomain and build another Laravel site on same server, and set the directory structure and settings as below, but it is not displayed as intended. I would like to display…
masomi79
  • 11
  • 3
1
vote
1 answer

Why is Apache ignoring :80 vhost file and only matching sites in :443 vhost file?

I have 2 vhost files: 1 with all our sites admin URLS on port 443, 1 with all our sites main URLs on port 80. Both files are known by apache as shown by apachectl -S. net stat shows Apache listening on :80 and :443 I am using host file from my…
Tommy Bailey
  • 113
  • 6
1
vote
1 answer

RewriteRule in htaccess fails, but it could be my host

I read that Self Sabotage is Not asking for help so here I am. So, I have a site...it's working great using WAMP. It's working great on my current host. But I need to switch to a new host and now it's failing. I figured it's a .htaccess issue but…
Lord Dewi
  • 23
  • 6
1
vote
1 answer

Apache 2.4.46 virtual hosts on windows 10

I have a virtual host configure in my httpd-vhosts.conf, and when i enable (uncommented) virtual hosts on httpd.conf and try to access localhost or any link inside local that is not configured in v-host, always show me Forbidden You don't have…
Jair
  • 11
  • 2
1
vote
0 answers

SOLVED Simple config with multiple server blocks, only one works

I try to set 2 url working. The one is : http://X.X.X.X/portainer and the other one http://X.X.X.X/grafana. I have 2 server blocks but only one works correctly. I have 404 not found for the other. Here my nginx conf : /etc/nginx/nginx.conf user…
snooker9
  • 33
  • 8
1
vote
1 answer

Access Forbidden when using xampp with ngrok for accessing a local vhost

I have set up a vhost that is working locally, I would like to access it from other devices using ngork. But I always get this message: "Access forbidden! You don't have permission to access the requested directory. There is either no index document…
Shaadi Alfred
  • 33
  • 1
  • 4
1
vote
0 answers

large PHP _POST not working when I use Apache vhost Proxy

I have this set up on a"gateway" Apache server. it then forwards to a second server (I do not want exposed.) the main "www" server simply hosts a website and forwards subdomains ServerName www.firewall.co.uk DocumentRoot…
Mr Heelis
  • 2,370
  • 4
  • 24
  • 34
1
vote
0 answers

Cannot read property 'addEventListener' of undefined in AWS CHIME

I am trying to run the AWS CHIME demo project locally. it is working fine if I doesn't change the const host ="127.0.0.1:8080" in the server.js file. But when changing the host to local IP to virtualization of host it throws an error after the…
1
vote
0 answers

Docker DNS multiple containers with apache vhosts (wildcard domain)

For the company I work at, I setup a docker environment using docker-composer and multiple containers so we can all benefit from having the same environment. I created a subdomain DNS record (dev.company.com) pointing to 127.0.0.1. This works fine…
WhiteFang
  • 199
  • 1
  • 10
1
vote
2 answers

AliasMatch regex syntax

Can someone point me towards why this AliasMatch regex isn't working (throwing a 404, not server error): AliasMatch (?i)^/scripts/(\w+)/admin/(\w+).js \cms\modules\$1\scripts\admin\$2.js I am trying to match: /scripts/analytics/admin/index.js
Ashley
  • 5,939
  • 9
  • 39
  • 82
1
vote
1 answer

Switching two virtual host (configured with httpd.conf) using .htaccess

I have configured tow virtual host for two domains www.domain1.com and www.domain2.com: ServerName prod.domain.com ServerAlias www.domain1.com DocumentRoot /data/prod/web/ DirectoryIndex index.php
jb23
  • 25
  • 4
1
vote
1 answer

VirtualHosts 404 for hidden files

I'm using a friendly url solution that i achieve with the following lines in VirtualHosts RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ script.php?$1 So i can have url's like…
Marius
  • 3,976
  • 5
  • 37
  • 52