Accessing files on winXP machine via http server

Accessing files on winXP machine via http server

Post by Hidek » Mon, 17 Dec 2001 11:14:19



I have 2 machines both having XP WITHOUT the builit-in firewall setting
enabled.
I'm running an http server on 1 of the machine on which I want to run a perl
script that accesses the files on the other machine.

The script worked fine when I was having WinME but no longer works on WinXP.
Running the script locally(executing it via command prompt) does the job,
but when I call the script by accessing the local web server, it does not
work.

How can I make this to work?
Thanks in advance.

 
 
 

Accessing files on winXP machine via http server

Post by Bill Sanderso » Mon, 17 Dec 2001 11:45:01


This is probably a security issue.

Let me see if I can get the terminology straight:

Machine 1 is the machine with the HTTP server, and the perl script.
Machine 2 is where the files that the script needs to act on exist.

Can you, sitting at the desktop/keyboard of Machine 1, work with those files
on Machine 2?

I believe the issue is that you need the perl script to be running in a
security context which has permissions to work with the files on machine 2.

By default, over a network, this means an account with a username and
password valid on Machine2.

How does the script connect to the share on which the files exist?  Does it
pass credentials as part of that connection process?

I probably should not have answered this one, because I know next to nothing
about HTTP and Perl scripts, but this may be enough to head you in the right
direction.


Quote:> I have 2 machines both having XP WITHOUT the builit-in firewall setting
> enabled.
> I'm running an http server on 1 of the machine on which I want to run a
perl
> script that accesses the files on the other machine.

> The script worked fine when I was having WinME but no longer works on
WinXP.
> Running the script locally(executing it via command prompt) does the job,
> but when I call the script by accessing the local web server, it does not
> work.

> How can I make this to work?
> Thanks in advance.


 
 
 

Accessing files on winXP machine via http server

Post by Hidek » Mon, 17 Dec 2001 12:28:34


Quote:> This is probably a security issue.

> Let me see if I can get the terminology straight:

> Machine 1 is the machine with the HTTP server, and the perl script.
> Machine 2 is where the files that the script needs to act on exist.

Exactly.

Quote:> Can you, sitting at the desktop/keyboard of Machine 1, work with those
files
> on Machine 2?

Yes, I can view, read and write files on Windows' explorer from 1 machine to
another.

Quote:> I believe the issue is that you need the perl script to be running in a
> security context which has permissions to work with the files on machine

2.

When I run it on command prompt, it prints "Exist" as in the following
simple perl script.
ex) c:\>c:\usr\local\bin\perl test.cgi

To simplify, the perl script only has this statement to check for another
comps existance.

----------
#!/usr/local/bin/perl

    print "Content-type: text/html\n\n";   //for browser

    if(-e "//notebookpc/c") { print "Exist"; }   //"-e" checks if that
file/folder exists or not
    else { "Not found"; }

----------

But when I access the file through http server

ex) http://127.0.0.1/test.cgi

This prints "Not found".
So I'm assuming that requests coming from internet(though local) might be
kicked out by WinXP
even with the built-in firewall settings disabled.

Any help would be greatly appreciated.
I'm just making file synchronizing script for my comps.
It was working on WinME
, now WinXP blew it up.

> By default, over a network, this means an account with a username and
> password valid on Machine2.

> How does the script connect to the share on which the files exist?  Does
it
> pass credentials as part of that connection process?

> I probably should not have answered this one, because I know next to
nothing
> about HTTP and Perl scripts, but this may be enough to head you in the
right
> direction.



> > I have 2 machines both having XP WITHOUT the builit-in firewall setting
> > enabled.
> > I'm running an http server on 1 of the machine on which I want to run a
> perl
> > script that accesses the files on the other machine.

> > The script worked fine when I was having WinME but no longer works on
> WinXP.
> > Running the script locally(executing it via command prompt) does the
job,
> > but when I call the script by accessing the local web server, it does
not
> > work.

> > How can I make this to work?
> > Thanks in advance.

 
 
 

Accessing files on winXP machine via http server

Post by Bill Sanderso » Mon, 17 Dec 2001 12:53:59


You need somebody who knows about scripting across a windows network under
Windows2000 or later, and that isn't me, I'm afraid.

You are in the right group.

You might try re-posting with a subject like "perl access, XP to XP across
network"

to see if you can reach somebody who is familiar with how to do this.

I suspect that the issue is that the script is running in the security
context of  the local system--just as if it were scheduled by the scheduler,
and you need it to be running in a user context--the logged in user, for
example (since you as a logged in user have the correct access.)

I just don't know enough about how to define this to tell you what to do.


> > This is probably a security issue.

> > Let me see if I can get the terminology straight:

> > Machine 1 is the machine with the HTTP server, and the perl script.
> > Machine 2 is where the files that the script needs to act on exist.

> Exactly.

> > Can you, sitting at the desktop/keyboard of Machine 1, work with those
> files
> > on Machine 2?

> Yes, I can view, read and write files on Windows' explorer from 1 machine
to
> another.

> > I believe the issue is that you need the perl script to be running in a
> > security context which has permissions to work with the files on machine
> 2.

> When I run it on command prompt, it prints "Exist" as in the following
> simple perl script.
> ex) c:\>c:\usr\local\bin\perl test.cgi

> To simplify, the perl script only has this statement to check for another
> comps existance.

> ----------
> #!/usr/local/bin/perl

>     print "Content-type: text/html\n\n";   //for browser

>     if(-e "//notebookpc/c") { print "Exist"; }   //"-e" checks if that
> file/folder exists or not
>     else { "Not found"; }

> ----------

> But when I access the file through http server

> ex) http://127.0.0.1/test.cgi

> This prints "Not found".
> So I'm assuming that requests coming from internet(though local) might be
> kicked out by WinXP
> even with the built-in firewall settings disabled.

> Any help would be greatly appreciated.
> I'm just making file synchronizing script for my comps.
> It was working on WinME
> , now WinXP blew it up.

> > By default, over a network, this means an account with a username and
> > password valid on Machine2.

> > How does the script connect to the share on which the files exist?  Does
> it
> > pass credentials as part of that connection process?

> > I probably should not have answered this one, because I know next to
> nothing
> > about HTTP and Perl scripts, but this may be enough to head you in the
> right
> > direction.



> > > I have 2 machines both having XP WITHOUT the builit-in firewall
setting
> > > enabled.
> > > I'm running an http server on 1 of the machine on which I want to run
a
> > perl
> > > script that accesses the files on the other machine.

> > > The script worked fine when I was having WinME but no longer works on
> > WinXP.
> > > Running the script locally(executing it via command prompt) does the
> job,
> > > but when I call the script by accessing the local web server, it does
> not
> > > work.

> > > How can I make this to work?
> > > Thanks in advance.

 
 
 

1. perl script on http server to access files across LAN on WinXP

I have a problem with accessing files by an http server.
I have 2 computers connected on a LAN both having WinXP.

I have disabled both built-in firewall features and enabled the file sharing
options on every drive.

But whenever a perl scripts runs on that http server on 1 of the machine
to access files on the other computer,
the other computer always drops the incoming trafics no matter what,
making the script to tell that the other computer does not exist.

When I run the script on a command prompt it works.
(c:\> c:\usr\local\bin\perl c:\test.cgi)
But if I access the same script by visiting the local http server, it does
not work.
(http://127.0.0.1/test.cgi)

The script is as simple as this.

-------------
#!/usr/local/bin/perl

   print "Content-type: text/html\n\n";

   if(-e "//notebookpc/c") { print "Exist"; }
   else { print "Can't find"; }
-------------

I have been struggling for the whole day to get my perl script to work.
It used to work when I was having WinME on both computers and no more since
WinXP.

Any help is greatly appericiated.

2. NT FAQ

3. slow access to https via Proxy server

4. Driver slowing down Win95

5. accessing c$ on Winxp machine from other machines

6. Problem accessing the net, networking using cc:mail

7. Copying files from server to remote machine via remote desktop

8. Windows-type help files: how to create?

9. Can you control media player on a remote machine via HTTP?

10. VPN (PPTP) works from Win200 machines but not WinXP (SP1) machines - Error 919 with WinXP (SP1)

11. 0x800CCC35 / accessing hotmail via OE / http

12. Access via HTTP Mail Services

13. can't access https via xp.