Questions tagged [virtual-hosts]

Virtual hosts or virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers).

Virtual hosts or virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers).

This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name. The term virtual hosting is usually used in reference to web servers but the principles carry over to other internet services.

One widely used application is shared web hosting.

There are two main types of virtual hosting, name based and IP based. Name based and IP based virtual hosting can be combined, a server may have multiple IP address and serve multiple names on some or all of those IP addresses. This technique can be useful when using SSL/TLS with wildcard certificates.

241 questions
4
votes
2 answers

Apache vhost resolves to localhost document root

I downloaded apache2.2.22 src from http://httpd.apache.org/download.cgi and made the installation. The installation works fine. But the problem arises when I try adding vhosts. I added 2 virtual hosts 1. localhost 2. someother.localhost Both…
3
votes
2 answers

Setup Dynamic Virtual Host (Apache2 on Ubuntu)

I want to set up a single virtual host that can dynamically handle all requests based on the hostname used to access it. If %{HTTP_HOST} could be used in a DocumentRoot, this is probably exactly what I want: ServerAdmin…
Nathan J.B.
  • 10,215
  • 3
  • 33
  • 41
3
votes
2 answers

Creating a Virtual Host In PHP

I am trying to set up symfony on my Ubuntu system. Now as going through the installation tutorial of symfony I found to Create a virtual host for my (to be created) application. I did the same steps as bellow. httpd.conf NameVirtualHost…
ScoRpion
  • 11,364
  • 24
  • 66
  • 89
3
votes
3 answers

setting up multiple ip addresses on one apache server

I have a server setup running apache2. There are 2 public ip addresses pointing to the server each assigned a different domain name. I set up the virtual host to manage these domains. The first domain is working fine. The second on the the other…
Adam McMahon
  • 413
  • 2
  • 9
  • 20
3
votes
1 answer

Docker Compose | Virtual Hosts

Whats wrong in my code? thanks in advance! I'm trying to set up a virtual host for my docker container. On localhost: 8000 works perfectly, but when I try to access through http: //borgesmelo.local/ the error ERR_NAME_NOT_RESOLVED appears, what can…
Roberto Godoy
  • 185
  • 1
  • 2
  • 8
3
votes
1 answer

Dynamic subversion repos via subdomains (in Apache)

I'm trying to set up a subdomain-to-repository translation in Apache. Example: foobars.domain.com -> /server/svnrepos/foobars I've tried to get this done with mod_rewrite: RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteCond %{HTTP_HOST}…
mmakowski
  • 129
  • 1
  • 6
3
votes
3 answers

MAMP PRO 4+ after update osx to macOS Sierra disappears hosts /etc/hosts

after update osx to macOS Sierra my MAMP PRO sometimes not working correctly. When i start servers, MAMP write my hosts to /etc/hosts, but after some time (seconds), my hosts desappears from /etc/hosts. After several server restarts hosts stay. Has…
3
votes
0 answers

Virtual host in XAMPP Windows 7

I am trying to create a virtual host in xampp windows 7. #NameVirtualHost *:80 DocumentRoot "C:/xampp/htdocs/project/Trunk/xyz" ServerName xyz.local DocumentRoot "C:/xampp/htdocs" …
Kiren S
  • 3,037
  • 7
  • 41
  • 69
3
votes
3 answers

Change Apache2 ports.conf in order to localhost interface to listen to port 80

At the moment I have this config in /etc/apache2/ports.conf: NameVirtualHost *:80 Listen 80 All works fine, but I want to change it to: NameVirtualHost 127.0.0.1:80 Listen 127.0.0.1:80 However after restarting apache, it displays the following…
rfc1484
  • 9,441
  • 16
  • 72
  • 123
3
votes
1 answer

Setting up Virtual Hosts on Mac with different subdirectories

I have problems setting up my local development environment on a mac. What i have (added): /private/etc/hosts: 127.0.0.1 dev.local 127.0.0.1 page1.dev.local /Applications/MAMP/conf/apache/httpd.conf: NameVirtualHost *
Xaver
  • 11,144
  • 13
  • 56
  • 91
2
votes
2 answers

multiple virtual hosts on EC2 ubuntu - cannot access second host, always accesses default

first time poster, but please help. I have been searching and reconfiguring for 6 days now and have lost several clumps of hair.. PROBLEM: I want 2+ virtual hosts on my ubuntu server (1 ip) BUT - Only the first "alphabetically" listed sites-enabled…
Logansanoh
  • 21
  • 1
  • 3
2
votes
1 answer

Before update to High Sierra httpd-vhosts.conf is empty

I just upgraded from Sierra to High Sierra. Apparently everything works fine. But when testing my works in local (Web developments in PHP, etc) I see that none works. Checking and looking for where the bug might be, I went to see that all my…
Javier
  • 395
  • 3
  • 18
2
votes
0 answers

Apache: ServerName, DocumentRoot and Directory on main config file and VirtualHosts files

You might help me on these three questions. 1) Can I remove, i mean is it a good practice remove DocumentRoot and Directory directives from Apache main configuration file when it is set per virtual host configuration file? 2) I have the…
2
votes
0 answers

MAMP Virtual Host Returning 'It Works!' page

I have kind of come to my wits end with this. Earlier tonight my MAMP stopped working once I attempted to restart it. So I decided to uninstall and reinstall MAMP and see if that helped. However it's caused something else that has never occurred…
mcclosa
  • 943
  • 7
  • 29
  • 59
2
votes
3 answers

Cannot upload images when WordPress is sat on a virtual host configuration

This is my first post to this Forum, please forgive me if this has been answered elsewhere--I did search and was unable to find an answer to my particular problem, so any help would be greatly appreciated. I am working on a WP site for a client who…
Dan C
  • 495
  • 2
  • 15
  • 30
1 2
3
16 17