Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 46997 invoked from network); 6 May 2004 23:08:55 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 May 2004 23:08:55 -0000 Received: (qmail 55369 invoked by uid 500); 6 May 2004 23:08:30 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 55355 invoked by uid 500); 6 May 2004 23:08:30 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 55340 invoked from network); 6 May 2004 23:08:29 -0000 Received: from unknown (HELO web60404.mail.yahoo.com) (216.109.118.187) by daedalus.apache.org with SMTP; 6 May 2004 23:08:29 -0000 Message-ID: <20040506230033.99208.qmail@web60404.mail.yahoo.com> Received: from [206.63.151.215] by web60404.mail.yahoo.com via HTTP; Thu, 06 May 2004 16:00:33 PDT Date: Thu, 6 May 2004 16:00:33 -0700 (PDT) From: David Blomstrom To: users@httpd.apache.org Cc: david_blomstrom@yahoo.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] Can you straighten me out? ( X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I installed Apache, PHP and MySQL on my computer a few months ago, using a preconfigured package from "Apache Friends." I learned just enough about Apache to get everything up and running and have just been focusing on PHP since then. However, I just discovered that I may need to change my configuration; or maybe it wasn't really right to begin with. For whatever it's worth, I'm using Dreamweaver and have all my sites in a folder named sites. Thus, the path to my site named Geobop is C:/sites/geobop, and the path to GeoWorld is C:/sites/geoworld When I preview a page from one of my sites, it looks something like this: http://localhost/geoworld/index.php I thought that was the "standard" and most highly recommended configuration. But I've been trying to figure out a better linking system, asking questions on Dreamweaver and PHP forums, and a couple people told me I should change my configuration, especially if I want to work with site-root relative links. Basically, I want to be able to insert a link that looks something like this: /geoworld/images/bird.gif and it will work both on my local sites and online. If I understand them correctly, my local URL should look like http://geoworld/index.php, rather than http://localhost/geoworld/index.php I was also advised to make a LOCAL subdomain for my images. I appended some instructions I was given for making the necessary changes, with links to some Apache tutorials. But before I take the plunge, I just wanted to solicit some advice from this list. Does it sound like I'm doing the right thing? Do most of the pros preview their sites as http://localhost/geoworld or http://geoworld ? I'd especially like to know if messing with Apache might somehow mess up MySQL or PHP. They should be unaffected, right? I'll start reading up on this stuff now. I was just hoping to get some feedback from people who might catch me before I do something stupid. Thanks! * * * * * * * * * * >>How do you create a sudbomain locally, Depends on the server. I assume you run an Apache (if not, then you have to look at the manual or some HowTos in the web), so you can do it with the VirtualHost option in the httpd.conf file. Two things are necessary, first: NameVirtualHost 127.0.0.1 http://httpd.apache.org/docs/mod/core.html#namevirtualhost This enables name-based virtual hosts for the given IP (could also be a * to match all IPs). The second are the settings for the virtual host itself (there are some more for configuring logfiles etc.): DocumentRoot /path/to/your/website/folder ServerName geoworld.localhost http://httpd.apache.org/docs/mod/core.html#virtualhost This enables Apache to redirect all requests for geoworld.localhost to the given DocumentRoot (the directory that contains the pages, images, etc.). After restarting Apache it should be listening for requests for that new virtual server (actually it doesn't have to be a subdomain to localhost, you can choose whatever name you like). Now only one thing is missing - the OS knows nothing about the "new" server, you have to edit the hosts-file, on W2k it's located in \WINNT\system32\drivers\etc. This file contains nothing but the line 127.0.0.1 localhost by default. Simply add another line with the IP and name of your new virtual server: 127.0.0.1 geoworld.localhost Now when you enter http://geoworld.localhost in your browser, Windows looks up the IP-address and sends the request to the server, Apache recognizes the name geoworld.localhost and redirects to the configured virtual host directory. Sounds more complicated than it actually is. Now you have two ways for accessing your local website: http://localhost/geoworld/ http://geoworld.localhost/ The difference is small, but important: The first is only a directory below the domain root, while the latter is a "real" domain, allowing site-root links. >>So if I create a LOCAL subdomain, then publish it online, I'll get the >>proper URL instead of http://geoworldNA.localhost? Yes, links like "/images/foo.gif" will work locally and online. __________________________________ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org