Closed Thread Icon

Preserved Topic: Displaying documents in cgi-bin (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=20996" title="Pages that link to Preserved Topic: Displaying documents in cgi-bin (Page 1 of 1)" rel="nofollow" >Preserved Topic: Displaying documents in cgi-bin <span class="small">(Page 1 of 1)</span>\

 
riddim
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 07-02-2001 16:20

I usually run cgi scripts thru a host but I just installed Apache on Windows. Thx to WarMage I finally found a link for ActivePerl which runs cgi scripts on Windows. I tried running an executable script which extracts data from a database and uses a template to display requested info into a html document. It works fine, only problem is html documents and images in the cgi-bin (which arent executable) cant be displayed and I get the following 2 errors in error.log (PS theres AddHandler cgi-script .pl & .cgi lines in srm.conf so as to associate .pl and .cgi with perl)

*** c:/*,*/apache/cgi-bin/tablegif/table_round_bottom_left.gif is not executable; ensure interpreted scripts have "#!" first line (I doubt this is the problem coz I dont want to execute the gif)
*** couldn't spawn child process: c:/*,*/apache/cgi-bin/tablegif/table_round_bottom_left.gif

Subsequent lines calling images and documents in the cgi-bin folder also display the same errors.


since the template is being called from within the perl script itself its displays perfectly eg http://127.0.0.1/cgi-bin/script.pl?ID=291 (the gifs meant to give the table rounded edges dont display at all since they are called from template and not the script) but if I try display the template file itself thru http://127.0.0.1/cgi-bin/template.html it gives me the errors mentioned above.
Is there a setting in httpd.conf or srm.conf which needs to be changed in order to display "all" documents in root/cgi-bin folder no matter what their extension is even though root/htdocs is the default document folder? Am looking for a way of displaying all types of documents, images and files without having to add individual file types in srm.conf eg if I wanted to display docs with .html endings I'd add "AddHandler text/html .html" for *.htm I'd have to add another line and *.txt & *.gif other lines etc, which is really tedious. Is there a way of adding a simple command/s which will display all documents other than scripts in the cgi-bin folder?
Also I dont really have a problem with the scripts being world executable by default as I am the only one using them but just for the sake of learning or if I ever wonna take the database online does anyone know if Active Perl has a Windows equivalent of Unix CHMOD commands so as to restrict priviledges.
TIA.


Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-02-2001 18:46

Dunno about you, but we never put images and stuff in /cgi-bin/. We always put them in the /htdocs/images/<script_name>/ folder and make the script point to them. No CHMOD needed. Then, just the script itself is in /cgi-bin/. In our case, we usually do something like /cgi-bin/<script_name>/. This makes for a cleaner structure all around, and mirrors the /images/ structure.

Just my .02

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-02-2001 20:29

Apache, by default, executes all files that are stored inside /cgi-bin/, so it means that you can't have images and other files there if they need to be displayed (if you store them there, they cen be read only by cgi scripts). So, simply move those image filese somwhere else (like Pugzly said above).

As far as CHMOD is concerned, there are two equivalentents in the Windows world. If your HDD is running under FAT16/32 filesystem, you can control file attributes (archive, readonly, system, hidden), on the other hand if you're running NTFS filesystem, you have even more options (users/groups). All files are executable in the Windows world, btw.

riddim
Nervous Wreck (II) Inmate

From:
Insane since: Aug 2000

posted posted 07-03-2001 04:13

Thanks y'all. I guess am used to web hosts where you can put filez anywhere in the cgi-bin.
I guess I'll add a "AddHandler image/gif .gif" for the gifs or move them to another folder.
Hey Max if I can disturb u again, would a server on NT run 'considerably' faster than on WinME with similar specs? Does NTFS file attribute mgmt come close to Unix's?
If new to Linux, would it be hard to install the OS and a webserver and network it with a computer running Windows? I've noticed my server on WinME lags alot when running cgi and perl.exe crashes if theres too much 2 handle even though I'd easily run the same scripts with web hosts.

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-03-2001 11:23

I cannot tell you if W2K would run faster than WinME on the same computer, because W2K is more demanding than old Win9x series. I can only tell you that it will be much more stable than WinME (it won't crash).

NTFS is very good filesystem (and very similar to Linux's).

It wouldn't be very hard to install Linux, but in order to maintain it and keep it secure, you'll have to read a lot of manuals, faqs, howtos and books...

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 07-03-2001 15:45

Not to mention, can you even RUN server software on ME?

Run Windows 2000 Advanced Server with IIS 5 and apply all the security patches. Or install the Windows version of Apache.

If you're going to move the images to another directory, why not just move them into the HTDOCS folder and skip the "AddHandler image/gif .gif" part?

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-03-2001 16:23

You can run Apache under WinME...

« BackwardsOnwards »

Show Forum Drop Down Menu