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

Configure both vhosts on Apache use fastcgi

Having Ubuntu on virtual machine. Running Apache and need 2 virtual hosts on different ports, e.g. 69 and 100. (On 80 running nginx with php-fpm + fastcgi). Using port forwarding to host system to access from browser like localhost:69/ or…
Jokerius
  • 1,310
  • 1
  • 14
  • 22
3
votes
1 answer

How can I force 'www' subdomain w/ Apache2 + Rails + Phusion Passenger?

My clients want to use 301 redirects to force the 'www' subdomain on their sites. So 'example.com/something' resolves to 'www.example.com/somthing' etc. What I'm trying to do is simply add this to my vhost file: ServerAdmin…
Jim Jeffers
  • 17,572
  • 4
  • 41
  • 49
3
votes
2 answers

One Magento installation with two websites, on separate vhosts

I have a client that maintains two different websites, each of which is set up as a separate virtual host in Apache. I installed and configured a Magento store within one host at domain1.com/store. They client now wants a store set up at…
user2066349
  • 2,439
  • 1
  • 15
  • 8
3
votes
4 answers

Parse Apache VHosts to get list of Domains and Folder Paths

Given a path X or a copy of the apache vhosts configuration file, how would I parse that file using PHP? E.g. Given a variable containing a string that has the contents of an Apache vhosts configuration, how would I get a list of hosted…
Tom J Nowell
  • 9,588
  • 17
  • 63
  • 91
3
votes
1 answer

Node.js on multiple domains using express.vhosts()

I'm back here with a nodejs problem, I am writing a node server that allows two or more app.js running on the same system using express.vhost(). But I'm quite lost now. The webhost server is a dedicated server running Ubuntu and plesk and I've…
Ivan Bravo Carlos
  • 1,650
  • 3
  • 15
  • 22
3
votes
2 answers

How to setup subdomain/domain with and without www prefix on localhost

I went through lots of SO questions but non is giving me the right answer . I have following config in apache vhost: DocumentRoot "D:/Web Server/xampp/htdocs/testsite/frontend/www" ServerName mydomain.com ServerAlias…
sakhunzai
  • 13,900
  • 23
  • 98
  • 159
3
votes
1 answer

file-exists check for php's auto_prepend_file

I currently have the situation that in my vhost.conf i have an entry to automatically include a file to start profiling: php_value auto_prepend_file /home/xhprof/include/xhprof.php This thing is in SVN and might be checked out by people who don't…
Max
  • 180
  • 4
  • 13
2
votes
1 answer

Redmine - one project one vhost

I use redmine 1.2.2 Let's say I own project1.net and project2.net pointing on the same physical server. I already have bugs.project1.net pointing on my redmine installation's home. Here is my current config for bugs.project1.net
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
2
votes
1 answer

Websocket with Play! Framework is failing with vhosts

I am unable to create a websocket with vhots enabled through apache2 on my local machine. In FF: WebSocket is not defined var socket = new WebSocket('ws://test.localhost.in/soc') Chrome gives a 404 Error. Routes file has been defined properly. WS …
Sameer Segal
  • 21,813
  • 7
  • 42
  • 56
2
votes
0 answers

Apache VHost not working but seems to be configured correctly: Mac Os Ventura

The Problem I've been trying to setup apache on my mac. I installed apache using brew and everything seems to work except when I actually try to navigate the url with my browser. Anytime I navigate to http://parenting.localhost/ I just get a 404…
Josh Team
  • 21
  • 2
2
votes
1 answer

Using PHP 8.1 on Mac OS 10.13 with Vhost

Trying to use PHP 8.1 on localhost with Mac OS High Sierra (10.13.6). Note that I also want to keep PHP 7.4, because I still need it for older projects. It doesn't work and error logs shows nothing. What I did so far Installed PHP 8.1 using brew…
Simon Mo
  • 503
  • 2
  • 4
  • 14
2
votes
1 answer

Apache If condition - HTTP Header Param

I have a question about an condition into vhost rules. I need to add and IncludeOptional redirects files only if a specific param into the header is present. I think that I can do something like:
2
votes
0 answers

Allow only specific ports on Apache non-SSL requests and redirect

I am serving 3 NodeJS websites on Apache. The VirtualHosts of these websites are as follows: website1 DocumentRoot "/var/www/html/[website1]" ServerName "[website1_domain]" ServerAlias "www.[website1_domain]" …
2
votes
0 answers

How can I make ISPconfig 3 use SSL?

I've been trying to get ISPconfig 3 to accept my ssl certificates, and it seems to go fine, except that it doesn't change the vhost-files to enable ssl, even when ticking the 'SSL' box in ISPconfig. The certificate supplier only has a guide for…
user746379
  • 1,492
  • 2
  • 13
  • 21
2
votes
0 answers

Point sub domain to another domain on another server

is it possible to point my example.com domain to another domain like example2.com on another server ? my idea is to point {variable}.example.com to example2.com/{variable} like A.example.com -> someoneElseServer.com/A B.example.com ->…
Aiman
  • 33
  • 3