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

Laravel Redirect::route() going to wrong url on vhost

I was working on some code today and sent a Redirect::route(). Instead of redirecting to the base_url/route as usual, it duplicated the base_url like this: http://myurl.dev/http://myurl.dev/myroute I figured I did something wrong, so I went back and…
Mike Funk
  • 373
  • 6
  • 22
2
votes
1 answer

How to add access.log to each vhost in apache

Here is my current vhost: UseCanonicalName Off VirtualDocumentRoot /var/www/%0/public Options Indexes FollowSymLinks Includes ExecCGI …
2
votes
1 answer

Apache vHosts Conf - ErrorLog Custom Paths

I've got my vhosts conf setup to automate all websites inside my www dir using the following ServerAdmin webmaster@%0 ServerName %0 ServerAlias %0 VirtualDocumentRoot C:/wamp/www/%0/httpdocs This…
owenmelbz
  • 6,180
  • 16
  • 63
  • 113
2
votes
2 answers

Laravel 4 routing not working due to .htaccess file?

I'm writing my steps and findings here so you can see what I've tried and what results I got. Any advice would be welcomed. I followed the comments in this answer. I'm running Laravel 4, using XAMMP version 1.8.2 with PHP 5.4.19 and Apache 2.4.4 on…
marienke
  • 2,465
  • 4
  • 34
  • 66
2
votes
1 answer

Use wildcard with express.vhost

Is express.vhost able to support a wildcard to catch all traffic of one specific domain? I'm looking for every subdomain (www.example.com, xyz.example.com) and the TLD itself (example.com).
RienNeVaPlu͢s
  • 7,442
  • 6
  • 43
  • 77
2
votes
0 answers

Configurating apache vhosts to access domain from outside of local network

Configuration I am running Windows Server 2012 with XAMPP installed in C:\xampp Apache running as a Service I have edited host file in C:\Windows\System32\Drivers\etc, added following 127.0.0.1 landing.local I added vhost in…
Cokaric
  • 51
  • 1
  • 8
2
votes
2 answers

Using SSL on two VirtualHosts

So I got an SSL from GoDaddy. It works for my public site mysite.com. I would like now to have an SSL connection for my administrator.mysite.com So I created a self signed certificate using openssl because I don't mind managing my own site with a…
Ted
  • 3,805
  • 14
  • 56
  • 98
2
votes
3 answers

Apache setup for multiple sites with common files

I have approx 50 sites that all use the exact same files other than CSS and IMAGES, i currently duplicate the files each time i create a new site and upload different css and images. What I want do so set up each vhost to have the same DocumentRoot…
Lizard
  • 43,732
  • 39
  • 106
  • 167
2
votes
0 answers

mod_rewrite: Rewriting / to cgi script

Is there any way to rewrite a GET / to a cgi script with a parameter? Basically redirect / to /cgi-bin/scipt.cgi?123. This does not work: RewriteEngine On RewriteRule ^/$ /cgi-bin/script.cgi?123 [L] Instead it somehow rewrites / to /index.html/ Any…
Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
2
votes
2 answers

Apache vhost rewrite goes wrong with existing folders

I want my vhost to rewrite urls such as: http://dev.example.com/cool/story/bro To: http://dev.example.com/index.php?url=cool/story/bro Unless specifying an existing file such as: http://dev.example.com/images/duck.png It works fine but when I have…
Lenton
  • 121
  • 6
2
votes
2 answers

run external programs on virtual server

I want to install small programs accessible through the command line (of linux OS) to a server and run them with PHP. I want to install Apache, vhost on my machine... Is there a way to run these external applications on my virtual server, on my…
user1584421
  • 3,499
  • 11
  • 46
  • 86
2
votes
1 answer

Display virtual hosts from a php script?

I am looking to be able to build a script that will display all the virtual hosts running under my Apache (Ubuntu) development machine. To date, I've not found any examples or anything close to what I want, which simply is: "Display all virtual…
Scott Fleming
  • 452
  • 6
  • 14
2
votes
1 answer

Two servers with mod_proxy, second server host is local ip and shows /proxy/ in url?

I am having some issues in regards to sessions with a second server I am running on my home network. I do this as a hobby and to develop new applications before they officially go live. I have a domain pointing to my ip and resolves successfully to…
Uberswe
  • 1,038
  • 2
  • 16
  • 36
2
votes
1 answer

Moving Joomla SEF rules from .htaccess to vhosts.conf

I have a joomla install which uses the built in SEF urls, and the stock .htaccess file to rewrite them. I presume that it would be much more efficient to set the rules in the apache config rather than .htaccess, [to avoid having this file requested…
Keith
  • 1,136
  • 2
  • 13
  • 30
2
votes
3 answers

how to configure cakephp in nginx

Currently i am working on cakephp with nginx. I setup a cakephp environment on a Centos server running Nginx with Fact CGI. The problem is that I cannot get the rewrite rules to setup correct in my vhost so that cake renders pages correctly i.e.…
Praveen Poonia
  • 745
  • 10
  • 18