homepage Welcome to WebmasterWorld Guest from 54.197.19.35
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
Setting up a test server to mirror my hosting service
How do I set up a test server for multiple TLDs, subdomains, and subdirs
RKramkowski




msg:3194155
 4:48 am on Dec 20, 2006 (gmt 0)

Hi, I'm real new to this and want to learn the ins and outs of the technology so I opted to install everything from scratch.

On my local PC (running XP Pro), I've installed Apache 2.2.3, PHP 5.2.0, phpMyAdmin 2.9.1., and mySQL 5.0.22. I had no problem getting them up and running together. I'm also running Dreamweaver 8.2. IIS is disabled.

I own several top level domains and want to set up several domains on my test server, with various combinations of subdomains and subdirectories. Some will be ecommerce sites, some forums, and some blogs. The forums and blogs are likely to be subdiretories off my TLDs (e.g., www.mysite.com/blog) whereas the subdomains are more for the ecommerce sites to segregate product types (e.g., chevy.carparts.com, ford.carparts.com).

I've dug into various forums, books, etc. and still am not sure how to set up the structure in Apache. I've found bits and pieces but they all don't even agree with each other and sometimes seem to conflict. I want the structure to duplicate the host server and so started with the htdocs directory at the root level (i.e., c:/htdocs). I know localhost is my local host and that will be part of the URL for my test sites. I think I have to set up a virtual host for each TLD but what about the subdomains and subdirectories? What should my directory structure look like for the above car directories? What about if I add a subdirectory for a forum to one of them (e.g., ford.carparts.com/fordforum)?

Do I use URL redirection so the URL I type in on my local test server matches that of my hosting service? I want to be able to use the features of Dreamweaver to FTP from my test servers to the host servers and don't want to have the paths get out of synch when I FTP to the host. And I know that once the Apache directories are set up, I'll have to define the structure to Dreamweaver... but one thing at a time.

Thanks for any advice.

Bob

 

Mathieu Bonnet




msg:3195990
 4:23 pm on Dec 21, 2006 (gmt 0)

>
> I know localhost is my local host and that will be part of the URL
> for my test sites. I think I have to set up a virtual host for each
> TLD but what about the subdomains and subdirectories?
>

You are not forced to use "localhost" as the domain name. You can use anything.

Check [support.microsoft.com...] section "Adding Static Clients to the Hosts File".

Simply, edit the file "%SystemRoot%\System32\Drivers\Etc\Hosts", with the notepad, and add something like:

127.0.0.1 your-domain.tld.test
127.0.0.1 subdomain1.your-domain.tld.test
127.0.0.1 subdomain2.your-domain.tld.test

(you can replace "127.0.0.1", by your local network, or Internet IP address, if your Apache server is bound to these IP addresses...)

Now, in Apache, create virtual hosts, and use the "ServerName" directive, to specify which domain to use, for the current virtual host, like "subdomain1.your-domain.tld.test", and you will be able to use "http://subdomain1.your-domain.tld.test/", in your Web browser.

For directories, I don't understand what you need. Can't you simply put the blog in "htdocs/blog/", and the forum, in "htdocs/forum"? There is no Apache configuration needed for this (you might have to configure the blog/forum, to specify their URL path, "/blog", and "/forum", if they do not detect it automatically).

[edited by: Mathieu_Bonnet at 4:26 pm (utc) on Dec. 21, 2006]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved