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: name based virtual hosts
Author
ogami_itto



Joined: 28 May 2010
Posts: 1
Location: in the datacenter

PostPosted: Fri 28 May '10 17:51    Post subject: name based virtual hosts Reply with quote

Hi everyone, Very Happy

im not new to using apache but im not very experienced in the finer details.

Problem:
I have 4 domains that i am currently hosting on a single server with 1 IP address.these domains are internal websites where i work:
caretrn.brm.pri
caretrn1.brm.pri
caretrn2.brm.pri
caretrn3.brm.pri

the server i am hosting apache and these websites on is called svwvap254 (IP 10.87.1.119) however we would like to avoid using IP addresses in any configuration as they can change (hosted on virtual servers)

The application that i am trying to get to is coldfusion / jrun based on the same server svwvap254, each of the applications instances sits on a seperate port:

caretrn = 8100
caretrn1 = 8101
caretrn2 = 8102
caretrn3 = 8103

i can access and confirm that these instances are all up and running by connecting to them via their JMC urls.

what i cant get working is apache to listen and redirect requests to the relevant virtualhost.

all requests are to be received on port 80 to server svwvap254
i want apache to then look at its config and say "caretrn.brm.pri, you need to goto port 8100" etc etc

what happens when i type in http://caretrn.brm.pri into my browser is i get the default apache webpage.

below is the full config file, any help greatly appreciated!!

Code:

ServerRoot "D:/Apache Group/Apache2"

Listen 80

LoadModule alias_module modules/mod_alias.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so


ServerAdmin admin@addm.ads.brm.pri
ServerName SVWVAP254.addm.ads.brm.pri:80

UseCanonicalName Off

DocumentRoot "D:/Apache Group/Apache2/htdocs"

<Directory "D:/Apache Group/Apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
UserDir "My Documents/My Website"

#<Directory "C:/Documents and Settings/*/My Documents/My Website">
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>


ServerTokens Full
ServerSignature On


<VirtualHost *:80>
ServerName caretrn1.brm.pri
<IfModule mod_jrun20.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "D:/JRun4/lib/wsconfig/2/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51002
ErrorLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN1.log"
CustomLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN1.log" common
</IfModule>
</VirtualHost>
<VirtualHost *:80>
<IfModule mod_jrun20.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "D:/JRun4/lib/wsconfig/3/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51003
ServerName caretrn2.brm.pri
ErrorLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN2.log"
CustomLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN2.log" common
</IfModule>
</VirtualHost>
<VirtualHost *:80>
<IfModule mod_jrun20.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "D:/JRun4/lib/wsconfig/4/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51004
ServerName caretrn3.brm.pri
ErrorLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN3.log"
CustomLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN3.log" common
</IfModule>
</VirtualHost>
<VirtualHost *:80>
<IfModule mod_jrun20.c>
JRunConfig Verbose false
JRunConfig Apialloc false
JRunConfig Ignoresuffixmap false
JRunConfig Serverstore "D:/JRun4/lib/wsconfig/1/jrunserver.store"
JRunConfig Bootstrap 127.0.0.1:51000
ServerName caretrn.brm.pri
ErrorLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN.log"
CustomLog "D:/Apache Group/Apache2/logs/httpd_error_CARETRN.log" common
</IfModule>
</VirtualHost>


Mod note: I removed all not needed config stuff. NEVER post the whole config. We know the standard config! Please view the forum rules
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 31 May '10 17:16    Post subject: Reply with quote

Quote:

what i cant get working is apache to listen and redirect requests to the relevant virtualhost.


IMHO a reverse proxy can handle that.

Quote:

all requests are to be received on port 80 to server svwvap254
i want apache to then look at its config and say "caretrn.brm.pri, you need to goto port 8100" etc etc


If you are using a reverse proxy you don't have to say the client ist has to look an a different port.
Else
Use apache redirect
Back to top


Reply to topic   Topic: name based virtual hosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache