Solved

CNAME for a directory

Posted on 2004-10-25
1,283 Views
Last Modified: 2013-12-20
Greetings experts,
I have been asked to provide the following for our web server.
A clients specific directory, we will call bigcompany, has a directory located on our webserver.  So when the client goes to the url:  server.domainname.net/bigcompany.
The bigcompany directory has all the site pages, etc that most web hosting server do.  Now the client wants to use their own server for hosting but still have the original url: server.domainname.net/bigcompany
Question: can this be configured using a CNAME?  If so what are the procedures.  I have configured a CNAME in the past but it was for a complete site not just a directory.  So previously i had something similar to this:
The url is w2.domainname.com which points via cname to www.otherserver.com.  And the url w2.domainname.com is always listed in the url address bar.  So the end user never knows that the site is on a different server.
Thanks of the help.
0
Question by:EaglePress
    8 Comments
     
    LVL 33

    Assisted Solution

    by:humeniuk
    You were able to use a DNS solution in the other case because you were forwarding a subdomain.  This won't work with a folder.  However, you can accomplish this by setting up a virtual directory on your web server within the server.domainname.net website that points the bigcompany directory to their own web server.  Essentially, DNS will continue to refer traffic to your web server, but the content for that particular folder will come from their web server.

    How to do this depends on what server platform you are using.  So, what are you using - Windows/IIS? Linux/Apache? Something else?

    For the record, I don't think this is an ideal solution.  For one thing, they will have two points of failure - if either web server goes down, their site will be unavailable.  It also results in more traffic and less efficiency.  It would be much preferable for them to get their own domain name (ie. bigcompany.com) or to use a subdomain (ie. bigcompany.domainname.net).  If they used their own domain name, you could put a permanent redirect on your website forwarding server.domainname.net/bigcompany to www.bigcompany.com.  You could leave the redirect in place as long as necessary to get the new domain name established.  If they used a subdomain, you could then use DNS to point server.domainname.net to your IP address and bigcompany.domainname.net to their IP address.  Again, you could set up a permanent redirect from server.domainname.net/bigcompany to bigcompany.domainname.net until people got the idea and updated their bookmarks, etc.
    0
     

    Author Comment

    by:EaglePress
    Thanks for the quick response.
    I FULLY agree with your opinion on the "for the record" portion of the response.  But the solution I outlined is what was requested so I must make it happen.  But for the record (on my part) it does cause more administrative headaches, more network traffic and slower performance.
    Now.
    We are using an apache web server.  I have never tried to confiure a virtual directory using apache, but have done this many times using IIS 5 & 6.  If you have any suggested guideline for configuring the apache virtual directory, i would greatly appreciate the assistance.
    0
     
    LVL 33

    Expert Comment

    by:humeniuk
    "But the solution I outlined is what was requested so I must make it happen."
    I understand the situation - have been in it myself.

    Unfortunately, I'm not that experienced with Apache, so I wouldn't want to advise you on this.  Periwinkle is the resident Apache expert in this TA and should be along soon.  I'm sure he'll be able to give you the details.
    0
     
    LVL 15

    Accepted Solution

    by:
    Thanks Andrew - I'm here, even if I'm a 'she', and not a 'he' ;) ....

    If I understand correctly, your client wants to 'forge' the urls to be on your server, when in fact they are actually coming from their own.  

    I suppose you could use a framing technique to frame the content under http://server.domainname.net/bigcompany - that way, the only url that they'd see would be http://server.domainname.net/bigcompany, unless, of course, they viewed the source, which would tell them where it was coming from.  An example of this would be:

    http://www.lochenphoto.com

    ... this user has their domain hosted on a server, but delivers the content from another server.

    Probably a bit more satisfying would be to use a reverse proxy  through mod_proxy:

    http://httpd.apache.org/docs-2.0/mod/mod_proxy.html

    From that page:

    "A reverse proxy" ... "appears to the client just like an ordinary web server. No special configuration on the client is necessary. The client makes ordinary requests for content in the name-space of the reverse proxy. The reverse proxy then decides where to send those requests, and returns the content as if it was itself the origin."

    0
     
    LVL 33

    Expert Comment

    by:humeniuk
    Oops.  Sorry.  Evidently, periwinkle is also our resident gender expert as well.  My face is red.
    0
     
    LVL 15

    Expert Comment

    by:periwinkle
    lol - it's a common mistake, and not one that I get upset over - not many female software engineers, even these days.
    0
     

    Author Comment

    by:EaglePress
    Thanks...I will give that a try.  I have also proposed another option to management.  I will keep you informed.
    0
     

    Author Comment

    by:EaglePress
    Thanks for the input.  My second proposal (option) to management worked.  Here is what I did, just in case, anyone needs feedback.
    Established a CNAME from our DNS to the other website name, not ip address.  Figured the registered domain name would be better in case the company ever changed ISP and received a new set of ip addresses.
    Next the offiste company created a directory to host their site.
    I registed a new domain name just for this and other sites that we will provide for future use.  This is the main reason for having the offsite server set up a directory instead of an actual dedicated site.
    so now, if a user keys: w2.myservername.net/directoryname they will actually go to www.offsiteservername/directoryname but the url will show w2.myservername.net/directoryname.
    I will split the points as all had some real good hints.  Thanks for the input.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    What is IRC? IRC (Internet Relay Chat) is a form of communication between multiple users. It is available freely to anyone with inernet access. IRC is a great way to communicate with others e.g. There is an IRC channel for Ubuntu Linux, which is fo…
    Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now