Gossamer Forum
Home : Products : DBMan : Discussions :

DBMan in a Windows environment - Checklist

Quote Reply
DBMan in a Windows environment - Checklist
Hi all!

Lately, there has been a heap of posts about setting up DBMan in Windows. Recently, I successfully set up DBMan on my own Personal Web Server and it is really not that difficult.

Compared to setting up DBMan in a UNIX environment, there are only really 3 major differences you need to observe:

1) The shebang (#!/usr/local/bin/perl/) does nothing under Windows. When you install Perl, all *.pl are immediately associated with Perl, so PWS knows exactly where to look. So you don't need to worry about customizing it.

2) The variable $db_script_path in db.cgi MUST be set to the full location of your DBMan directory on your filesystem. (without the last slash)

A quick note on the file path variable, try to avoid using the backslash character as it is an escape character.
eg: $db_script_path = "c:\inetpub\cgi-bin\dbman";

Either escape the backslash first: $db_script_path = "c:\\inetpub\\cgi-bin\\dbman";
Or use forward slashes: $db_script_path = "c:/inetpub/cgi-bin/dbman";

Either method will work fine.

3) For DBMan to work on Windows systems, you need to change the extension on your db.cgi to .pl (make sure you do the same in your default.cfg!)

The following aren't so important, so I don't class them as "major differences"

4) As you probobly know, file locking won't work under Windows, so you should probobly turn it off in default.cfg

5) Also there is no "chmod" in Windows, as long as you haven't set any of the files to "read only" you shouldn't have any problems.

And that's all! Everything else should work as it's supposed to, provided you have the latest version of Perl which you can get at:
http://www.perl.com or
http://www.activestate.com/

Good luck, and happy DBMan-ing!

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Hi,
I have tried your method but still the same message:
DBMan encountered an internal error. Please enable debugging to view.
I have installed PWS and active-perl, and other scripts are working fine.
I have put the DBman script in the following directory:
c:\Inetpub\wwwroot\cgi-bin , the virtual name is also cgi-bin. I changed .cgi in .pl and these are the definitions in cfg:
$db_use_flock = 0;

# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://ns/cgi-bin";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.pl";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/default.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/default.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/default.log";
# Full path and file name of the html routines.
require $db_script_path . "/html.pl";

and this is the one in db.pl:
$db_script_path = "c:\inetpub\wwwroot\cgi-bin";

Maybe you can help me explain what i am doing wrong, i have tried several things with the paths in the .cfg file but it just won't work.

greetings, Pieter

Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Instead of $db_script_path = "c:\inetpub\wwwroot\cgi-bin";

Try $db_script_path = "c:/inetpub/wwwroot/cgi-bin";
(ie: forward slashes)

- Mark

Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
thanks! it works!

greetings, Pieter

Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
I have been having the same type of error and have followed your directions to no avail:
db.cgi...
$db_script_path = "d:/www/apache/usr/uams/cgi-bin/dbman";

default.cfg...
# URL of the directory dbman resides in. No Trailing Slash Please.
$db_dir_url = "http://uams.2y.net/cgi-bin/dbman";
# URL of dbman.
$db_script_url = $db_dir_url . "/db.cgi";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "/default.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "/default.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "/default.log";
# Full path and file name of the html routines.
require $db_script_path . "/html.pl";

I have tried changing the file names to .pl and my server displays the actual script.

Dave




Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
In Reply To:
I have tried changing the file names to .pl and my server displays the actual script.
If you're just getting source code, that probobly indicates that you haven't set up the proper permissions for the cgi-bin on your web-server.

I haven't used Apache for windows before, but you'll need to set the CGI-BIN directory to allow script execution.

Sorry I couldn't be of more help.

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
I have been using Xitami offline on win95 for ages, and I found it extreamly easy to set up.
I didn't need to set any server permissions, infact I wouldn't even know how.
I can run .cgis and .pls with no problems.
Check out this thread, you might find it usefull.
http://www.gossamer-threads.com/...ew=&sb=&vc=1

Bob
http://totallyfreeads.com

Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Well my .cgi files work but not the ones .pl the only option that I can find is a line that says this:

# To use CGI scripts:
#
AddHandler cgi-script .cgi

That's fine...I'm sure that I am just missing something.

Thanks


Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
If .cgi files work, but .pl does not, it sounds like Windows did not associate .pl to perl properly. If you have access to the server, try installing the latest version of perl again.

Or, it could be the permissions thing. I had the same problem where the script would show up instead of running, and it turned out to be a permissions problem. Is this Windows NT? are you running IIS?

Barbara

Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Maaaaan! Spend my whole weekend on this and still can`t get it to work! I`m on NT. Did everything exactly what you said. Just for reference:

db.pl:
$db_script_path = "d:/www/public/htdocs/digitalrice/ammfc/dbman";

default.cfg:
$db_dir_url = "http://digitalrice.com/ammfc/dbman";
# URL of dbman.
$db_script_url = $db_dir_url . "http://digitalrice.com/ammfc/dbman/db.pl";
# Full Path and File name of the database file.
$db_file_name = $db_script_path . "d:/www/public/htdocs/digitalrice/ammfc/dbman/default.db";
# Full path and file name of the counter file.
$db_id_file_name = $db_script_path . "d:/www/public/htdocs/digitalrice/ammfc/dbman/default.count";
# Full path and file name of the authorization directory.
$auth_dir = $db_script_path . "d:/www/public/htdocs/digitalrice/ammfc/dbman/auth";
# Full path and file name of the password file.
$auth_pw_file = $db_script_path . "d:/www/public/htdocs/digitalrice/ammfc/dbman/default.pass";
# Full path and file name of the log file.
$auth_log_file = $db_script_path . "d:/www/public/htdocs/digitalrice/ammfc/dbman/default.log";
# Full path and file name of the html routines.
require $db_script_path . "d:/www/public/htdocs/digitalrice/ammfc/dbman/html.pl";


--- Removed excess coding posted ---
Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
In your .cfg file you don't need all of what you added.

It should look like this:

$db_dir_url = "http://digitalrice.com/ammfc/dbman";
$db_script_url = $db_dir_url . "db.pl";
$db_file_name = $db_script_path . "default.db";
$db_id_file_name = $db_script_path . "default.count";
$auth_dir = $db_script_path . "auth";
$auth_pw_file = $db_script_path . "default.pass";
$auth_log_file = $db_script_path . "default.log";
require $db_script_path . "html.pl";

Hope this gets you up and running

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Yeah, I already got that myself ;), but what the heck they say to enter THE FULL PATH???

Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Somewhere in the Readme.txt instructions it indicates that only the first line of the paths needs to be changed. Beyond that it is assumed that a person would see the correlation between the bolded areas below:

default.cfg:
$db_dir_url = "http://digitalrice.com/ammfc/dbman";
# URL of dbman.
$db_script_url = $db_dir_url . "http://digitalrice.com/ammfc/dbman/db.pl";


Quote Reply
Default.cfg In reply to
I am using DBman in Win2k IIS and didnt have to rename this file to a .pl extension. Is this something I should do anyway? It seems to be working ok.

Quote Reply
Re: Default.cfg In reply to
Renaming is an option if someone is not able to run .pl files on their system. If your scripts are working properly, there is no reason to rename the files.

Quote Reply
Re: Default.cfg In reply to
Ok thanks. It seems to be working ok. There are a few bugs, but nothing that makes a big difference.

Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
Just to clarify:

In Reply To:
Yeah, I already got that myself ;), but what the heck they say to enter THE FULL PATH???
I only said to enter the full path in db.cgi (point 2)

In Reply To:
I am using DBman in Win2k IIS and didnt have to rename this file to a .pl extension. Is this something I should do anyway? It seems to be working ok.
When you install ActivePerl, it only associates itself with *.pl files (though this may have changed in recent releases). I simply suggested changing to *.pl as it is easier than configuring ActivePerl to associate with .cgi

But if everythings working fine with .cgi, then you should have no problems and should not have to change over.

Good luck all!

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: DBMan in a Windows environment - Checklist In reply to
DBManSQL Installation - My experience as follows

OS Name Microsoft Windows 2000 Professional
Version 5.0.2195 Service Pack 1 Build 2195
Internet Information Services 5.0


Use for development on local computer network - not Internet
----------------------------------------

After revewing posts and attempting solutions to getting the software installed, I was only able to do this with support from Gossamer. They were very helpful. From the beginning, here is what we did to get it operational - not including any modifications or add-ons which we plan to use (We are now attempting the install of the Upload Module on this system and would most appreciate some experienced guideance on the correct config settings).

Just to see if would work - I can confirm that I have gotten this program to work on Windows 2000 / Windows NT with IIS and Windows 200 with Apache and Windows ME with Apache (Windows ME does not support IIS or Personal Web Servicea)


These are the steps we took. Hopefully we didn't overlook any tweak.


1) Install latest Perl from ActiveState (ours is binary version 5.6)
Test and make sure .pl and .cgi scripts are properly associated and the directory (cgi-bin) is executable
Write two simple scripts one .pl and other .cgi and place them in the cgi directory - make sure you can execute properly. Don't go further if either fails.

2) Install modules - here we installed several modules that may or may not have been necessary, but we installed them anyway and we upgraded our pre-installed modules:

DBD-Mysql
DBD-ODBC
DBI
DB_File


3) Install latest MySQL (ours is binary version 3.23.22)


auth,pl - stayed same
-------
html.pl
-------


sub html_record_form
# Added hidden values after the table tag
</tr>
</table>


<input type="hidden" name="id" value="$rec{'id'}">
<input type="hidden" name="userid" value="$rec{'userid'}">

</center>
|;


nph-setup.cgi
--------------

# Mod Added
use vars qw($dbh); #After Flush Output: $| = 1;
# End Mod

$setup_path = 'C:/Inetpub/wwwroot/cgi-bin/dbsql102'; # Pathes all use same slash convention


($config = $in{'config'}) : # ORIGINAL - stays same
($config = 'db.cfg'); # ORIGINAL - stays same

# Check for DBI. - Requires the install of the Perl module - see above
print "checking for DBI module ... "; # ORIGINAL - stays same
eval { require "DBI.pm"; }; # ORIGINAL - stays same

db.cfg
-------

# URL of the directory dbman resides in. No Trailing Slash Please.
$db_script_url = "http://localhost/cgi-bin/dbsql102/db.cgi";

# Path and file name of the html routines.
require 'C:/Inetpub/wwwroot/cgi-bin/dbsql102/html.pl';

# Database and SQL Configurations
# The second and third parameters are username/password if needed.
@db_connect= ("DBI:mysql:test:localhost","ODBC","");

db.cgi
--------

# Use relative script paths.
# Note the use of the new path of lib - files directory
$db_script_path = 'C:/Inetpub/wwwroot/cgi-bin/dbsql102/';
use lib 'C:/Inetpub/wwwroot/cgi-bin/dbsql102/'; # New


# Required Librariers
%in = &parse_form;
$in{'db'} ? ($db_setup = $in{'db'}) : ($db_setup = 'db');
$in{'uid'} ? ($db_uid = $in{'uid'}): ($db_uid = '');

$in{'db'} = $db_setup; # New
$in{'uid'} = $db_uid; # New



# Resolve Modify Problem sub add_record
# Set the userid to the logged in user.
# Gatman Mod Per Forum 3-10-2001 - Corrects Modify Issue
#($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid); ORIGINAL
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);


# Resolve Modify Problem sub modify_record
# Set the userid to the logged in user.
# Gatman Mod Per Forum 3-10-2001 - Corrects Modify Issue
#($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid); ORIGINAL
($auth_user_field >= 0) and ($in{$auth_user_field} = $db_userid);


-------------------------

Execute
http://localhost/cgi-bin/dbsql102/nph-setup.cgi

Attempt to Enter
http://localhost/cgi-bin/dbsql102/db.cgi

User: admin
Password: admin

-------------------------------

Quote Reply
Re: [AstroBoy] DBMan in a Windows environment - Checklist In reply to
If that doesn't get you going, try enabling debugging. In default.cfg, change the 0 to a 1

# Display Debugging Information (1 = Yes, 0 = No).

$db_debug = 0;

I found that I did not have a directory called /auth. I created that directory, and things got better.

Somebody in another thread wrote that the auth directory should have permissions set at 777. I have no idea how to do this. Any advice?