• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1375
  • Last Modified:

CNAME for a directory

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
EaglePress
Asked:
EaglePress
  • 3
  • 3
  • 2
2 Solutions
 
humeniukCommented:
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
 
EaglePressAuthor Commented:
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
 
humeniukCommented:
"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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
periwinkleCommented:
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
 
humeniukCommented:
Oops.  Sorry.  Evidently, periwinkle is also our resident gender expert as well.  My face is red.
0
 
periwinkleCommented:
lol - it's a common mistake, and not one that I get upset over - not many female software engineers, even these days.
0
 
EaglePressAuthor Commented:
Thanks...I will give that a try.  I have also proposed another option to management.  I will keep you informed.
0
 
EaglePressAuthor Commented:
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

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now