You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dwayne Miller <dm...@espgroup.net> on 2002/12/31 15:57:18 UTC

[users@httpd] Apache on Windows with remote document root

Hi all,

I'm trying to switch an Apache (2.0.43) configuration to use a mapped 
drive as the document root.  Once I do that, Apache will not start as a 
service... it returns with a system error of 1.  Nothing is logged in 
the Apache log files.  If I edit the config file and change it back to 
the local filesystem... all works fine.  When I start Apache from the 
command line, using the mapped drive as the document root, it seems to 
start okay.

Does Apache work with a mapped drive as the document root?

Tks
Dwayne


---------------------------------------------------------------------
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] Totally new

Posted by Gary Turner <kk...@sbcglobal.net>.
William Martin wrote:

>Hi folks,
>
>I am new to the world of http server. I have played with it some in the past
>but have always ended up being frustrated. I have a question that I really
>need some help on. My home computer with Windows 2000 Pro is connected to a
>cable modem as well as two other computers.  The cable is route to a Terayon
>modem and then from there,  it's routed to the Ethernet Cable/DSL router on
>to these three computers. Is there any way that I can set it up to allow
>users from Internet to view the website on my home computer?  Any help would
>be greatly appreciated. Thanks!

First, when starting a new question/thread, don't 'reply'.  Instead,
start a new message (you are buried in the thread you replied to).

Second, the question is kinda open-ended--see
http://www.tuxedo.org/~esr/faqs/smart-questions.html

Third, the short answer is yes :)

You don't tell us a lot, but we can guess that the router performs
network address translation.  In that case, you need to set rules on the
router to forward port 80 requests to the proper machine on the LAN.
You'll need to RTFM on your router.

Do you have a registered domain name?  A fixed IP addy?  Using a dynamic
dns?  In other words, how does anyone reach you?
--
gt                  kk5st@sbcglobal.net
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

---------------------------------------------------------------------
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] Totally new

Posted by Paul Erkens <pj...@xs4all.nl>.
Hi William,

First of all: welcome to this group. I hope you will enjoy apache as much as
we all do here.

I understand your frustration. I've had that same beginner experience
myself. Linux people are very technically developed in mind and because it
is impossible for you to interrupt someone while he is explaining something
to you, the answers still sound rather technical. During the answer there
are mostly 3 or 4 terms which are new to you, but daily business for the one
who is teaching you. But we'll all try our best to get you going. Below is a
simple explanation for your question to the best of my knowledge. I've
written several manuals that float elsewhere on the internet for beginners
like you and me and as soon as I get the hang of the most common features of
apache, I'll make a simple document that explains windows users how things
have been put together.

To answer your question, a bit of background is required. Not as much as
I'll give you here, but it will put the rest in context for a better
understanding.

If I'm not mistaken, your win2k machine is attached to a cable modem which,
in turn, is connected to a router that, in turn has been connected to the
internet. You can surf out to the net, but what you want is to accept
incoming requests to your http server.

Normally, the task of your cable modem is to listen to your machine's
network card, and transmit everything from your machine out to the internet.
Data that comes from the internet however, will not always end up in your
machine. More on this below.

Like both you and me must write in English to understand eachother, your
win2k machine's network card uses a "language" to talk to your cable modem.
What we call a language, is called a protocol for our computers. Just as
there are many natural languages, there are many protocols out there. What
we call English, is called tcp/ip for our computers.

A natural language consists of single words. The tcp/ip counterpart of a
written word is called a tcp packet. So just as words make up a language,
tcp packets make up the data traffic that goes from your computer to your
modem and the internet, and vice versa. Virtually all internet traffic is
done using the tcp/ip language (protocol). Wether you ask a website to send
a page of information to you or you send and receive email, all that data is
devided into short tcp/ip packets. The idea behind it resembles a normal
letter that you can post to someone else. Each tcp/ip packet (a bit of your
email or part of your request to a server to open an internet page) has e
digital envelope around it. The envelope contains several important things
of which I'll mention a few:

1: the digital address of the sender (your machine). This is necessary for
the computer that receives your packets, in order to be able to return you
the answering packets. If you send it your request to open an internet page,
then the recipient returns a stream of packets to you containing the
information you requested.

2: The digital destination address (the machine that you want to receive
your packets).

3: The source port (data port on your machine from which you sent out your
packet).

4: The destination port (the data port on the receiving computer for which
you have intended your packet.

IP addresses

Just like your house is made unique in the phone book using your street
name, house number and zip or postal code, a computer's address is something
equal. Its format is "aaa.bbb.ccc.ddd". On the internet, no two machines
have the same digital address.

As you can see, there are four fields in the address, separated by dots (.).
Each field must contain a normal, whole decimal number, ranging from 0 to
255 inclusive. Numbers outside this range are invalid.

For example: the address 123.456.789.000 is absolutely invalid, because only
the first field contains a value within range. 456 Is greater than 255,
which is the highest number that such a field may contain. The real computer
term for a digital computer address for to be used on the internet, is "IP
address". IP stands for Internet Protocol.

Then what are data ports used for? You may have heard people talk about
using port 80 for http, and port 21 for ftp. It's not very difficult to
understand what this is all about.

Imagine that there is a great neat computer on the internet that you can
connect to. It has a website that you can view and it has an ftp site from
which you can download files. Now let's say that you ask your browser to
open the internet site on that neat computer. Your net work card sends out a
tcp packet with the source ip address being that of your machine, and with
the destination ip address set to that of the neat computer. When that
packet arrives at neat computer, neat has to open your data packet, read its
entire contents and then determine if you requested to view the ftp site or
the website. If you were the only one to access neat computer, there would
be time enough for this procedure. If neat computer only has an ftp site and
a website, the decision-making process would be short.

But internet servers are heavily used and must spend the minimum time
possible for each process, because you can run many many different network
services on a single computer.

So, to speed up things, data ports were invented. Your computer has 65536
data ports that allow data, both in and out. Think of it as over 65 thousand
doors next to each oter in your computer's network card bus. Now the tcp
protocol states, that every service on the internet, be it normal web
surfing (called http) or file transfers over ftp, will have their own
distinct data port associated. This means that the tcp packets you send not
only have two ip addresses (the sender's and that of your recipient), but
also two data port numbers: your source port from which you happened to send
your packet, and a destination port on which your packet is to be received.
If you ask your browser to open the internet page on neat computer, then all
you have to do is send your packet into port 80 of the receiving computer.
Neat will know that all packets sent to its own port 80, are requests for
its website. This eliminates the need for neat computer to look into your
packets contents to find out for what service you intended it, as each
service listens on its own port.

So the destination port to which packets are sent do matter, but the port
that you send your packet from is relatively unimportant at the time you
send your packet.

When neat computer starts answering your requests, it will create packets
that have neat computer's ip address as the source ip, your computer's ip
address as the destination ip, they will have port 80 set as the source port
so that your computer knows that this packet should go to your browser and
they will have your original source port set as the destination port. In
other words, the source and destination ip addresses are exchanged, and the
source and destination port numbers are too. What was source becomes
destination, and vice versa. Giving each service a unique port number to use
in their communication, makes it easy for computers to split incoming data
streams to go into different programs.

Just remember that each and every service on the internet has its own data
port assigned. If you intend to use such a service, it is always handy to
know on which port that service wants to receive its requests. In most cases
you won't need to know it however, because a browser is programmed to send
out requests to another machine's port 80 automatically. Your ftp program
defaults to port 21 for you to request a file over ftp.

Apache is the software that listens for requests from other browsing users
on the internet and, in response, it will send the pages from your computer
that the users of your website request. Your apache machine will, by
default, listen for incoming tcp connections on port 80. Again, the sender's
data port is not very important, but in this case you (runing apache) are
the internet server (the recipient of other user's packets). Therefore,
because others expect you to server your website over port 80, you must make
sure your webserver software uses that very port.

But your computer is not directly attached to the internet. Instead, a cable
modem and another router are in between. Most likely, either your router or
your cable modem is equipped with some sort of firewall. In current models,
this mechanism means that they allow all your traffic to pass out to the
internet, but traffic that attempts to come in from the net to your
computer, is only allowed inward if the data is an answer to your own
request for information.

For instance, if you send out a packet to neat computer's website, in which
you ask it to send you a page of information, then the firewall will
remember the outgoing request. Only if the information attempting to come in
is addressed to your computer in particular and if it is from neat computer
indeed, only then the information may pass into your machine.

This leads to the following conclusion. If you don't specially instruct your
firewall to do so, then it will not let other people get inside your
computer. Even if they nicely address their packets to port 80, which is
where apache is listening for connections, your firewall will reject them.
The reason is that these packets are not an answer to activity in your
browser. Instead, they are unsolicited packets (things your computer didn't
ask for). In your case however, your firewall must be told to let these in
as well.

What you need to do is:
figure out where (if any) your firewall is located. If it is a piece of
software in your computer, it is easy to alter its configuration. If your
router or your cable modem acts as firewall, read their manuals to see how
you can enter their system configurations. In most cases, you can reach them
using your browser because they have a so-called web interface built-in,
over which you can configure them.

What you need to do is: instruct the firewall, where-ever you found it, to
allow unsolicited connections to come in, only if they were addressed to
port 80. Usually, your modem or router will allow you to configure a second
item as well: the destination port. This may seem confusing but it really is
not.

If your router acts as your firewall, then
in one plug you connect the internet, and to another plug you connect your
machine. If you have more than one machine that are all connected to that
router, then your machines together form your internal network. Now if a
packet comes into your router from the internet, the outside world, the
router receives that packet on its own port 80. The router has an equal
number of ports as your computer. That's why they communicate so nicely
together. They both have an ip address and both have numerous data ports.
The packet received on router port 80, should be sent to your computer in
turn. The "destination port" item that most firewalls let you configure,
lets you choose into which port on your computer the router should send the
packet it received. Normally, packets received by the router on port 80
should be forwarded by your router to your computer, to your machine's port
80. So for the firewall configuration, incoming and outgoing port numbers
are the same. Both 80.

However: if you configure apache on your machine to listen for conections on
port 3072, then all packets that your router receives on its port 80, should
be forwarded from there into your machine to your port 3072. If in the
firewall configuration the source and destination port numbers are
different, you are creating what is called a port mapping. You mapped port
80 requests to go to port 3072 on your machine. This means that your users
can just connect to your router's port 80, while your router forwards these
requests into your machine's port 3072, or whatever you set it to. In this
case, Apache must be listening there of course.

To go short: look at which device carries your firewall and find out how to
make it send all packets received on its port 80, right to your wink2
machine's port 80. If apache is running on your win2k machine and you
instructed its setup wizard to load apache for all users as a service
running on port 80, everything will work fine.

Paul.
 -----
From: "William Martin" <ma...@adelphia.net>
To: <us...@httpd.apache.org>
Sent: Tuesday, December 31, 2002 7:56 PM
Subject: [users@httpd] Totally new


> Hi folks,
>
> I am new to the world of http server. I have played with it some in the
past
> but have always ended up being frustrated. I have a question that I really
> need some help on. My home computer with Windows 2000 Pro is connected to
a
> cable modem as well as two other computers.  The cable is route to a
Terayon
> modem and then from there,  it's routed to the Ethernet Cable/DSL router
on
> to these three computers. Is there any way that I can set it up to allow
> users from Internet to view the website on my home computer?  Any help
would
> be greatly appreciated. Thanks!
>
> William
>
>
> ---------------------------------------------------------------------
> 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] Totally new

Posted by William Martin <ma...@adelphia.net>.
Hi folks,

I am new to the world of http server. I have played with it some in the past
but have always ended up being frustrated. I have a question that I really
need some help on. My home computer with Windows 2000 Pro is connected to a
cable modem as well as two other computers.  The cable is route to a Terayon
modem and then from there,  it's routed to the Ethernet Cable/DSL router on
to these three computers. Is there any way that I can set it up to allow
users from Internet to view the website on my home computer?  Any help would
be greatly appreciated. Thanks!

William


---------------------------------------------------------------------
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] Apache on Windows with remote document root

Posted by Jeff Cohen <ap...@gej-it.com>.
Take a look with what I wrote to Paul 1 subject below,

Use as follow:
1. change the user "localsystem" that the Apache is logging up with to
the user name that has the permissions on the network computer \\p600
(if you don't have a user on your local machine - create one) 2. create
a directory alias on your server: Alias /ftp/ "\\p600\ftp_site" - I'm
not sure it will work, but try, if not you'll have to map the share as a
local drive and use for ex.:) Alias /ftp/ "g:/" 
3. Set the appropriate permissions.
<Directory "\\p600\ftp_site" (or) "g:/">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
</Directory>

Or whatever you'ld like to define on it..

Good luck,

Jeff Cohen

> -----Original Message-----
> From: Dwayne Miller [mailto:dmiller@espgroup.net]
> Sent: Tuesday, December 31, 2002 1:15 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Apache on Windows with remote document root
> 
> Yeah, I've basically come to the same conclusion.  I was finally able
to
> get Apache to report that it believes the document root does not
> exist... even though 'Everyone' has full control of the mapped drive.
> 
> I thought it odd though, that if I had no virtual servers and the
> document root on a mapped drive (with perhaps bad permissions), Apache
> would not start ( I believe it crashes on startup) and did not log the
> problem.  This does not seem much different from the situation where I
> specify a bogus directory (but on a local drive) as the document root,
> Apache will not start but informs me that the document root directory
> must exist.
> 
> However, if I had the main document root be a valid, local
directory,and
> set up a virtual server that accessed the mapped drive, then Apache
> starts okay, but logs in the log file that the directory does not
exist,
> and permission denied on each access.
> 
> 
> Paul Simon wrote:
> 
> >I used a mapped drive as the document root
> >successfully. I don't do that anymore and I can't
> >remember whether or not I ran it as a windows'
> >service. I do recall, however, having problems with
> >permissions on both the mapped directory and the user
> >running the apache service. I hope that sheds some
> >light...
> >
> >Paul
> >
> >--- Dwayne Miller <dm...@espgroup.net> wrote:
> >
> >
> >>Hi all,
> >>
> >>I'm trying to switch an Apache (2.0.43)
> >>configuration to use a mapped
> >>drive as the document root.  Once I do that, Apache
> >>will not start as a
> >>service... it returns with a system error of 1.
> >>Nothing is logged in
> >>the Apache log files.  If I edit the config file and
> >>change it back to
> >>the local filesystem... all works fine.  When I
> >>start Apache from the
> >>command line, using the mapped drive as the document
> >>root, it seems to
> >>start okay.
> >>
> >>Does Apache work with a mapped drive as the document
> >>root?
> >>
> >>Tks
> >>Dwayne
> >>
> >>
> >>
> >>
> >>
> >---------------------------------------------------------------------
> >
> >
> >>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] Apache on Windows with remote document root

Posted by Dwayne Miller <dm...@espgroup.net>.
Yeah, I've basically come to the same conclusion.  I was finally able to 
get Apache to report that it believes the document root does not 
exist... even though 'Everyone' has full control of the mapped drive.

I thought it odd though, that if I had no virtual servers and the 
document root on a mapped drive (with perhaps bad permissions), Apache 
would not start ( I believe it crashes on startup) and did not log the 
problem.  This does not seem much different from the situation where I 
specify a bogus directory (but on a local drive) as the document root, 
Apache will not start but informs me that the document root directory 
must exist.

However, if I had the main document root be a valid, local directory,and 
set up a virtual server that accessed the mapped drive, then Apache 
starts okay, but logs in the log file that the directory does not exist, 
and permission denied on each access.  


Paul Simon wrote:

>I used a mapped drive as the document root
>successfully. I don't do that anymore and I can't
>remember whether or not I ran it as a windows'
>service. I do recall, however, having problems with
>permissions on both the mapped directory and the user
>running the apache service. I hope that sheds some
>light...
>
>Paul
>
>--- Dwayne Miller <dm...@espgroup.net> wrote:
>  
>
>>Hi all,
>>
>>I'm trying to switch an Apache (2.0.43)
>>configuration to use a mapped 
>>drive as the document root.  Once I do that, Apache
>>will not start as a 
>>service... it returns with a system error of 1. 
>>Nothing is logged in 
>>the Apache log files.  If I edit the config file and
>>change it back to 
>>the local filesystem... all works fine.  When I
>>start Apache from the 
>>command line, using the mapped drive as the document
>>root, it seems to 
>>start okay.
>>
>>Does Apache work with a mapped drive as the document
>>root?
>>
>>Tks
>>Dwayne
>>
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>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] Apache on Windows with remote document root

Posted by Paul Simon <wr...@yahoo.com>.
I used a mapped drive as the document root
successfully. I don't do that anymore and I can't
remember whether or not I ran it as a windows'
service. I do recall, however, having problems with
permissions on both the mapped directory and the user
running the apache service. I hope that sheds some
light...

Paul

--- Dwayne Miller <dm...@espgroup.net> wrote:
> Hi all,
> 
> I'm trying to switch an Apache (2.0.43)
> configuration to use a mapped 
> drive as the document root.  Once I do that, Apache
> will not start as a 
> service... it returns with a system error of 1. 
> Nothing is logged in 
> the Apache log files.  If I edit the config file and
> change it back to 
> the local filesystem... all works fine.  When I
> start Apache from the 
> command line, using the mapped drive as the document
> root, it seems to 
> start okay.
> 
> Does Apache work with a mapped drive as the document
> root?
> 
> Tks
> Dwayne
> 
> 
>
---------------------------------------------------------------------
> 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