LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-22-2013, 02:39 PM   #1
ToddCorley
LQ Newbie
 
Registered: Nov 2013
Posts: 4

Rep: Reputation: Disabled
Serve a HTTP request locally?


Sorry if this isn't a Network question...

Back Ground:
I have an installer that I have to re-install often for testing. Deep in the installer is a call to a static server that uses wget to down load the same large file from a fairly slow server every time and it add 15-20 minutes to an already long process.

Would love to update the installer to have it check for a cached version but that is out of my control.


Question:
Working on RHEL 6 is there anyway to listen to / configure something(?) that would allow me to redirect a static IP wget http request to a local apache server?
 
Old 11-22-2013, 02:46 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
What are you accessing to get to the server? A hostname or an IP address? If it's a hostname then you can just put that hostname into the local /etc/hosts file as 127.0.0.1 and then just run apache listening on localhost.
 
Old 11-22-2013, 03:36 PM   #3
ToddCorley
LQ Newbie
 
Registered: Nov 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
It is a static IP address.

I couldn't really screw around with host name anyway. It is pretty important to the later parts of the install.
 
Old 11-22-2013, 04:35 PM   #4
ToddCorley
LQ Newbie
 
Registered: Nov 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Okay, not pretty, but I found a solution. I renamed wget to _wget created a bash script named wget that just looks for the file name in the input parameters. If it finds the name it copies the file from local otherwise it just passes the request to _wget.
 
Old 11-22-2013, 04:50 PM   #5
GNU/Linux
Member
 
Registered: Sep 2012
Distribution: Slackware-14
Posts: 118

Rep: Reputation: Disabled
So basically you've renamed an original program to something else, that's not a good idea.
 
Old 11-22-2013, 05:02 PM   #6
ToddCorley
LQ Newbie
 
Registered: Nov 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
I didn't say it was an ideal solution....


It does still allow for normal functionality. My wget just echos any request I don't want to redirect to the renamed _wget
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Log HTTP request mario.almeida Linux - Security 3 02-15-2011 10:59 AM
How to listen to HTTP Request using C++/C ? samuellawrence Programming 4 09-16-2009 09:07 PM
How to DNS locally to serve two different websites? Goce Linux - Server 5 11-25-2008 08:54 AM
Routing http request? stiffy Linux - Server 6 02-27-2007 04:31 PM
http request mkamyar Linux - Software 5 08-30-2005 02:30 AM


All times are GMT -5. The time now is 01:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration