How can I make multiple mirror websites on the fly?

Discussion in 'Programming' started by benalmador, May 3, 2009.

  1. #1
    How can I make multiple mirror websites on the fly, transparently, seemingly created, from multiple donor sites?
    For example hxxp://website.that-i-want-to-mirror.net/ to my hxxp://mymirror.website.com on dedicated server with WINDOWS or LINUX?
    Without IFRAME, FRAME, etc.
    So it looks like my domain, my html code output when “view source” done.
    Is there any software proxy that sits in the process and when accessed to my specific domain creates WebPages on the fly from specific domain I pointed at and attaches codes or replaces code to output WebPages, let’s say to the </body> tag or any other tag or string or regexp, etc.
    For now I use offline copier like teleport pro, or offline browser but this is time consuming, space, effort, traffic etc and old-school and inefficient.
    I make offline copy of a desired website, for example it takes 600 MB space and 235 000 files and many hours of downloading and uploading and tweaking and it’s already outdated. Then upload it to my server and show it through hxxp://mymirror.website.com and then show it. And if I want to make 20 mirrored websites this tasks become impossible to do….
    I want it seemingly output through my domain name, may be by CURL, SOCKET, or any other means….
    Any ideas and suggestions, guys?
     
    benalmador, May 3, 2009 IP
  2. pitagora

    pitagora Peon

    Messages:
    247
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the advice i'm giving you right now is for a windows dedicated with ASP.NET (that's what we use). In IIS you can make a default website accessible regardless of the HOST field in the HTTP header. Meaning that as long as the domain points to your dedicated server your site/code will run regardless on what domain it's accessed from. Then your script can determine from what domain it was called and customize the content appropriately, and/or generate SEO friendly urls on fly using a HTTP handler. You could have a database to tell the script what to customize/modify for each domain, and then adding another domain would simply mean a few clicks in an admin panel.

    I'm sure this can also be done in php with apache, but I'm not the most competent to explain how.
     
    pitagora, May 3, 2009 IP
  3. benalmador

    benalmador Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    thanks, your post gives me ideas, appreciate that.
    any other ideas, guys?
     
    benalmador, May 3, 2009 IP
  4. oburlaca

    oburlaca Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The solution to this problem can be divided in two categories:
    1. The content of those websites is copied to your server
    2. The content is proxied through your server

    For Category Nr.1:
    a) The best tool is RSYNC, I really like it: it has it's own protocol of sending/receiving data. And it has a wise mechanism of figuring out what files have been changed and what PARTS of the files had changed!!! so in the end, it will retreive only the modified parts of the file. Have a look at this tool

    b) you may also need to replicate the database if the site is a dynamic one ... it may create problems

    but I think the Category Nr.2 would be ok for you:
    In your Apache conf you'll write something like:

    <VirtualHost 190.200.100.20:80>
    ServerName zzz.your-domain.com
    RewriteRule ^/(.*) hzzp://website-your-want-mirror.com/$1 [P]
    ProxyPassReverse / hzzp://190.200.100.20/
    </VirtualHost>

    Where "190.200.100.20" is Your IP.
    You should have mod_proxy and mod_rewrite enabled.

    P.S.
    zzz is www
    hzzp is http
    The forum didn't allow me to post links.
     
    oburlaca, May 4, 2009 IP
  5. benalmador

    benalmador Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    wow, you are very experienced man:) love your post, appreciate that and your way of thinking out of the box.
    that gives me idea boost
    Thanks a lot

    can I inject my HTML code like header footer into output HTML data on my domain?

    regards,
    your biggest fan:D
     
    benalmador, May 4, 2009 IP
  6. oburlaca

    oburlaca Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The simplest idea is to write a PHP script for ex that fetches remote pages and modify them on the fly:
    RewriteRule ^/(.*) hzzp://your-domain.com/retreive.php?$1 [P]

    and retreive.php will fetch content from hzzp://website-your-want-mirror.com/
    but I didn't test this before
     
    oburlaca, May 4, 2009 IP