Moving webserver, conserns

Discussion in 'Server Operation' started by raypettersen, Feb 7, 2008.

  1. raypettersen

    raypettersen New Member

    Hi

    I have a situation at work where we have to move one webserver with lots of websites, to a different network. I`ve connected the new network to the old one so that they can reach eachother. But the webserver is a real headache. I need some kind of rewrite rule, that will rewrite every request made to a new apache gateway, so that it points to the new server.

    Any help would be greatly appreciated.
     
  2. topdog

    topdog Active Member

    Why dont you use mod_proxy to proxy the requests to the new server instead or mod_rewrite ?
     
  3. raypettersen

    raypettersen New Member

    simply because the documentation is very extensive, and I have limited experience with this scenario.

    Could anyone please provide an example?

    I understand this can be done two ways. Directly in the vhost file, or with a .htaccess file?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    There are some examples for a moved web server here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html


    That's right.
     
  5. raypettersen

    raypettersen New Member

    Ok falco. Lets take an example up front.

    We have two webservers. One old, and one new.

    lets say the old server is called : oldws.domain1.com
    The new server is called : newws.domain2.com

    I move a website www.customer.com to newws.domain2.com, create a dns record; moved.customer.com, and point it to the new server.

    Then place a htaccess in the customers root directory with the following:

    RewriteEngine on
    RewriteRule ^/~(.+) http://moved.customer.com [R,L]

    ---

    Now if someone goes to the customers webpage www.customer.com, they will be redirected to moved.customer.com until they change their DNS record to the new webservers IP.

    I hope Im able to make sence. A bit complicated to explain.. =)

    will this method work?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Looks good. :)
     

Share This Page