You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Blomstrom <da...@yahoo.com> on 2004/05/07 06:47:35 UTC
[users@httpd] Can you recommend some virtual host tutorials?
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.
I'm writing this partly to help me organize my
thoughts. From square one, I'm running Apache on
Windows XP and have several websites in a folder named
"sites" on my C drive. I THINK I want to convert all
my sites to name-based virtual hosts, but I want to
start by trying it on just a couple sites, geosymbols
and geoworld.
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:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP
for Windows.
#
# This file contains the mappings of IP addresses to
host names. Each
# entry should be kept on an individual line. The IP
address should
# be placed in the first column followed by the
corresponding host name.
# The IP address and the host name should be separated
by at least one
# space.
#
# Additionally, comments (such as these) may be
inserted on individual
# lines or following the machine name denoted by a '#'
symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com #
source server
# 38.25.63.10 x.acme.com # x
client host
127.0.0.1 localhost
127.0.0.1 geosymbols.mycomputer.com
* * * * * * * * * *
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
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?
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>
<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.
When I figure it out, I can just repeat the procedure
with other sites, like this - right?:
<VirtualHost *>
DocumentRoot c/sites/geosymbols
ServerName geosymbols.mycomputer.com
</VirtualHost>
<VirtualHost *>
DocumentRoot c/sites/geoworld
ServerName geoworld.mycomputer.com
</VirtualHost>
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?
Thanks.
__________________________________
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 <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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by Scott Haneda <li...@newgeo.com>.
on 05/07/2004 01:21 PM, David Benson at apache@bensonresearch.com wrote:
> David, please don't give up just because of one guys poorly worded opinion...
I did not quite mean he should give up, more just evaluate how much this is
all worth to him. I was getting the impression he was trying to learn how
to rebuild rotary engine, but would never even own a car. :-)
At any rate, I did give some examples that were the best I could guess
seeing as how I do not use Windows at all.
My posts were not meant to be harsh, if they came across that way, I
apologize.
--
-------------------------------------------------------------
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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by David Blomstrom <da...@yahoo.com>.
--- Scott Haneda <li...@newgeo.com> wrote:
> on 05/07/2004 02:09 PM, David Blomstrom at
> david_blomstrom@yahoo.com wrote:
Wow, thanks for all the tips, including those focusing
on security. My website has been hacked a few times,
which is one reason I decided to migrate away from
Microsoft (though I haven't escaped it on my desktop
yet).
So I eventually want to learn how to protect my
databases, include pages, etc.
I can see I have an awful lot to learn!
__________________________________
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 <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
Re: [users@httpd] WebDAV Blues
Posted by "John P. Dodge" <do...@cruciate.ca.boeing.com>.
On Fri, 7 May 2004, Richard Heintze wrote:
> We can access files in my WebDAV/Apache HTTPD server
> from
> (1) inside the fire wall with windows IE (we can read
> and write files)
> (2) inside a different fire wall (in a remote office)
> with Linux/Konquerer we can read files but we cannot
> figure out how write them with Linux/Konquerer
>
> We cannot even see the server from windows/IE from
> the remote office. We get a dialog box from IE that
> says "Internet explorer could not open up http://path
> as a web folder. Would you like to see the default
> view instead?"
>
> I thought this could not be a fire wall issue because
> we can browse the site using http/html with normal web
> browser. Does not Apache HTTPD/WebDAV use port 80?
>
> What is a good WebDAV client for Linux that would
> allow us to write files?
>
> Sieg
>
Yes WebDAV uses port 80.
Is there a HTTP method filter on the remote firewall?
Cadaver is a resonable WebDAV client for Linux (See:
http://www.webdav.org).
I have never used Konquerer but I suspect that is does not support WebDAV.
----------------------------------------
"Mon aéroglisseur est plein d'anguilles"
John P. Dodge
Boeing Shared Services
---------------------------------------------------------------------
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
[users@httpd] WebDAV Blues
Posted by Richard Heintze <si...@yahoo.com>.
We can access files in my WebDAV/Apache HTTPD server
from
(1) inside the fire wall with windows IE (we can read
and write files)
(2) inside a different fire wall (in a remote office)
with Linux/Konquerer we can read files but we cannot
figure out how write them with Linux/Konquerer
We cannot even see the server from windows/IE from
the remote office. We get a dialog box from IE that
says "Internet explorer could not open up http://path
as a web folder. Would you like to see the default
view instead?"
I thought this could not be a fire wall issue because
we can browse the site using http/html with normal web
browser. Does not Apache HTTPD/WebDAV use port 80?
What is a good WebDAV client for Linux that would
allow us to write files?
Sieg
__________________________________
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 <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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by Scott Haneda <li...@newgeo.com>.
on 05/07/2004 02:09 PM, David Blomstrom at david_blomstrom@yahoo.com wrote:
> In the meantime, I think I may have found a really
> simple workaround. All my site-root relative links are
> in a single include page. They look something like
> this:
>
> <a href="/geoworld/africa/kenya/index.php">Kenya</a>
>
> It suddenly occurred to me that I could solve this
> problem by simply replacing every instance of
> /geoworld/ with /www.geoworld.org/, publishing it
> online, then changing it back to /geoworld/ so it
> works on my local site. (I think.)
You don't want to do that at all, aside from being a extra step that is not
needed, it then gives you a point of failure if your local DNS system were
to ever break.
I think you are just not understanding some of the concepts of how sites in
general work. Let me try to explain:
Document root can be any arbitrary path you want, for example, you could
have something set up like this:
C:/myLocalApacheSites/www.geoworld.org
C:/myLocalApacheSites/www.example.org
C:/myLocalApacheSites/www.test.org
That is just a normal path to normal "folders" on your hard drive. So in a
folder called myLocalApacheSites, you would have 3 folders called
www.geoworld.org and www.example.org and www.test.org.
*Technically, I like to call them directories, but perhaps calling them
folders will help you get this a little more.
Each of the above 3 locations could be 3 separate websites you are
developing. You would have 3 virtual host listings in your apache config
file and three entries in your Hosts file as well.
We have not talked about your Index files, this is something you need to add
to a <Directory> block to make a certain file load as default, more on this
later if you need it. I think it may just confuse things at this point.
At the very simplest, you would need 3 virtual host settings to make the
above 3 sites work:
<VirtualHost *:80>
ServerAdmin you@example.com
DocumentRoot "C:/myLocalApacheSites/www.geoworld.org"
ServerName www.geoworld.org
</VirtualHost>
I think you can see what you would need to change to make the other 2 work.
Now, lets talk about the files that you have in the www.geoworld.org folder,
I will make some guesses, but you should be able to adapt this to your
files.
www.geoworld.org
index.php
page1.php
page2.php
page3.php
So in this case, you have 4 total files in your www.geoworld.org folder,
when you enter into your browser: http://www.geoworld.org/index.php Apache
will load the index.php.
This means that in respect to all your code, your topmost directory is
invisible, it is what is inside that folder that is document root.
Therefore, your HTML links and such as for your example, as best as I can
tell would look like this:
<a href="/africa/kenya/index.php">Kenya</a> which would load the following
page:
www.geoworld.org
africa
kenya <- index.php
To elaborate, in the Apache site root folder of www.geoworld.org, there
sould be another folder called africa, in that, anohter called kenya, and in
that a file called index.php.
I think since in all your examples your Document root was a folder called
geoworld, you were getting confused, you will never have the folder name of
document root in any of your HTML files, that folder is where it all starts
to cascade down from.
This may get a little confusing to you, but I feel worth mentioning. I do
not code in php, but I would assume this applies regardless.
I am sure you will have some included files in your php code, some may
contain sensitive data, like database usernames and passwords. In this
case, you may want to alter your directory structure some, to store the
included files OUTSIDE of Documents root, this way no one on the web can get
to these files. At least not easily.
So in the same examples above, You may want to change it a little by putting
for example, 2 folders into the C:/myLocalApacheSites/www.geoworld.org area.
Now you will have inside the www.geoworld.org folder, 2 more, for example,
one called includes and one called htdocs. Then you change your Apache
settings accordingly.
<VirtualHost *:80>
ServerAdmin you@example.com
DocumentRoot "C:/myLocalApacheSites/www.geoworld.org/htdocs"
ServerName www.geoworld.org
</VirtualHost>
So now, all your web accesable files are in "htdocs" and no one can get to
the "includes" folder. In your php files, you should be able to still
include the files into your web accessable files.
Hope that helps.
--
-------------------------------------------------------------
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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by David Blomstrom <da...@yahoo.com>.
--- David Benson <ap...@bensonresearch.com> wrote:
>
> David, please don't give up just because of one guys
> poorly worded opinion...
>
> I am a Linux user so I don't have a lot of
> experience with Apache on a Windows
> box but for kicks, I set up a Win2k Pro image and
> gave it a go... WinXP may
> give different results but we can sort them out if
> needed... Here is what I
> did, give it a try and let us know how it goes...
Wow, thanks for all the tips. I'll have to save all
the responses I received for my notes. But I'm not
sure if I'm ready to tackle it again right now. I've
been working on a huge project almost 24/7 for a long
time and am worn out just trying to learn PHP and
MySQL. I never meant to get sidetracked by Apache
until I learned that it might help me utilize a better
linking system. I began to have second thoughts at 2
a.m.!
It also looks like some of my problems might be solved
if I bite the bullet and learn how to work with
databases. I'm just having a tough time visualizing
how Apache, MySQL and PHP all work together.
In the meantime, I think I may have found a really
simple workaround. All my site-root relative links are
in a single include page. They look something like
this:
<a href="/geoworld/africa/kenya/index.php">Kenya</a>
It suddenly occurred to me that I could solve this
problem by simply replacing every instance of
/geoworld/ with /www.geoworld.org/, publishing it
online, then changing it back to /geoworld/ so it
works on my local site. (I think.)
So I need to go back to square one and ask why I need
virtual hosts in the first place. (I'll have to track
down the article I saw about the advantages of virtual
hosts.) It would be nice to simply have the skills to
do things like this. Do you have a hunch if most
professional website designers use virtual hosts? I'd
like to eventually try a little "reseller hosting,"
too, so I probably need to learn these things.
The amazing thing is I've been studying web design for
more than a year - virtually full-time - and I still
feel like an amateur; I've scarcely touched Apache,
MySQL and PHP. It's amazing how much there is to
learn.
Thanks again.
P.S. I'm a major Linux fan, even if I'm stuck with
Windows on my computer. I'd buy a Mac if I could
afford it. In the meantime, I'm hoping Linux will
conquer the desktop market and produce an affordable
alternative I can migrate to with minimum hassle and
expense. :)
__________________________________
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 <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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by David Benson <ap...@bensonresearch.com>.
David, please don't give up just because of one guys poorly worded opinion...
I am a Linux user so I don't have a lot of experience with Apache on a Windows
box but for kicks, I set up a Win2k Pro image and gave it a go... WinXP may
give different results but we can sort them out if needed... Here is what I
did, give it a try and let us know how it goes...
1. Installed a clean copy of Win2k on the machine (you don't need to do this)
2. Edited c:\winnt\system32\drivers\etc\hosts
- Added line: "127.0.0.1 dbdom-1.com"
- Added line: "127.0.0.1 dbdom-4.com"
3. Downloaded installer for Windows from apache.org (2.0.49, no SSL)
4. Ran the installer
- Entered a fake network domain (fake.com)
- Entered the machine name in the server name field (testbox1)
- Entered a fake email address for the server admin
5. Browsed to: c:\program files\Apache Group\Apache2
- Created folder: "virtualhosts" (just to be organized)
6. Browsed to: c:\program files\Apache Group\Apache2\virtualhosts
- Created folder: "dbdom-1.com"
- Created folder: "dbdom-4.com"
7. Created index.html files in each folder from step 6
- Make sure they output unique info so you can tell them apart!
8. Edited c:\Program Files\Apache Group\Apache2\conf\httpd.conf
For step 8, you need to scroll all the way to the bottom of the file and
locate the virtual hosts examples (they are commented out with #'s). Here is
what I changed mine to look like:
#---------------------- snip ----------------------
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@dbdom-1.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/virtualhosts/dbdom-1.com"
ServerName dbdom-1.com
ErrorLog logs/dbdom-1.com-error_log
CustomLog logs/dbdom-1.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dbdom-4.com
DocumentRoot "C:/Program Files/Apache Group/Apache2/virtualhosts/dbdom-4.com"
ServerName dbdom-4.com
ErrorLog logs/dbdom-4.com-error_log
CustomLog logs/dbdom-4.com-access_log common
</VirtualHost>
#-------------------- end snip ----------------------
Save the file and restart Apache (click on the Apache icon in the task tray,
choose "restart" from the flyout menus)...
After all that was done, I was able to open a browser and get to each site
using http://dbdom-1.com and http://dbdom-4.com ...
You were on the right track in wanting to learn about virtual hosting and I
think you should keep working at it until you get one working on your
machine. Try reproducing my steps and let the list know if you hit any
issues... There are a lot of good people that watch this list who will try
to help you out...
-DBenson
On Friday 07 May 2004 7:29 am, Laura Vance wrote:
> Hello David,
>
> Please forgive me if any of these comments seem harsh, they are
> absolutely not intended to be, but it's hard to make text sound
> "sympathetic".
>
> After reading this whole thread this morning, it seems to me that you
> were expecting to move mountains with a spoon. The people that you
> talked to that said it's only a few minutes to get it set up were
> right.... if you are comfortable working with Apache configuration and
> if you completely understand how paths and OS stuff work. The first
> time I set up a virtual host, it took a few minutes just to learn how to
> do it, but I already 100% understood all of the related technologies (my
> OS paths, DNS, the concept of document root, etc). I'm not saying that
> you don't understand them, but in this context something confused you.
>
> The virtual host situation you described that you wanted to set up
> honestly didn't sound that difficult, but in your first email (as
> someone else pointed out), you were all over the place with assumptions
> that you tried to make the list responses "fit" into a predetermined way
> of thinking. If that is not true, then it is only how it appeared in
> your emails (again, in text it's hard to tell intent beyond words).
>
> I feel that it is unfortunate that you gave up so quickly on learning a
> new thing. If I had given up so easily, I wouldn't know 1/4 of the
> things that I know now. The first time I installed apache, it was on an
> Amiga4000 computer back in 1997, and I couldn't get any help at all,
> because the computer itself was so uncommon that people who knew the
> software couldn't help me configure it for my OS. I think it took me a
> week or so to get the details worked out, but that learning process has
> made it easier for every Apache configuration that I have done since then.
>
> In case anyone is wondering why I responded to this on the list instead
> of off the list, it's because I know that those of us who have figured
> these things out on our own sometimes get impatient with people who
> aren't willing to research on their own (and yes, possibly make mistakes
> along the way, everyone does). I'm included in that group sometimes,
> but it's not from a lack of desire to help, it's from an unwillingness
> to try to figure out what you really wanted to know. Most of the
> problems that arise on any list is when the person asking the question
> doesn't really understand what they want to know. Every day in my job,
> I have to tell people what they really meant to ask me, because they
> have the best intentions of making informed statements, but they end up
> sounding like they're trying to impress me with their knowledge. As a
> result, their real request gets all muddled. Every time I've started to
> ask a question on this list, I start to type the email, then I think
> wether or not I want someone to belittle me if in my reading of the
> docs, I missed the 1 line that could've helped me. It has happened
> before in other forums, and then someone says "RTFM" when I already did,
> then they copy and paste the section of the doc that describes what I
> wanted to know... I go back and read the doc and there it is in black
> and white, and I remember reading it, but I took it out of context. We
> are all human, and for people answering questions, we sometimes forget
> that others might miss the 1 line that would have made it click for
> them... or the frame of mind when they read it made it appear to mean
> something else.
>
> In case you're wondering, yes I'm almost afraid to ask questions on
> lists sometimes, because if you catch someone in the wrong mood, they
> will belittle you to no end. I've even erased and not sent some of my
> own responses if it seems like it's coming across as arrogant. Even if
> I'm fairly confident that what I say could help. Lists are definitely
> their own world.
>
> Again, I apologize if this came across as harsh, it was not intended to
> be that way.
>
> David Blomstrom wrote:
> >--- Scott Haneda <li...@newgeo.com> wrote:
> >>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.
> >
> >Well, I guess I'll take your advice. I just lost
> >contact with all my websites, so I'm going to undo
> >everything I did and abandon this experiment.
> >
> >Thanks.
---------------------------------------------------------------------
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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by Laura Vance <va...@winfreeacademy.com>.
Hello David,
Please forgive me if any of these comments seem harsh, they are
absolutely not intended to be, but it's hard to make text sound
"sympathetic".
After reading this whole thread this morning, it seems to me that you
were expecting to move mountains with a spoon. The people that you
talked to that said it's only a few minutes to get it set up were
right.... if you are comfortable working with Apache configuration and
if you completely understand how paths and OS stuff work. The first
time I set up a virtual host, it took a few minutes just to learn how to
do it, but I already 100% understood all of the related technologies (my
OS paths, DNS, the concept of document root, etc). I'm not saying that
you don't understand them, but in this context something confused you.
The virtual host situation you described that you wanted to set up
honestly didn't sound that difficult, but in your first email (as
someone else pointed out), you were all over the place with assumptions
that you tried to make the list responses "fit" into a predetermined way
of thinking. If that is not true, then it is only how it appeared in
your emails (again, in text it's hard to tell intent beyond words).
I feel that it is unfortunate that you gave up so quickly on learning a
new thing. If I had given up so easily, I wouldn't know 1/4 of the
things that I know now. The first time I installed apache, it was on an
Amiga4000 computer back in 1997, and I couldn't get any help at all,
because the computer itself was so uncommon that people who knew the
software couldn't help me configure it for my OS. I think it took me a
week or so to get the details worked out, but that learning process has
made it easier for every Apache configuration that I have done since then.
In case anyone is wondering why I responded to this on the list instead
of off the list, it's because I know that those of us who have figured
these things out on our own sometimes get impatient with people who
aren't willing to research on their own (and yes, possibly make mistakes
along the way, everyone does). I'm included in that group sometimes,
but it's not from a lack of desire to help, it's from an unwillingness
to try to figure out what you really wanted to know. Most of the
problems that arise on any list is when the person asking the question
doesn't really understand what they want to know. Every day in my job,
I have to tell people what they really meant to ask me, because they
have the best intentions of making informed statements, but they end up
sounding like they're trying to impress me with their knowledge. As a
result, their real request gets all muddled. Every time I've started to
ask a question on this list, I start to type the email, then I think
wether or not I want someone to belittle me if in my reading of the
docs, I missed the 1 line that could've helped me. It has happened
before in other forums, and then someone says "RTFM" when I already did,
then they copy and paste the section of the doc that describes what I
wanted to know... I go back and read the doc and there it is in black
and white, and I remember reading it, but I took it out of context. We
are all human, and for people answering questions, we sometimes forget
that others might miss the 1 line that would have made it click for
them... or the frame of mind when they read it made it appear to mean
something else.
In case you're wondering, yes I'm almost afraid to ask questions on
lists sometimes, because if you catch someone in the wrong mood, they
will belittle you to no end. I've even erased and not sent some of my
own responses if it seems like it's coming across as arrogant. Even if
I'm fairly confident that what I say could help. Lists are definitely
their own world.
Again, I apologize if this came across as harsh, it was not intended to
be that way.
David Blomstrom wrote:
>--- Scott Haneda <li...@newgeo.com> wrote:
>
>
>
>>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.
>>
>>
>
>Well, I guess I'll take your advice. I just lost
>contact with all my websites, so I'm going to undo
>everything I did and abandon this experiment.
>
>Thanks.
>
>
>
--
Thanks,
Laura Vance
Systems Engineer
Winfree Academy Charter Schools, Data-Business Office
1711 W. Irving Blvd. Ste 310
Irving, Tx 75061
Web: www.winfreeacademy.com
---------------------------------------------------------------------
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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by David Blomstrom <da...@yahoo.com>.
--- Scott Haneda <li...@newgeo.com> wrote:
> 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.
Well, I guess I'll take your advice. I just lost
contact with all my websites, so I'm going to undo
everything I did and abandon this experiment.
Thanks.
__________________________________
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 <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
Re: [users@httpd] Single file to be served irrespective of the url
Posted by Aurélien DEHAY <au...@ext.anpe.fr>.
mseethar wrote:
> Hi folks,
Hello.
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
Use 404 document error for serving this file
Rgds.
--
Aurélien DEHAY
---------------------------------------------------------------------
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
RE: [users@httpd] Single file to be served irrespective of the url
Posted by Chris <li...@leftbrained.org>.
I have a Server which all the content pages are being handled through a
single php file, except for javascript,css, and images. This is what the
config looks like:
AliasMatch ^/(js|css|images)/(.*) /usr/local/apache/vhosts/admin/root/$1/$2
AliasMatch ^/(.*)$
/usr/local/apache/vhosts/admin/root/main.php/$1
if the URL starts with /js/ ,/css/, or /images/ It will just pass it
through. You could have any number of these before your all-encompassing
AliasMatch.
I really don't *know* that this is the best thing. I'm not familiar with
mod_rewrite overhead as opposed to mod_alias overhead, though it seems that
AliasMatch would be faster than mod_rewrite, even though it does a regular
expression match every request.
Chris
-----Original Message-----
From: Tim Burden [mailto:tim@burden.ca]
Sent: Friday, May 07, 2004 9:29 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Single file to be served irrespective of the
url
Hi Chris,
That one looks interesting. Is it better than the mod_rewrite option? And,
is there an easy way to make it NOT apply to certain files, as in
RewriteEngine on
RewriteCond %{REQUEST_URI} !/photo.php
RewriteRule .* index.php
----- Original Message -----
From: "Chris" <li...@leftbrained.org>
To: <us...@httpd.apache.org>
Sent: Friday, May 07, 2004 11:20 AM
Subject: RE: [users@httpd] Single file to be served irrespective of the url
> AliasMatch ^(.*)$ /usr/local/apache/htdocs/catalog.html
>
> Is what I would use, I *definitely* wouldn't try to use the ErrorDocument,
> since those send Error headers as well.
>
> Chris
>
> -----Original Message-----
> From: mseethar [mailto:mseethar@employees.org]
> Sent: Friday, May 07, 2004 4:15 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Single file to be served irrespective of the url
>
>
> Hi folks,
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
>
> Thanks,
> - Madhu
>
>
> ---------------------------------------------------------------------
> 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
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
Re: [users@httpd] Single file to be served irrespective of the url
Posted by Tim Burden <ti...@burden.ca>.
Hi Chris,
That one looks interesting. Is it better than the mod_rewrite option? And,
is there an easy way to make it NOT apply to certain files, as in
RewriteEngine on
RewriteCond %{REQUEST_URI} !/photo.php
RewriteRule .* index.php
----- Original Message -----
From: "Chris" <li...@leftbrained.org>
To: <us...@httpd.apache.org>
Sent: Friday, May 07, 2004 11:20 AM
Subject: RE: [users@httpd] Single file to be served irrespective of the url
> AliasMatch ^(.*)$ /usr/local/apache/htdocs/catalog.html
>
> Is what I would use, I *definitely* wouldn't try to use the ErrorDocument,
> since those send Error headers as well.
>
> Chris
>
> -----Original Message-----
> From: mseethar [mailto:mseethar@employees.org]
> Sent: Friday, May 07, 2004 4:15 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Single file to be served irrespective of the url
>
>
> Hi folks,
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
>
> Thanks,
> - Madhu
>
>
> ---------------------------------------------------------------------
> 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
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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
RE: [users@httpd] Single file to be served irrespective of the url
Posted by Chris <li...@leftbrained.org>.
AliasMatch ^(.*)$ /usr/local/apache/htdocs/catalog.html
Is what I would use, I *definitely* wouldn't try to use the ErrorDocument,
since those send Error headers as well.
Chris
-----Original Message-----
From: mseethar [mailto:mseethar@employees.org]
Sent: Friday, May 07, 2004 4:15 AM
To: users@httpd.apache.org
Subject: [users@httpd] Single file to be served irrespective of the url
Hi folks,
I have a requirement to configure the apache to serve a file
called catalog.html, irrespective of the url that is being requested.
Could somebody help me out how to do this?
Thanks,
- Madhu
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
Re: [users@httpd] Single file to be served irrespective of the url
Posted by Tim Burden <ti...@burden.ca>.
Using mod_rewrite:
RewriteEngine on
RewriteRule .* catalog.html
Using Redirect:
RedirectMatch .* http://yoursite/catalog.html
(very inefficient)
But using the custom ErrorDocument as suggested is possibly most efficient.
----- Original Message -----
From: "John Ellingsworth" <je...@mail.med.upenn.edu>
To: <us...@httpd.apache.org>
Sent: Friday, May 07, 2004 8:55 AM
Subject: RE: [users@httpd] Single file to be served irrespective of the url
> Are you using a scripting language?
>
> You could write (depending on your script language)
>
> If (!($thispage)) == "catalog.html"
> {
> <META HTTP-EQUIV=Refresh CONTENT="0; URL=http://mywebsite/catalog.html">
> }
>
> I unfortunately don't know the apache answer :(
> Sorry.
>
> Thanks,
>
> John Ellingsworth
> http://mail.med.upenn.edu/~jellings/
> AIM: vc2000support
>
> -----Original Message-----
> From: mseethar [mailto:mseethar@employees.org]
> Sent: Friday, May 07, 2004 7:15 AM
> To: users@httpd.apache.org
> Subject: [users@httpd] Single file to be served irrespective of the url
>
>
> Hi folks,
> I have a requirement to configure the apache to serve a file
> called catalog.html, irrespective of the url that is being requested.
> Could somebody help me out how to do this?
>
> Thanks,
> - Madhu
>
>
> ---------------------------------------------------------------------
> 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
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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
RE: [users@httpd] Single file to be served irrespective of the url
Posted by John Ellingsworth <je...@mail.med.upenn.edu>.
Are you using a scripting language?
You could write (depending on your script language)
If (!($thispage)) == "catalog.html"
{
<META HTTP-EQUIV=Refresh CONTENT="0; URL=http://mywebsite/catalog.html">
}
I unfortunately don't know the apache answer :(
Sorry.
Thanks,
John Ellingsworth
http://mail.med.upenn.edu/~jellings/
AIM: vc2000support
-----Original Message-----
From: mseethar [mailto:mseethar@employees.org]
Sent: Friday, May 07, 2004 7:15 AM
To: users@httpd.apache.org
Subject: [users@httpd] Single file to be served irrespective of the url
Hi folks,
I have a requirement to configure the apache to serve a file
called catalog.html, irrespective of the url that is being requested.
Could somebody help me out how to do this?
Thanks,
- Madhu
---------------------------------------------------------------------
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
---------------------------------------------------------------------
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
[users@httpd] Single file to be served irrespective of the url
Posted by mseethar <ms...@employees.org>.
Hi folks,
I have a requirement to configure the apache to serve a file
called catalog.html, irrespective of the url that is being requested.
Could somebody help me out how to do this?
Thanks,
- Madhu
---------------------------------------------------------------------
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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by David Blomstrom <da...@yahoo.com>.
--- Scott Haneda <li...@newgeo.com> wrote:
"You don't seem to understand the basics of DNS . . .
"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."
Yes, I find DNS really confusing. The remote DNS
probably doesn't concern me; I already have websites
hosted online, and that's all been taken care of. I'm
just trying to get a system set up that will function
locally.
"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."
Let me briefly explain why I'm wrestling with virtual
hosts. I already have several websites hosted with
webhosts that offer PHP and MySQL. I'm just beginning
to learn PHP - mostly using PHP includes and echo
functions.
I've been trying to develop a linking system that
really works for me. In fact, I've spent the last
several days studying tutorials and asking questions
on various newsgroups, until someone suggested I try
site-root relative linking. I gave it a try, and it
looks like it may be the ticket. However, they told me
it will only work on my local sites - not online.
Apparently, the "root" of alll my websites is the
folder that contains all of them, "sites."
If I understand it correctly, I need to give each
website its own identity by making it a virtual host.
Then I'll be able to use relative and absolute links
(as I do now), plus I'll have the ability to create
site-root links that will still work when I publish my
sites online.
I was told it's a really simple process that I can do
in minutes, but I've been wrestling with it all day. I
suspect your advice is best - forget about it!
However, after spending so much time on it, I'd like
to create one virtual host just to check it out. If it
doesn't work out, I assume I can just "uncreate" it.
"So I would bet you need to use:
DocumentRoot "C:\sites\geosymbols"
OK, I'll give that a try. Thanks for the tips!
__________________________________
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 <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
Re: [users@httpd] Can you recommend some virtual host tutorials?
Posted by Scott Haneda <li...@newgeo.com>.
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