logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: problem with vhosts Page Previous  1, 2, 3, 4
Author
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Fri 13 Apr '12 13:52    Post subject: Reply with quote

(Removed)
Back to top
Triple_Nothing



Joined: 01 Apr 2012
Posts: 39
Location: WI, USA

PostPosted: Fri 13 Apr '12 19:03    Post subject: Reply with quote

Simple answer, and note to all... Don't forget, if you plan to run a site outside your default document root, you must supply a <Directory> tag for each folder outside what has already been defined.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 218
Location: Denver, CO USA

PostPosted: Sun 15 Apr '12 21:38    Post subject: Reply with quote

I have been watching this post for the past couple of weeks or so and have decided to throw in my 2 cents to see if it helps. Here is my actual/real life/working vhosts for all to examine and see if it helps solve the mystery for all. This is right off of my Apache server and is completely unedited.

# Apache Server 2.4.2 Virtual Hosts Configuration (April 06, 2012)
#
# Required modules: mod_log_config
#
# If you want to maintain multiple domains/hostnames on your machine you
# can setup VirtualHost containers for them. Most configurations use only
# name-based virtual hosts so the server doesn't need to worry about IP
# addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/trunk/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
# First Virtual Host must be a shallow duplicate of the main host
# in httpd.conf
#
<VirtualHost _default_:80>
DocumentRoot "C:/Program Files/Apache/WEB_Sites"
#ServerName www.example.com:80
</VirtualHost>
#
# Add any other Virtual Hosts below
#
# MSBEDHOLM.ORG
#
<VirtualHost *:80>
#NameVirtualhost msbedholm.org
ServerName msbedholm.org
Redirect Permanent / http://www.msbedholm.org
</VirtualHost>
#
# WWW.MSBEDHOLM.ORG
#
<VirtualHost *:80>
#NameVirtualhost www.msbedholm.org
ServerName www.msbedholm.org
#ServerAlias
ServerAdmin scott@saetek.net
ServerPath "C:/Program Files/Apache/WEB_Sites/MSBEdholm"
DocumentRoot "C:/Program Files/Apache/WEB_Sites/MSBEdholm"
<Directory />
HostnameLookups On
Options FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex /edholm.htm
AllowOverride None
Require all granted
SetEnvIfNoCase User-Agent "^Baiduspider" bad_bots
SetEnvIfNoCase User-Agent "^t-dialin" bad_bots
Order deny,allow
Allow from all
Deny from env=bad_bots
Deny from 217.88
Deny from t-dialin.net
Satisfy All
</Directory>
ErrorLog "logs/msbedholm.org-error.log"
CustomLog "logs/msbedholm.org-access.log" common
</VirtualHost>
#
# RESUME.MSBEDHOLM.ORG
#
<VirtualHost *:80>
#NameVirtualhost resume.msbedholm.org
ServerName resume.msbedholm.org
#ServerAlias
ServerAdmin scott@saetek.net
ServerPath "C:/Program Files/Apache/WEB_Sites/MSBEdholm"
DocumentRoot "C:/Program Files/Apache/WEB_Sites/MSBEdholm"
<Directory />
HostnameLookups On
Options FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex /resume.htm
AllowOverride None
Require all granted
Order deny,allow
Allow from all
Satisfy All
</Directory>
ErrorLog "logs/resume.msbedholm.org-error.log"
CustomLog "logs/resume.msbedholm.org-access.log" common
</VirtualHost>
#
# SAETEK.NET
#
<VirtualHost *:80>
#NameVirtualhost saetek.net
ServerName saetek.net
Redirect Permanent / http://www.saetek.net
</VirtualHost>
#
# WWW.SAETEK.NET
#
<VirtualHost *:80>
#NameVirtualhost www.saetek.net
ServerName www.saetek.net
#ServerAlias
ServerAdmin scott@saetek.net
ServerPath "C:/Program Files/Apache/WEB_Sites/SAETek"
DocumentRoot "C:/Program Files/Apache/WEB_Sites/SAETek"
<Directory />
HostnameLookups On
Options None
#Options FollowSymLinks MultiViews
IndexOptions FancyIndexing
DirectoryIndex SAETek.php
AllowOverride None
Require all granted
SetEnvIfNoCase User-Agent "^Baiduspider" bad_bots
SetEnvIfNoCase User-Agent "^t-dialin" bad_bots
Order deny,allow
Deny from all
#Allow from all
Deny from env=bad_bots
Deny from 217.88
Deny from t-dialin.net
Satisfy All
</Directory>
ErrorLog "logs/SAETek.net-error.log"
CustomLog "logs/SAETek.net-access.log" common
</VirtualHost>
Back to top
rob62



Joined: 22 May 2007
Posts: 54
Location: mi

PostPosted: Mon 16 Apr '12 0:11    Post subject: Reply with quote

Thanks DnvrSysEngr

A saint on here connected to my computer and set it up.

My setup was unique in that all web sites are in the root of G:\

I'm very happy.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 218
Location: Denver, CO USA

PostPosted: Mon 16 Apr '12 1:58    Post subject: Reply with quote

I know when I first setup my server with multiple hosts using vhosts, it did take a bit of "trial and error." I wish I had kept the list of sites that were of help to me nearly 4 years ago. I decided to post on here my vhosts for all to see as it is a culmination of what I have learned over the years.
Back to top
rob62



Joined: 22 May 2007
Posts: 54
Location: mi

PostPosted: Mon 16 Apr '12 2:09    Post subject: Reply with quote

There's a lot more info on the net now.

He changed the httpd file.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 218
Location: Denver, CO USA

PostPosted: Mon 16 Apr '12 2:30    Post subject: Reply with quote

That was my next move, was to post my httpd.conf file if needed.
Back to top


Reply to topic   Topic: problem with vhosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache Page Previous  1, 2, 3, 4