LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 09-20-2008, 08:24 AM   #1
andrews-mark
Member
 
Registered: Feb 2007
Location: London
Distribution: debian
Posts: 108

Rep: Reputation: 15
viewing an externally hosted website from within a given website


Sorry if the title is a bit misleading or weird, I found it difficult to phrase the subject matter.

I have a problem where I need to host a website on a particular machine with a particular url, but I also need this website to be available from another url hosted on another machine.

Basically, my problem arises as I need a particular website hosted on a server I own to appear as my personal homepage on my university's website. In other words, let's say my homepage is www.myuniversity.edu/myhome/ and my own website hosted on a private server is www.myowndomain.net. I can create a nice dynamic site at www.mydomain.net and I can not do them same at www.myuniversity.edu/myhome (I can just use static html there). I would like when someone browses to www.myuniversity.edu/myhome for them to end up at www.myowndomain.net. Obviously, I could redirect them with a simple redirection page at www.myuniversity.edu/myhome/, but I want the urls they are looking at to be www.myuniversity.edu/myhome/* and not www.myowndomain.net/*. The reason I want this is because I want my website to appear to be officially part of the university's site.

I can talk to the system administrators who run the university's website and I know they will help me if I can make a definite request that is relatively easy for them to implement (they are using apache, btw). Trouble is, at the moment, I don't really know what I need to ask them. I presume this issue is handled by some sort of IP address translation, but I'm not sure.

Does any one know if this type of thing can be done, and how?

many thanks
-mark
 
Old 09-20-2008, 10:26 AM   #2
mjmwired
Member
 
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 39
I am pretty sure this cannot be done in anyway whatsoever.

The only thing that Apache can do for you is to automatically redirect certain URL's to automatically redirect to another URL.
For example, every time someone types univ.edu/user/some-web-page.html it will automatically end up at domain.net/some-web-page.html
But after that all navigation will be through your own domain.

You can use some sort of IFRAME tag in a static HTML page on your university page that will load content from your own domain.
Or you can write a Javascript/AJAX webpage in static HTML/JS that will send requests to your own domain and make it look like it is all on your university page.
 
Old 09-21-2008, 01:19 AM   #3
andrews-mark
Member
 
Registered: Feb 2007
Location: London
Distribution: debian
Posts: 108

Original Poster
Rep: Reputation: 15
Hi - thanks for the advice (mjmwired). I'm surprised to hear that it is so difficult, but if that's the way it is then that's the way it is.
-m
 
Old 10-03-2008, 03:17 PM   #4
Savet
Member
 
Registered: Nov 2004
Distribution: Slackware
Posts: 73

Rep: Reputation: 15
Since you mentioned only being able to use static pages at your university site, I'm assuming php and asp are out of the question.

You could, however, do an iframe that loads your private website in the shell of your university site. The only downside is that without server side scripting, you'd need to write javascript functions to grab page variables from the container url and pass them to the contained page.

This isn't really a server side option...but it might be the only way to accomplish what you're wanting to do.
 
Old 10-03-2008, 06:02 PM   #5
timnp
Member
 
Registered: Feb 2008
Location: London
Distribution: FC8, FC9, Centos 4, Centos 5, Knoppix
Posts: 52

Rep: Reputation: 16
Hi

I've had to do this kind of thing before, to do it properly it does require configuration at the apache level. Look up these configuration directives...

http://httpd.apache.org/docs/1.3/mod...html#proxypass

Basically in their host or virualhost you would have to get the sysadmins to add

ProxyPass /myhome/ http://www.mydomain.net/

If your site uses internal redirects they you might also need to set up

http://httpd.apache.org/docs/1.3/mod...oxypassreverse

So that they get redirected to the corresponding page on the .edu which will in turn get the right page from your site.

This requires the apache mod_proxy but any large installation will probably have that already (it might even be on by default i can't recall)

The way that this would work is your visitor would visit your page on the university domain, the university web server would then contact your webserver to get the page and then return it back to the original viewer exactly as though it had come from the uni server. does that make sense?

It does mean that in all the logs of your website on your server you will see many requests from the same ip (the ip of the uni server), even though these are probably lots of different people from all over the place.

One final point is that your university sysadmins might have an issue with this as it would in theory mean that you could publish any content that would then appear to come from the universities website and perhaps affect its reputation, then again because they are at least letting you put static content up already this might not be so much of an issue.

Infact, you might not even need to ask them, I'm not sure but you might be able to set this up using a .htaccess file.

I sincerely hope this helps you, let me know if you get stuck.
 
Old 10-04-2008, 12:48 AM   #6
Savet
Member
 
Registered: Nov 2004
Distribution: Slackware
Posts: 73

Rep: Reputation: 15
In the event that the admins will not configure apache to suit his site, another option that came to mind is a screen scrape.

The wikipedia page should get you started:

http://en.wikipedia.org/wiki/Screen_scraping

You could write it in javascript, and direct the output to the innerHTML of a div tag.
 
Old 10-07-2008, 12:11 AM   #7
andrews-mark
Member
 
Registered: Feb 2007
Location: London
Distribution: debian
Posts: 108

Original Poster
Rep: Reputation: 15
Hi - many thanks for all the advice. very helpful indeed.
-m
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
set up proxy server on hosted website secretlydead Linux - Server 1 09-06-2008 04:06 AM
Apache and viewing directory structure of a website slamster Linux - Server 1 12-17-2006 11:03 AM
Virtual hosted website not found toes Linux - Networking 7 07-14-2006 03:11 PM
How Can I password protect a sub-directory of a hosted website from client PC mark001 Linux - Newbie 18 11-12-2004 02:29 PM
Can't access website externally with Linksys BEFW11S4 apache363 Linux - Networking 14 04-30-2004 08:53 PM


All times are GMT -5. The time now is 05:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration