Questions tagged [virtualhost]

The term Virtual Host refers to the practice of running more than one web site (such as www.company1.com and www.company2.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.

virtualhost
Filter by
Sorted by
Tagged with
324 votes
20 answers
253k views

Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1....
EvilPuppetMaster's user avatar
317 votes
11 answers
368k views

Site does not exist error for a2ensite

I have cmsplus.dev under /etc/apache2/sites-available with the following code, <VirtualHost *:80> ServerAdmin [email protected] ServerName www.cmsplus.dev ServerAlias cmsplus.dev ...
Anshad Vattapoyil's user avatar
253 votes
3 answers
226k views

nginx missing sites-available directory

I installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can't seem to find the /etc/nginx/sites-available directory. Is there something I need to do ...
Fr0ntSight's user avatar
  • 2,746
179 votes
9 answers
257k views

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

I've got a XAMPP installation running on Windows 7. As soon as I add a VirtualHost to httpd-vhosts.conf, BOTH the 'regular' http://localhost AND the new dropbox.local aren't working. This is what I ...
Highmastdon's user avatar
  • 7,240
153 votes
8 answers
169k views

How to debug an apache virtual host configuration?

Once again, I have a problem with my apache virtual host configuration. (The default configuration is used instead of my specific one). The problem is not really the misconfiguration but how to solve ...
GaetanZ's user avatar
  • 2,969
134 votes
12 answers
228k views

Apache VirtualHost 403 Forbidden

I recently tried to set a test server up with Apache. The site must run under domain www.mytest.com. I always get a 403 Forbidden error. I am on Ubuntu 10.10 server edition. The doc root is under dir /...
Yuchen Wang's user avatar
  • 1,712
126 votes
9 answers
69k views

Create subdomains on the fly with .htaccess (PHP)

I am looking to create a system which on signup will create a subdomain on my website for the users account area. e.g. johndoe.website.example I think it would be something to do with the .htaccess ...
Ben McRae's user avatar
  • 3,555
124 votes
11 answers
120k views

error_log per Virtual Host?

On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts with separate log files. We cannot seem to separate the php error_log between virtual hosts. Overriding this setting in ...
Michael Stum's user avatar
114 votes
15 answers
61k views

How can I eliminate slow resolving/loading of localhost/virtualhost (a 2-3 second lag) on Mac OS X Lion?

Since setting up my development environments on Mac OS X Lion (brand new macbook air purchased in January 2012), I have noticed that resolving to a virtual host is very slow (around 3 seconds) the ...
Adam Gries's user avatar
  • 1,791
100 votes
16 answers
322k views

how to create virtual host on XAMPP [duplicate]

I am sure this question is being asked many times but I am not encounter with a problem. I am using XAMPP where I configure Zend framework. XAMPP is running on port 8081 as 80 is being occupied by ...
Paras Arora's user avatar
  • 1,181
86 votes
3 answers
133k views

Virtualhost For Wildcard Subdomain and Static Subdomain

I have an odd situation where I want to have the URLs app1.example.com, example.com and *.example.com all using a different virtual host. This is what I have (excluding example.com because it just ...
Dave's user avatar
  • 1,668
83 votes
3 answers
98k views

Nginx TCP forwarding based on hostname

With the release of TCP load balancing for the Nginx community version, I would like to mix OpenVPN and SSL pass-through data. The only way for Nginx to know how to route the traffic is via their ...
James Wong's user avatar
  • 4,559
81 votes
13 answers
182k views

Apache VirtualHost and localhost

I'm working with XAMPP on Mac OS X. I'm trying to run a Symfony website properly for a client, and I really don't know Symfony (yet). I just want to install and launch it. I've changed my /etc/hosts ...
Angelica Rosa's user avatar
72 votes
6 answers
162k views

Apache: Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration

When configure apache2 virtual hosts for ssl/https connection, after adding configuration and enable the configuration with this command " a2ensite pm.university.com.conf " i got this error "Invalid ...
Dung's user avatar
  • 19.8k
66 votes
6 answers
66k views

Access to Laravel 5 app locally from an external device

I've looked for a solution in the web, but I've not found a solution yet. I need to access to my Laravel 5 app from my iPhone, but I'm in develop, so I don't want to publish my app on a web server. ...
Bellots's user avatar
  • 1,743
64 votes
6 answers
64k views

Do I have to duplicate the Virtualhost directives for port 80 and 443?

I have a long and intricate list of <VirtualHost> directives, and I have to duplicate them into separate <VirtualHost> groups for ports 80 and 443 because I'm using SSL. Whenever I update ...
scotts's user avatar
  • 4,037
63 votes
6 answers
158k views

client denied by server configuration

I try to setup kohana 3 project as virtual host. Config: <VirtualHost *:80> DocumentRoot "D:/Devel/matysart/matysart_dev1" ServerName matysart-one.local ServerAlias www.matysart-one....
Codium's user avatar
  • 3,200
63 votes
4 answers
109k views

Apache error: _default_ virtualhost overlap on port 443

I get this error when trying to start Apache. _default_ virtualhost overlap on port 443 I'm trying to set up SSL. Almost every solution online says add: NameVirtualHost *:443 to the conf file ...
Mark's user avatar
  • 4,728
57 votes
5 answers
119k views

Apache gives me 403 Access Forbidden when DocumentRoot points to two different drives

I am getting an 403 access forbidden when attempting to open a page under a vhost where the document root is sitting on a different drive than where apache is sitting. I installed using the ...
RobbieGee's user avatar
  • 1,591
52 votes
5 answers
105k views

How do I use https (SSL) in XAMPP while using virtual hosts

I am writing a php app on my local machine and would like to test to see if SSL is working. Bear with me because this is the first time I've ever used SSL. So far this is what I've done: Created a ...
Zaki Aziz's user avatar
  • 3,702
51 votes
3 answers
97k views

Set up Apache virtualhost on Windows

How can I set up virtualhost for multiple domain name on Windows? I will use it for my own test projects. I have three projects that I need to set up and at the moment I'm using xampplite for the ...
nightingale2k1's user avatar
49 votes
7 answers
112k views

Apache2 virtualhost 403 forbidden?

I'm running ubuntu 13.04 64bit on my desktop, I installed Apache2, MySQL and PHP etc. I wanted to have my web root in /home/afflicto/public_html instead of /var/www. So I went along with this guide: ...
Petter Thowsen's user avatar
45 votes
10 answers
151k views

Apache default VirtualHost

How can I set a default VirtualHost in Apache? Preferably, I want the default host not to be the same as the IP address host. Now I have something like this: NameVirtualHost * <VirtualHost *> ...
Tiddo's user avatar
  • 6,405
45 votes
2 answers
66k views

Proxying with SSL [closed]

I have a Linux host running Apache and a Windows host running IIS. I have a domain that points to the Linux host and need to relay (proxy) requests for it to IIS; I thus have the following virtual ...
ekkis's user avatar
  • 10k
44 votes
6 answers
23k views

Vagrant in production

I've been reading about Vagrant, and I find it quite useful for my development. I am currently managing a series of services (mail, web, LDAP, file sharing, etc.), and often one of these falls and ...
rkmax's user avatar
  • 17.9k
43 votes
2 answers
68k views

How to select PHP version 5 and 7 per virtualhost in Apache 2.4 on Debian?

Would it be possible to run PHP 7 and PHP 5 simultaneously in Apache 2.4 on Debian 9? I would like to be able to select the PHP version I wish to use per virtualhost. I believe this would be useful ...
Z0q's user avatar
  • 1,693
38 votes
6 answers
44k views

Apache VirtualHost slow lookup

I finally managed how to configure properly httpd.conf for my virtualhost needings. This is the relevant part of httpd.conf file NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost ...
Leonardo Rossi's user avatar
35 votes
4 answers
25k views

targeting dev sites with vhost setup using ngrok

I'm trying to tunnel a clients site in my sites directory with "ngrok http -host-header = client1.dev 80", I get a 404 when accessing the url. After some experimenting, if I put an index.html file in ...
paul degrand's user avatar
35 votes
6 answers
73k views

Access virtual host from another machine over LAN

I am using Windows 7 with Wamp 2.2 server. I have setup 2 virtual hosts: www.project1.com and www.project2.com. I have modified the "hosts", the httpd.conf, and the httpd-vhosts.conf files, to the ...
jatin3893's user avatar
  • 846
34 votes
13 answers
68k views

VirtualHost always returns default host with Apache on Ubuntu 14.04

I try to setup a virtual host besides the default localhost. Whenever I try to call my virtual host http://test I get the default Apache2 Index file that sits in the directory of http://localhost. ...
Simon's user avatar
  • 4,525
33 votes
8 answers
70k views

How to create virtual hosts in MAMP?

I am new to Mac but used Ubuntu for development for a long time. I know how to create virtual hosts in Ubuntu but have no idea about Mac. I have created a hosts entry like below : ## # Host Database #...
Ritesh's user avatar
  • 4,810
33 votes
2 answers
24k views

How to serve other vhosts next to Gitlab Omnibus server? [Full step-by-step solution]

I installed Gitlab CE on a dedicated Ubuntu 14.04 server edition with Omnibus package. Now I would want to install three other virtual hosts next to gitlab. Two are node.js web applications ...
Rémi Becheras's user avatar
32 votes
3 answers
24k views

Exclude an alias from virtualhost proxypass

I've following virtual host configuration. The desired result is: If someone requests http://test.myserver.com/myapp, apache serves him from /var/www/myapp And if http://test.myserver.com/ is ...
user2436428's user avatar
  • 1,683
28 votes
3 answers
44k views

Using a directory in VirtualHost ServerName

I'm currently using name-based virtual host configuration, to server about 5 different websites from the same IP address, just like in the apache documentation: <VirtualHost *:80> ServerName ...
me_pongo's user avatar
  • 283
27 votes
7 answers
35k views

How to setup mass dynamic virtual hosts in nginx?

Been playing with nginx for about an hour trying to setup mass dynamic virtual hosts. If you ever done it in apache you know what I mean. Goal is to have dynamic subdomains for few people in the ...
jM2.me's user avatar
  • 3,889
27 votes
4 answers
33k views

Tunnel a localhost subdirectory through ngrok?

Objective: want to share a website preview using ngrok, which creates a tunnel from which my localhost can be seen with an url of something like mywebsite.ngrok.io Problem: I use WAMP and my ...
Pontiacks's user avatar
  • 1,138
27 votes
2 answers
61k views

Different folder as website subfolder

I need some help with URL rewriting. The case is similar with this one. I have a working Zend Framework site. Now I must add a blog in Wordpress (also working). I've chosen not to indulge in ZF ...
nevvermind's user avatar
  • 3,362
27 votes
5 answers
83k views

configuring virtual host and localhost redirecting to the xampp folder

I have problem with creating virtual host. I am using Windows 7 x64 Professional. In file C:\Windows\System32\drivers\etc\hosts I have only this lines: 127.0.0.1 myhost 127.0.0.1 www.myhost And ...
woyaru's user avatar
  • 5,574
25 votes
1 answer
91k views

Create an Alias Directory inside a Virtual Host

I checked here, here, here, here, and here before asking this question. I guess my search skills are weak. I am using the WampServer version 2.2e. I have a need like, I need a virtual path inside a ...
Praveen Kumar Purushothaman's user avatar
24 votes
1 answer
57k views

Redirect to a subfolder in Apache virtual host file

I have Joomla installed on a webserver running Ubuntu Server 12.04. The Joomla folder is located at /var/www/cms/. My vhost file at /etc/apache2/sites-enabled/default has the following content: <...
ojs's user avatar
  • 243
23 votes
3 answers
47k views

Apache virtual host without domain name

I have a VPS with apache2 installed and I would like to access some PHP projects without a domain name just with the IP address. For example: http://162.243.93.216/projecta/index.php http://162.243....
heychez's user avatar
  • 628
22 votes
6 answers
47k views

Disable directory listing on apache; but access to individual files should be allowed

I do not want to use .htaccess. How should I change my Directory attributes? <VirtualHost *:80> ServerName abc.com DocumentRoot /usr/share/uploads <Directory " /usr/share/uploads"&...
Deepak Singhal's user avatar
22 votes
8 answers
23k views

How can I implement a global RewriteCond / RewriteRule in Apache that applies to all virtual hosts?

The title pretty much says it all. :-) I have lots of virtual hosts and I want to put a single rewriting block at the top of the httpd.conf file that rewrites URLs no matter which virtual host the ...
hourback's user avatar
  • 1,150
21 votes
6 answers
14k views

Send subdomain to node.js

My work runs a couple different internal web apps on an ubuntu server (10.10) running apache. I'm currently developing another web app, and am seriously considering developing on top of a custom-...
jwegner's user avatar
  • 7,233
21 votes
7 answers
53k views

apache on windows virtual directory config help

I'm running Apache on Windows XP via Xampplite, and could use help configuring my virtual directory. Here's what I'm hoping to do on my dev box: I want my source files to live outside of the xampp ...
20 votes
4 answers
37k views

Treat URL path as virtual host using Apache

The problem is that I have only one domain name on which three different products need to be run (two of them PHP based and one python). So I need to treat the path in the URL as a different virtual ...
Ruslan's user avatar
  • 1,291
20 votes
2 answers
39k views

Different VirtualHosts with the same port

I need to have two VirtualHosts with the same listen port for different projects and with different logs. Here's what I've got: <VirtualHost *:80> DocumentRoot /home/projects/smk ...
ZiTAL's user avatar
  • 3,504
20 votes
6 answers
87k views

Apache httpd.conf for redirecting ip to hostname

I have external IP and hostname configured for my machine. Inside the application, I am using only the domain names to access the APIs. So when i try to access my APIs through IP address, it shows ...
Poppy's user avatar
  • 3,032

1
2 3 4 5
68