Accessing network resources within Apache module?

This is a discussion on Accessing network resources within Apache module? within the Windows Web Servers forums, part of the Web Server and Related Forums category; I wrote an Apache module (.so) which needs to copy files across my local network to another server, and I ...


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-16-2006
John Howard
 
Posts: n/a
Default Accessing network resources within Apache module?

I wrote an Apache module (.so) which needs to copy files across my local
network to another server, and I am finding that this does not work. I
don't know if it is a limitation of Apache running as a windows service, or
a limitation of Apache win32 itself, or a limitation of windows services in
general (unable to access resources away from the host server itself).
Anybody have experience with this??

I can write an EXE with the same functionality that has no problem
accessing/creating files/directories across the network. So I believe my
network/directory sharing rights are okay.

This has nothing to do with serving the files to public requests. This is
entirely an issue of accessing files within the Apache .so module itself.

I have tried executing Apache as a service from an administrator user
account, instead of default system. Still does not work.

I am going to try writing a custom DLL which will do what I want if called
from a custom EXE, and then try to call this DLL from my Apache .so, and see
if this works.

I am running Apache 1.3.+ as a service on Win2K.

Any other possible ideas to try, or pointers to other sites/lists/newsgroups
with info would be appreciated.


  #2 (permalink)  
Old 07-24-2006
Kees Nuyt
 
Posts: n/a
Default Re: Accessing network resources within Apache module?

On Sun, 16 Jul 2006 18:22:16 GMT, "John Howard"
<john@johnhoward.com> wrote:

>I wrote an Apache module (.so) which needs to copy files across my local
>network to another server, and I am finding that this does not work. I
>don't know if it is a limitation of Apache running as a windows service, or
>a limitation of Apache win32 itself, or a limitation of windows services in
>general (unable to access resources away from the host server itself).
>Anybody have experience with this??


Not with copying in this way, but i do have a few aliases that
point to a share.

>I can write an EXE with the same functionality that has no problem
>accessing/creating files/directories across the network. So I believe my
>network/directory sharing rights are okay.
>
>This has nothing to do with serving the files to public requests. This is
>entirely an issue of accessing files within the Apache .so module itself.
>
>I have tried executing Apache as a service from an administrator user
>account, instead of default system. Still does not work.


An adminstrator user has other settings than your user account
and local system.
I think the bindings of driveletters to shares are account
dependent.
Did you try full UNC paths ( \\server\share\path\... ) ?

Also, if the share is in another domain even an administrator
account may not be trusted, while your user account is.

>I am going to try writing a custom DLL which will do what I want if called
>from a custom EXE, and then try to call this DLL from my Apache .so, and see
>if this works.


That won't make much difference, in my opinion it's all about
access control of accounts for reading a file on a share.

>I am running Apache 1.3.+ as a service on Win2K.
>
>Any other possible ideas to try, or pointers to other sites/lists/newsgroups
>with info would be appreciated.


HTH
  #3 (permalink)  
Old 07-25-2006
John Howard
 
Posts: n/a
Default Re: Accessing network resources within Apache module?

Kees Nuyt, thank you for your reply.

This problem is driving me crazy, and I appreciate your ideas to help.

I do not understand why I can write an EXE that can reach across the network
(another machine in the same domain) and create directories and files, but
exactly the same code in an Apache .so module cannot access the other
machine. I think you are right when you say this is a privileges issue.
But where?

Yes, I did try full UNC paths. Does not work. I can use UNC paths and/or
mapped drive letters to successfully create files and directories across the
network if I run this code as a standalone EXE, running under my admin user
account, but neither UNC paths nor drive letters work in the exact same code
in a Apache .so module.

I don't know if this problem is a limitation of all Windows services, or if
this is only a limitation of Apache, or is it a Windows / user / privileges
settings issue.

This is why I am asking if anybody knows if Windows services are not
permitted to create directories or files on another machine, or is this a
known issue with Apache?

I am very eager to try any other ideas you (or anyone) may have.

Thanks again for offering your ideas!

- John Howard

P.S. -- Again this has nothing to do with the Apache settings, which are
concerned with files served via Apache to http requests. Instead, this
problem is strictly an issue of an Apache .so module not being able to
create files and/or directories on another server on the same domain, yet a
standalone EXE with the same code has no problem.




"Kees Nuyt" <k.nuyt@nospam.demon.nl> wrote in message
news:r0gac21jjcde1n1etnu83jcdqcqq4504vs@4ax.com...
> On Sun, 16 Jul 2006 18:22:16 GMT, "John Howard"
> <john@johnhoward.com> wrote:
>
> >I wrote an Apache module (.so) which needs to copy files across my local
> >network to another server, and I am finding that this does not work. I
> >don't know if it is a limitation of Apache running as a windows service,

or
> >a limitation of Apache win32 itself, or a limitation of windows services

in
> >general (unable to access resources away from the host server itself).
> >Anybody have experience with this??

>
> Not with copying in this way, but i do have a few aliases that
> point to a share.
>
> >I can write an EXE with the same functionality that has no problem
> >accessing/creating files/directories across the network. So I believe my
> >network/directory sharing rights are okay.
> >
> >This has nothing to do with serving the files to public requests. This

is
> >entirely an issue of accessing files within the Apache .so module itself.
> >
> >I have tried executing Apache as a service from an administrator user
> >account, instead of default system. Still does not work.

>
> An adminstrator user has other settings than your user account
> and local system.
> I think the bindings of driveletters to shares are account
> dependent.
> Did you try full UNC paths ( \\server\share\path\... ) ?
>
> Also, if the share is in another domain even an administrator
> account may not be trusted, while your user account is.
>
> >I am going to try writing a custom DLL which will do what I want if

called
> >from a custom EXE, and then try to call this DLL from my Apache .so, and

see
> >if this works.

>
> That won't make much difference, in my opinion it's all about
> access control of accounts for reading a file on a share.
>
> >I am running Apache 1.3.+ as a service on Win2K.
> >
> >Any other possible ideas to try, or pointers to other

sites/lists/newsgroups
> >with info would be appreciated.

>
> HTH



  #4 (permalink)  
Old 07-25-2006
Kees Nuyt
 
Posts: n/a
Default Re: Accessing network resources within Apache module?

On Tue, 25 Jul 2006 00:24:29 GMT, "John Howard"
<john@johnhoward.com> wrote:

>Kees Nuyt, thank you for your reply.
>
>This problem is driving me crazy, and I appreciate your ideas to help.


You're welcome, I'm sorry it didn't work out yet.

>I do not understand why I can write an EXE that can reach across the network
>(another machine in the same domain) and create directories and files, but
>exactly the same code in an Apache .so module cannot access the other
>machine. I think you are right when you say this is a privileges issue.
>But where?
>
>Yes, I did try full UNC paths. Does not work. I can use UNC paths and/or
>mapped drive letters to successfully create files and directories across the
>network if I run this code as a standalone EXE, running under my admin user
>account, but neither UNC paths nor drive letters work in the exact same code
>in a Apache .so module.


I assume Apache was also running under that same admin user
account during the comparison?

What is "not work"? Don't the result codes give any clue about
the nature of the refusal?

It's just a wild suggestion in this case, but is there anyting
useful in the Apache accesslog and errorlog?

Is the module called the way you expect it to be?
Does it register its hooks correctly with Apache?
I won't pretend that I know how to do that all, BTW :))


>I don't know if this problem is a limitation of all Windows services, or if
>this is only a limitation of Apache, or is it a Windows / user / privileges
>settings issue.


Return codes should give that insight.

>This is why I am asking if anybody knows if Windows services are not
>permitted to create directories or files on another machine, or is this a
>known issue with Apache?
>
>I am very eager to try any other ideas you (or anyone) may have.
>
>Thanks again for offering your ideas!
>
>- John Howard
>
>P.S. -- Again this has nothing to do with the Apache settings, which are
>concerned with files served via Apache to http requests. Instead, this
>problem is strictly an issue of an Apache .so module not being able to
>create files and/or directories on another server on the same domain, yet a
>standalone EXE with the same code has no problem.
>
>
>
>
>"Kees Nuyt" <k.nuyt@nospam.demon.nl> wrote in message
>news:r0gac21jjcde1n1etnu83jcdqcqq4504vs@4ax.com.. .
>> On Sun, 16 Jul 2006 18:22:16 GMT, "John Howard"
>> <john@johnhoward.com> wrote:
>>
>> >I wrote an Apache module (.so) which needs to copy files across my local
>> >network to another server, and I am finding that this does not work. I
>> >don't know if it is a limitation of Apache running as a windows service,

>or
>> >a limitation of Apache win32 itself, or a limitation of windows services

>in
>> >general (unable to access resources away from the host server itself).
>> >Anybody have experience with this??

>>
>> Not with copying in this way, but i do have a few aliases that
>> point to a share.
>>
>> >I can write an EXE with the same functionality that has no problem
>> >accessing/creating files/directories across the network. So I believe my
>> >network/directory sharing rights are okay.
>> >
>> >This has nothing to do with serving the files to public requests.
>> >This is entirely an issue of accessing files within the
>> >Apache .so module itself.

>>
>> >I have tried executing Apache as a service from an administrator user
>> >account, instead of default system. Still does not work.

>>
>> An adminstrator user has other settings than your user account
>> and local system.
>> I think the bindings of driveletters to shares are account
>> dependent.
>> Did you try full UNC paths ( \\server\share\path\... ) ?
>>
>> Also, if the share is in another domain even an administrator
>> account may not be trusted, while your user account is.
>>
>> >I am going to try writing a custom DLL which will
>> >do what I want if called
>> >from a custom EXE, and then try to call this DLL from my
>> >Apache .so, and see if this works.

>>
>> That won't make much difference, in my opinion it's all about
>> access control of accounts for reading a file on a share.
>>
>> >I am running Apache 1.3.+ as a service on Win2K.
>> >
>> >Any other possible ideas to try, or pointers to other
>> >sites/lists/newsgroups
>> >with info would be appreciated.

>>
>> HTH

>

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:07 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0