Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

running perl CGI in Windows 2003 + IIS6

11 views
Skip to first unread message

BY

unread,
Aug 9, 2003, 1:36:31 PM8/9/03
to
I have just followed the instructions in http://www.imbored.biz .
However, I fail to run my perl script in my IIS server.

If you have time, you can try to access my server
http://brianyip.no-ip.com:8000/cgi-bin/gamble/gamble.pl
Above is the perl script file that I want to run. However, it seems that IIS
cannot locate the file. But when I allow the directory listing
http://brianyip.no-ip.com:8000/cgi-bin/gamble/ , I am able to see those file
there. However, once I run it, it say file not found. Even if some of the
.dat file inside the same directory, i am not able to read the content also.
But if I change the extension to .html, it can successfully be read.

I am woundering where have I set it wrong.

Can any one help?
Thanks!


Jonathan Maltz [MS-MVP]

unread,
Aug 9, 2003, 7:54:14 PM8/9/03
to
Hi,

Load the IIS Manager, right click your website, click properties, go to the
HTTP Headers tab, at the bottom you will see something about Mime types.
Click the button to add a Mime type, then add the extension ".pl" and the
content type of text. Do the same for .dat, and see if it works.

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"BY" <b...@by.com> wrote in message
news:O$sMJ0pXD...@tk2msftngp13.phx.gbl...

BY

unread,
Aug 9, 2003, 9:01:56 PM8/9/03
to
thanks, but it doesn't work.
is it related to the prel program location? I have installed in the
F:\program files\perl directory.
or is it realted to the version of activePerl that I'm using. I'm using
5.8.0 build 806

--
Brian
"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message
news:OxSGKGtX...@tk2msftngp13.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 9, 2003, 10:00:22 PM8/9/03
to
Did you reflect the directory changes when you did my tutorial?

That's the build I'm running as well

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"BY" <b...@by.com> wrote in message

news:%23MNjDtt...@TK2MSFTNGP12.phx.gbl...

Be Yond

unread,
Aug 10, 2003, 10:26:27 AM8/10/03
to
thanks. finally i got it running.
however, I found that the file handle cannot successfully open/write a file.
In UNIX, once you get your perl scirpt running, there are no need to set the
file to be read by public. But in IIS, I cannot figure it out. Any
suggestion?

Thanks for your help anyway.

--

Happy Everyday
No trouble


"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message

news:%23wK0oMu...@TK2MSFTNGP09.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 10, 2003, 10:42:41 AM8/10/03
to
You have to give Users (MACHINE\Users) full control to the files you want
editted. For this reason it is recommended that you leave the files that
need to be editted in a directory that isn't accessible via the web

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"Be Yond" <n...@no.com> wrote in message
news:OSe7qt0X...@tk2msftngp13.phx.gbl...

Be Yond

unread,
Aug 10, 2003, 11:10:08 AM8/10/03
to
can I use relative path in the perl script?
I have given the Users full control but it still cannot read data from a
file.
are there any syntax different in UNIX perl and ActivePerl?

If I set the system just as you said, leave the files that need to be
editted in a directory that isn't accessible via the web, does it mean apart
from the f:\Inetpub\wwwroot\...?
Isn't it I need to specific the absolute path inside the scirpt file?

THanks so much

--

Happy Everyday
No trouble
"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message

news:ec%23An20X...@TK2MSFTNGP09.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 10, 2003, 11:29:42 AM8/10/03
to
You can't address the file with "C:\bleh\bleh" you need to use either
"C:\\bleh\\bleh" or "C:/bleh/bleh". I prefer the first way

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"Be Yond" <n...@no.com> wrote in message

news:egYsGG1X...@TK2MSFTNGP10.phx.gbl...

Be Yond

unread,
Aug 10, 2003, 8:19:47 PM8/10/03
to
I got it.
Isn't it I cannot use relative path to do that?
If I place the file to be read under the same directory of the perl script,
what syntax should I use? ".\\filename.dat" like this?
--

Happy Everyday
No trouble
"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message

news:uuUv4Q1X...@TK2MSFTNGP12.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 10, 2003, 8:56:29 PM8/10/03
to
If it's in the same directory you can use "filename.dat"

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"Be Yond" <n...@no.com> wrote in message

news:OzacP55X...@TK2MSFTNGP10.phx.gbl...

BY

unread,
Aug 10, 2003, 11:53:10 PM8/10/03
to
It seems that this doesn't work.
Only if I type in the absolute path...
How come?

Will these kind of problem exist if I use apache?
Thanks.

--
BY


"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message

news:OgRUlN6X...@TK2MSFTNGP09.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 11, 2003, 12:29:00 AM8/11/03
to
I don't know why that happens. Sounds odd to me.

I haven't touched Apache in well over a year (and that was with Linux -
Apache on Windows I haven't touched in much longer) so I couldn't tell you

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"BY" <B...@ys.com> wrote in message
news:eHZBXw7X...@TK2MSFTNGP12.phx.gbl...

Be Yond

unread,
Aug 13, 2003, 12:18:36 PM8/13/03
to
Oh. I found that my current directory is my parent directory. Is there
something that I've set it wrong?

--

Happy Everyday
No trouble
"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message

news:%23dGtVE8...@TK2MSFTNGP09.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 13, 2003, 12:24:10 PM8/13/03
to
What do you mean?

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"Be Yond" <n...@no.com> wrote in message

news:eUZnPabY...@TK2MSFTNGP12.phx.gbl...

Be Yond

unread,
Aug 13, 2003, 8:05:39 PM8/13/03
to
like this.

F:.
│ iisstart.htm
│ pagerror.gif

└─cgi-bin
├─gamble
gamble.pl
stat.dat
winNum.dat

I am running the gamble.pl.
I try to use <*> in the script to list the file of that folder, in UNIX, the
gamble.pl, stat.dat and winNum.dat should be shown. However, in IIS, it
shows only the gamble folder.
I used absolute path for file handle in the past. But now, after discovering
this, I used "gamble//stat.dat" to access the file and it runs smoothly.

That's what I want to say.

--

Happy Everyday
No trouble
"Jonathan Maltz [MS-MVP]" <jma...@mvps.org> wrote in message

news:eGTnPdbY...@TK2MSFTNGP09.phx.gbl...

Jonathan Maltz [MS-MVP]

unread,
Aug 13, 2003, 9:45:45 PM8/13/03
to
I can't say I know why that happens. Sorry :-/

--
--Jonathan Maltz [Microsoft MVP - Windows Server]
http://www.imbored.biz - A Windows Server 2003 visual, step-by-step
tutorial site :-)
Only reply by newsgroup. If I see an email I didn't ask for, it will be
deleted without reading.


"Be Yond" <n...@no.com> wrote in message

news:enSHPffY...@TK2MSFTNGP12.phx.gbl...

0 new messages