TB Posted March 27, 2003 Posted March 27, 2003 A great way to setup website(s) on a local windows server is to have them called by their own domain name. ie. http://www.yoursite.home rather than http://localhost/yoursite The following setup information is used: (Obviously change the required information if your setup differs slightly.) Windows NT/2000/XP - c:windows (XP) or c:winnt (NT/2000) Apache 1.3 or 2.0 - c:apache groupapache (Apache 1.3) or c:apache groupapache2 (Apache 2.0) PHP 4 - c:php Website directory - c:websites You will need to modify the following files: (These files can be modified with notepad or wordpad) c:windowssystem32driversetchosts (XP) c:winntsystem32driversetchosts (NT/2000) c:apache groupapacheconfhttpd.conf (Apache 1.3) or c:apache groupapache2confhttpd.conf (Apache 2.0) Add the following to your 'host' file: 127.0.0.1 localhost 127.0.0.2 www.yoursite.home NOTE: It's advisable to name your local site with the extension '.home' so it doesn't conflict with an existing domain name on the internet. If you name your local site with '.com' and try to load the real 'yoursite.com' you will get your local site since your computer searchs the 'hosts' file before searching for an internet DNS. If you have multiple sites, your need to add the next site to a new line. Example. '127.0.0.3 www.yourothersite.home' (Increment each new websites IP address by 1.) Add the following to your 'httpd.conf' file: (You will see information on 'Virtual Hosts' at the end of your 'httpd.conf' file.) <VirtualHost 127.0.0.2> ServerAdmin webmaster@locahost DocumentRoot c:/websites/yoursite DirectoryIndex index.php default.php index.fire index.html index.htm default.html default.htm ServerName www.yoursite.home ErrorLog logs/www.yoursite.home-error_log CustomLog logs/ranru.turningbase.home-access_log common ScriptAlias /cgi-bin/ c:/websites/yoursite/cgi-bin </VirtualHost> Restart your Apache service. (Can be done via to 'Apache monitor' or via the command line. Command line: 'c:apache groupapacheapache -k restart' (apache 1.3 or 'c:apache groupapacheapache -k restart' (Apache 2.0) Now you're ready to use your new domains. Example: 'http://www.yoursite.home' Hope this helps, Tony "The price of success is perseverance. The price of failure comes much cheaper."
mattice Posted March 27, 2003 Posted March 27, 2003 I moved this to the Tips & Tricks, seemed at home there :D "Politics is the art of preventing people from taking part in affairs which properly concern them"
Guest Posted April 2, 2003 Posted April 2, 2003 Hey Tony, that's an excellent tip! I have always known that you could do this, but have always been too much of a lazy bugger to work it out for myself. Thanks for the tip.
Guest Posted April 2, 2003 Posted April 2, 2003 Tony, great tip - this one should definately go into Wiki!! :D
TB Posted April 3, 2003 Author Posted April 3, 2003 Thanks for the feedback everyone! Makes it worthwhile documenting these things, knowing that it's helpful to others... Cheers, Tony "The price of success is perseverance. The price of failure comes much cheaper."
Guest Posted April 29, 2003 Posted April 29, 2003 I just wanted to add that if you have access to a WindowsNT DNS Server, you can also point a Forward Lookup Zone to the IP address of your local server. Just create a new Forward Lookup Zone with the domain name you want to use for the test site, such as: testsite.com Then add a New Host to the new Zone you just created, and point it to the IP of your test server: Host www 192.168.1.20 If other PCs on your network use this DNS server, then you've essentially created a little intranet, and everyone on the network can review your site by typing in testsite.com on their URLs. Works great for developing new sites in a corporate environment without waiting for external DNS changes to be made.
Guest Posted April 27, 2004 Posted April 27, 2004 Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you, Thank you !! I just spent about an hour looking for exactly this on the net !! As this topic hasn't been added to in a year i thought i would bump it !! Im implementing a mutlistore, multi domain system and now at least i can emulate my server ! Thanks again !
defender39 Posted April 27, 2004 Posted April 27, 2004 you can also get a neat package called phpdev that works well http://www.firepages.com.au/
blueline Posted April 28, 2004 Posted April 28, 2004 And any tips for those using IIS? Chris Sullivan
xzonex Posted April 28, 2004 Posted April 28, 2004 Great tips thanks! finally got my Oscommerce working locally. Thanks once again! :P
computernick Posted October 18, 2004 Posted October 18, 2004 will this work for legit domains as well? ive been having problems setting up two domains in apache and nothing ive tried so far will work. is this just for local lookup or does this work outside the local lan as well? meaning for name resolution. thanks nick
_doctor Posted October 18, 2004 Posted October 18, 2004 Excellent tip! Just yesterday I spent several hrs before discovering, that PHP setcookie just can't set cookie on localhost, it requires domain-like name :)
akkinmore Posted November 16, 2004 Posted November 16, 2004 Hi Can anyone help me? The above worked well before I installed Win Xp SP2. After installing SP2 on my PC, I can't access using www.mydomain.home. I can access http://localhost/phpmyadmin but not www.mydomain.home in other directory. my directory is under c:/website. Can anyone tell me what when wrong? Any help will be greatly appreciated. Thank you. :'(
mooncylde Posted February 8, 2005 Posted February 8, 2005 Hi Can anyone help me? The above worked well before I installed Win Xp SP2. After installing SP2 on my PC, I can't access using www.mydomain.home. I can access http://localhost/phpmyadmin but not www.mydomain.home in other directory. my directory is under c:/website. Can anyone tell me what when wrong? Any help will be greatly appreciated. Thank you. :'( <{POST_SNAPBACK}> I had the same problem! Was kinda desperate and nearly unstalled the SP2 :blink: but thank God.. (I prayed heh) Found the answer :lol: Download and install the following patch from Microsoft and the tips stated in this thread should work as usual. Microsoft Patch When in doubt, Pray! :thumbsup:
fatmcgav Posted February 17, 2005 Posted February 17, 2005 If anybody's in need to a good apache, php, mysql package, check out Apache2Triad This is a fantastic package, which contains everythin your guna need to get ure own server up n running, in one neat package. HTH Fatmcgav
rhubarb Posted September 18, 2005 Posted September 18, 2005 Anyone help me with Active Directory DNS please? I have a local Win2k3 server connected to a LAN which connectes to the internet via a router. I've setup Apache webserver on Win2k3 and configured for virtual hosts. Entering 10.0.0.3 in the browser address will take me to the wwwroot folder, and if I add a virtual host to the Apache config file then 10.0.0.3 takes me to the specified sub-folder of wwwroot, but I can't seem to setup dns so that entering a name eg http://website1 or http://website1.<win2k3_local_domain> will take me to the root of that virtual host. I see in DNS management that Forward Lookup zones can be added, but still can't get it to resolve a name in the browser address. Any clues please?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.