Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30th August 2006, 04:06 PM
leaded Offline
Registered User
 
Join Date: May 2004
Posts: 373
Apache configuration question

Hey guys. I have FC5 installed on a computer with the DNS name... we'll call it green.domain.com. I'm running Apache 2 and Tomcat. I set an Alias to go to the Tomcat directory...
Code:
Alias /sxdm/ "/usr/local/tomcat/webapps/sxdm/"
If you go to http://green.domain.com/sxdm/ it shows the directory listing using Tomcat's webserver. That's okay for me. The application starts by going to http://green.domain.com/sxdm/servlet/portal.

On the developer network DNS server, they added an entry for... orange.domain.com to the same IP address as green.domain.com. If I go to http://orange.domain.com/sxdm/servlet/portal, it does the same thing as if I go to green. The Apache httpd.conf file has no mention of orange anywhere.

I was asked today to make it so if a user goes to http://orange.domain.com it goes to http://orange.domain.com/sxdm/servlet/portal. I thought about using VirtualHosts and making the document root /usr/local/tomcat/webapps/sxdm/servlet/portal but I think they want to see the URL http://orange.domain.com/sxdm/servlet/portal

My first response was to make an index.html file in the document root and use a meta refresh tag. And it works. But I have two problems with this: 1, it's client-side; and 2, if I go to http://green.domain.com it will do the same redirect.

How to I make it so, on the server-side, a request for http://orange.domain.com redirects to http://orange.domain.com/sxdm/servlet/portal but green.domain.com is unaffected? Keep in mind I don't want to change the documentroot.

Thanks!
Reply With Quote
  #2  
Old 30th August 2006, 05:45 PM
brunson Offline
Registered User
 
Join Date: Jun 2005
Location: Westminster, Colorado
Posts: 2,305
If I had to take a first guess, the redirection from http://whateverdomain/sxdm/ to http://green.domain.com/sxdm/servlet/portal is being done by the servlet, apache won't redirect that way. Tell the servlet developers to use relative URLs.

If you want different behavior for orange and green, you'll have to use virtual hosts or else write a server side script that looks at the URL that was requested and only serve up the redirect for orange.

My standard answer to people that pay too much attention to the URL in the location bar is "Why do you care?" If it's doing the right thing, get over it.

The easiest thing to do will be to create two virtual hosts for green and orange and give them different document roots. I've had to do it so many times that I don't even bother not doing it anymore, I create a virtual host even if there's only one.
__________________
Registered Linux User #4837
411th in line to get sued by Micro$oft
Quote:
Basically, to learn Unix you learn to understand and apply a small set of key ideas and achieve expertise by expanding both the set of ideas and your ability to apply them - Paul Murphy
Reply With Quote
  #3  
Old 30th August 2006, 08:05 PM
bob's Avatar
bob Offline
Administrator (yeah, back again)
 
Join Date: Jul 2004
Location: Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
Age: 67
Posts: 21,330
(moved to Servers)
__________________
Linux & Beer - That TOTALLY Computes!
Registered Linux User #362651


Don't use any of my solutions on working computers or near small children.
Reply With Quote
Reply

Tags
apache, configuration, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSL and Apache configuration problem rawand Servers & Networking 2 2nd September 2009 09:05 AM
Apache configuration chrisk Servers & Networking 55 26th November 2008 04:49 PM
HTTP/APACHE Server Configuration Question & httpd.conf jazzer386 Using Fedora 4 29th August 2008 07:15 PM


Current GMT-time: 07:14 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat