Author |
|
DPGrose
Joined: 10 Nov 2009 Posts: 4 Location: North Carolina
|
Posted: Tue 10 Nov '09 19:51 Post subject: Apache Proxy and DirectoryIndex |
|
|
I have a rails app running on an Apache 2.2.9 installed on a Win2003 server. The issue that I have is that when I try to access the www.tiresourcelink.com website I get the index.html page instead of
the demologin.html page. If I enter in www.tiresourcelink.com/demologin then the correct page is accessed. I am not seeing any errors in the log files.
Below is the httpd.conf and the httpd-vhosts.conf files. Any help would be appreciated.
================================================================
httpd.conf
================================================================
ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"
Listen 80
Listen 66.223.110.83:80
Listen 66.223.110.88:80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>
ServerName 66.223.110.83:80
DocumentRoot "d:/webdcm1/public"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow From all
Satisfy all
</Directory>
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
ErrorLog "logs/error.log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access.log" common
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"
</IfModule>
<IfModule cgid_module>
</IfModule>
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain
<IfModule mime_module>
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
Include conf/extra/httpd-vhosts.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
=================================================================
httpd-vhosts.conf
=================================================================
NameVirtualHost *:80
<VirtualHost *:80>
#Tire Source
ServerName tiresourcelink.com
Serveralias www.tiresourcelink.com
DocumentRoot "d:/webdcm1/public"
DirectoryIndex demologin.html
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .*favicon\.ico$ D:/webdmc1/public/favicon.ico [L]
RewriteRule .*robots\.txt$ D:/webdmc1/public/robots.txt [L]
ErrorLog logs/tiresourcelink.com-error_log
CustomLog logs/tiresourcelink.com-access_log common
#Proxy directives
ProxyPass /webdmc1/images !
ProxyPass /webdmc1/stylesheets !
ProxyPass /webdmc1/javascripts !
ProxyPass / http://www.tiresourcelink.com:3002/
ProxyPassReverse / http://www.tiresourcelink.com:3002/
ProxyPreserveHost On
</VirtualHost>
Last edited by DPGrose on Wed 11 Nov '09 20:50; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
Posted: Wed 11 Nov '09 11:34 Post subject: |
|
|
Your reverse proxy shows only the result of http://www.tiresourcelink.com:3002/
So you have to change on that server the DirectoryIndex. |
|
Back to top |
|
DPGrose
Joined: 10 Nov 2009 Posts: 4 Location: North Carolina
|
Posted: Wed 11 Nov '09 15:57 Post subject: |
|
|
James,
What do i need to change? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
Posted: Wed 11 Nov '09 17:49 Post subject: |
|
|
From the HTTP Header I can see that you use WEBrick as ruby server. I'm not used to that. |
|
Back to top |
|
DPGrose
Joined: 10 Nov 2009 Posts: 4 Location: North Carolina
|
Posted: Wed 11 Nov '09 19:06 Post subject: |
|
|
Yes, that is correct. What I am trying to do is mask the port address of the Webrick server. Instead of seeing www.tirecourcelink.com:3002\login\login\demo, I want the client to see www.tiresourcelink.com\login\login\demo.
The client should be seeing the demologin.html file and get redirected to the \login\login\demo path. Everything seems to work fine except that www.tiresourcelink.com is reading the index.html file instead of the demologin.html and both files are in the same directory d:\webdcm1\public.
I cannot understand why the index.html file is being call instead of the demologin.html file. The DocumentRoot and DirectoryIndex are pointing to the correct path and file name.
Below is the demologin.html:
=================================================
demologin.html
=================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Tire Source Demo</TITLE>
<LINK REL="SHORTCUT ICON" HREF="http://www.tiresourcelink.com/favicon.ico">
<META NAME="AUTHOR" CONTENT="Andreoli & Associates, Inc.">
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1">
<meta name="description" content="Access To Justice Tire tiresourcelink.com">
<meta name="keywords" content="Justice Tire, www.tiresourcelink.com, tiresourcelink.com">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="EN">
<meta name="robots" content="all">
<link href="/stylesheets/scaffold.css" media="screen" rel="Stylesheet" type="text/css">
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Refresh" content="0; URL=http://www.tiresourcelink.com/login/login/demo">
</head>
<body background="/images/cooper_bg.gif">
<div id="banner">
<img id="main_banner" class="banner" src="/images/cooper_bn.gif"/>
</div>
<p>
<a href="//www.tiresourcelink.com/login/login/demo">Click Here If You Are Not Redirected To The Site In 5 Seconds. </a>
</p>
</body>
</html> |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
Posted: Wed 11 Nov '09 20:59 Post subject: |
|
|
DPGrose wrote: |
I cannot understand why the index.html file is being call instead of the demologin.html file. |
Because the Webrick sever is configured to do that! You have to change the webrick server config. NOT apache. |
|
Back to top |
|
DPGrose
Joined: 10 Nov 2009 Posts: 4 Location: North Carolina
|
Posted: Thu 12 Nov '09 21:21 Post subject: |
|
|
James Blond wrote: |
Because the Webrick sever is configured to do that! You have to change the webrick server config. NOT apache. |
The Webrick server can only be configure to listen to a port and does not get invoked until the demologin.html redirects to that port. But since the index.html is being loaded and not the demologin.html, the Webrick never passes the path to the Rails app to run. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
|
Back to top |
|