Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have apache2 web server installed on Ubuntu Server which provides the service at 192.168.122.108:80. Also, I've been created a directory named ubuntu on apache's root directory.

Now, the idea is to link or mount this local directory to http://ir.archive.ubuntu.com/ubuntu or it's ftp pal! I mean if someone request http://192.168.122.108/ubuntu or http://192.168.122.108/ubuntu/dists, the local apache server should provide service from ubuntu.com transparently!

What's your idea? how this is possible without using a new port and iptables as forwarder?

Thanks in advance!

share|improve this question
    
Do you have a local DNS server? –  ir01 Jun 8 '13 at 10:06
    
@ir01, yes we do. –  Yasser Zamani Jun 9 '13 at 19:06
    
We have a same problem. We clone the sites(Netbeans rep. Ubuntu rep.) and redirect the DNS records to local address. Why the @davidgo answer is NOT correct(or impractical)? –  ir01 Jun 10 '13 at 4:42
    
@ir01, just read my first comment on his answer; I would not like to CLONE that sites, I would like to create a symbolic link in Apache to outside world. –  Yasser Zamani Jun 11 '13 at 0:18

1 Answer 1

You would need to create a "fake" ir.archive.ubuntu.com site, and then modify the DNS for people using this site. Depending on how this is done it could range from modifying the hosts file (easy, just add the line 192.168.122.108 ir.archive.ubuntu.com) to redirecting DNS to your nameserver and providing the answer you want with a specially crafted zone or a modified routing table.

I note you asked how its possible without using a new port and iptables as a forwarder. I have assumed above that this means "no IPTables". Depending on how literally you interpret this you might be able to insert a transparent proxy in the path - this would use a transparent proxy server and iptables, but no "new port".

share|improve this answer
    
In your first paragraph, I need to completely clone http://ir.archive.ubuntu.com/ubuntu and all underlying staff recursively to my local fake server, right? if so, actualy I asked this question here to avoid this! I just try to found out if Apache supports this scenario via a simple command like mount /ubuntu http://ir.archive.ubuntu.com/ubuntu while linux simply can do this on file systems! –  Yasser Zamani Mar 18 '13 at 7:43
1  
You have not specified what you want clearly, but you can probably do it by setting up a reverse proxy in Apache using mod-proxy to get parts of the archive off the original server, and serve parts of it locally. All traffic would still need to go through your server though and you will still need to redirect the traffic to your server in place of the real one. From what you described the hard bit will be probably be getting the traffic to your server. –  davidgo Mar 18 '13 at 8:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.