httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Haneda <li...@newgeo.com>
Subject Re: [users@httpd] Can you recommend some virtual host tutorials?
Date Fri, 07 May 2004 06:57:52 GMT
Perhaps you could post only one topic and not be all over the place, you
have several emails, all related, why not keep it all in one thread?

on 05/06/2004 09:47 PM, David Blomstrom at david_blomstrom@yahoo.com wrote:

> Holy cow, I thought this was supposed to be a simple
> procedure, but Apache's documentation is extremely
> confusing! I've pieced parts of the puzzle together by
> asking questions on this newsgroup and several other
> forums.

Apache's docs are fine, you are just trying to learn too much at once.  You
don't seem to understand the basics of DNS, which is what your problem is,
this is not a Apache problem, or a problem with Apache docs, it is a problem
in that you do not understand DNS.

> I've accomplished three things so far:
> 
> 1) I opened the file
> C:WINDOWS/systeme32/drivers/etc/host and changed it so
> it looks like this:
> 127.0.0.1       localhost
> 127.0.0.1 geosymbols.mycomputer.com

We really do not need to see your hosts file in full, probably most wont
want to see it at all.  At any rate, we would just need the important lines.
There is nothing special going on in this file, it is just mapping hostnames
to IP addresses, just like the entire internet does.  You have local DNS,
provided by the hosts file, and remote DNS, provided probably by your ISP,
when you type in google.com your computer consults the hosts file, since
there is no entry for google.com it consults your ISP's DNS server, which in
turn returns a IP address and send you to the site.


> How much latitude do I have in creating these names?
> Could I replace geosymbols.mycomputer.com with
> geosymbols.mycomputer or just "geosymbols"? And if I
> want to change more websites to virtual hosts, I'd
> just do this, right?:
> 
> 127.0.0.1       localhost
> 127.0.0.1 geosymbols.mycomputer.com
> 127.0.0.1 geoworld.mycomputer.com

As much as you want, you could in theory do this:
127.0.0.1 google.com

Now, anytime you type in google.com you will be requesting your own machine,
so you could if you wanted, develop your sites under the google.com domain
name, not that you would want to, I am just illustating what you can do.

So at this point, so far, there is nothing wrong with Apache, this is just
DNS stuff that you need to learn.

I really don't know why you are going through all this trouble, if you are
not planning on running a website on your own, this really does you no good
to fuss with all this, get a 9.00 a month php and mysql account and never
look back.

> 2) I opened my Apache httpd file and changed
> #NameVirtualHost to NameVirtualHost *
> 
> That just clears the way for creating virtual hosts -
> it won't affect my other websites, right?

More or less, yes, you can bind a certain virtual host to a certain IP
address, that is beyond the scope of what you need to know.

> 3) In the httpd file, I plugged in the ServerName I
> created:
> 
> #
> # VirtualHost example:
> # Almost any Apache directive may go into a
> VirtualHost container.
> # The first VirtualHost section is used for requests
> without a known
> # server name.
> #
> #<VirtualHost *>
> #    ServerAdmin webmaster@dummy-host.example.com
> #    DocumentRoot /www/docs/dummy-host.example.com
> #    ServerName dummy-host.example.com
> #    ErrorLog logs/dummy-host.example.com-error_log
> #    CustomLog logs/dummy-host.example.com-access_log
> common
> #</VirtualHost>

I already have a copy of the virtual host examples, I really don't need to
see them again :-)

> <VirtualHost *>
>   DocumentRoot c/sites/geosymbols
>   ServerName geosymbols.mycomputer.com
> </VirtualHost>
> 
> Now I'm just trying to figure out what to type in for
> a DocumentRoot. I checked Apache's documentation and
> several tutorials, but I don't see anything that
> applies to my situation. c/sites/geosymbols is my best
> guess so far.

Are you serious?  I never have used Windows before, I have no idea how the
windows paths work, on unix it is /Path/Path/geosymbols, I did one google
search for 
<http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&q=windows
+apache+DocumentRoot++&btnG=Search>  The first link shows:
 DocumentRoot "C:\Documents and Settings\Admin\Desktop\www"
So I would bet you need to use:
DocumentRoot "C:\sites\geosymbols

Just a guess, I really have no idea, it is really up to you to know how your
filesystem finds files, not Apache or the docs.

Your situation is not unique, just post a message asking "what is the
correct way to define a path for doc root in apache on windows".  You would
get a number of correct answers I bet.

> When I figure it out, I can just repeat the procedure
> with other sites, like this - right?:

Yes.

> And when everything's squared away, I can restart my
> computer, and geosymbols and geoworld will be
> converted to virtual hosts, which will function pretty
> much as before, but they'll allow me to use site-root
> relative links that will work both on my computer and
> online?

That depends on how you code your HTML or whatever, but more or less, yes.
-- 
-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
http://www.newgeo.com                       Fax: 313.557.5052
scott@newgeo.com                            Novato, CA U.S.A.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Mime
View raw message