|
How to generate Perl CGI scripts Note: Additional information is contained within
the <form>_instructions.txt file created during the file generation
process. The <form>_instructions.txt file contains the actual
file names created by CGIScripter. This document uses an example form
named "example", the files created for your database will
use the name of the form(s) you have entered. A separate set of Perl
CGI scripts and instructions will be created for each form. Overview The generated Perl code is designed to be easily updated due to its organized structure and documentation. Commonly changed parameters such as connection strings, table names and error messages are defined near the start of each script. The generated scripts utilize commonly available open source Perl modules including CGI.pm and DBI/DBD in order to make it practical for a developer to make more extensive changes. One minor change which can easily be made to the generated
scripts involves the display of visible borders for HTML tables. By
default, the generated scripts set the table border to "1"
which makes the table borders visible. To make the table borders invisible,
just change the following line of code to set the border to "0": Generated CGI Scripts example_create_table1.sql - example_submit1.html - example_submit1 - example_header1.html - example_footer1.html - example_query1.html - example_query1 - example_display_record1 - example_update1.html - example_update1 - example_update_record1 - example_update_record_validate1 - example_delete1.html - example_delete1 - example_delete_record_display1 - example_delete_one_record1 - example_instructions1.txt - Additional Usage Instructions 1) Fill in the database related fields within the CGIScripter
application. Using FmPro Migrator Files with CGIScripter Web Server Setup Instructions - Windows - MySQL database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install the MySQL database client only or client and server
software on the web server. It is generally recommended that the MySQL
client software should be installed before the DBI/DBD software is installed
(though the order of installation is not important on Windows servers
if pre-compiled DBD driver software is installed via PPM). Configure
the MySQL user account for proper authentication to connect to the MySQL
database. This will generally mean enabling access to the database from
the IP address of the web server machine. Test the database connection
with the mysql utility. Install the Perl DBI and DBD::mysql modules on the web
server using the ActiveState PPM feature. Install commands follow: MySQL LONG/BLOB data notes: The MySQL database also includes a max-allowed-packet
variable which limits the maximum amount of data which can be written
into a database row at one time. If large images can't be inserted into
the database, check for errors in the webserver error.log file like
the following: This MySQL variable may be increased by entering the updated
value into the mysqld configuration file (my.ini on Windows): Once the database software is installed, copy the generated scripts to the /cgi-bin directory if you are using the Apache webserver on Windows. Otherwise, copy the scripts to the IIS directory pointed to by the /Scripts alias. Copy the HTML files into the documents directory. If the URLs within the scripts are different from your webserver structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. The Perl scripts will be executed by the web server software
whenever they are accessed because they are associated with the Perl
executable by virtue of the fact that each script has a ".pl"
extension. Web Server Setup Instructions - UNIX - MySQL database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install the MySQL database client only or client and server
software on the web server. The MySQL software must be installed before
the DBI/DBD software is installed. Configure the MySQL user account
for proper authentication to connect to the MySQL database. This will
generally mean enabling access to the database from the IP address of
the webserver machine. Test the database connection with the mysql utility.
MySQL LONG/BLOB data notes: The MySQL database also includes a max-allowed-packet
variable which limits the maximum amount of data which can be written
into a database row at one time. If large images can't be inserted into
the database, check for errors in the webserver error.log file like
the following: This MySQL variable may be increased by entering the updated
value into the mysqld configuration file (/etc/my.conf on UNIX/Linux): Make each script executable by the user who owns the web
server software: The Perl scripts will be executed by the web server software
whenever they are accessed because they are associated with the Perl
executable by virtue of the fact that each script contains the line:
#!/usr/bin/perl Web Server Setup Instructions - Windows - Oracle database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install Oracle database client software on the web server.
It is generally recommended that the Oracle client software should be
installed before the DBI/DBD software is installed (though the order
of installation is not important on Windows servers if pre-compiled
DBD driver software is installed). Configure the Oracle client software
to enable connections to the database thru the tnsnames.ora file. Test
the database connection with the tnsping.exe utility to test the service
name entered into the tnsnames.ora file. As an additional test, use
sqlplus to connect to the database with the service name and database
account/password which will be used by the CGI scripts. Install the Perl DBI and DBD::ODBC modules on the web
server using the ActiveState PPM feature. Install commands follow: Create the asset_management2_ora_dsn entry in the ODBC Control Panel. Make sure that the Enable LOBs checkbox is checked on the Oracle tab of the ODBC Driver Configuration window. Click the Test Connection button to verify that you can connect to the database from the Driver Configuration window. Once the database software is installed, copy the generated scripts to the /cgi-bin directory if you are using the Apache web server on Windows. Otherwise, copy the scripts to the IIS directory pointed to by the /Scripts alias. Copy the HTML files into the documents directory. If the URLs within the scripts are different from your web server structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script has a ".pl" extension. If the Apache web server is being used on Windows, the
ScriptAlias /Scripts/ should be aliased to /cgi-bin/ directory in the
httpd.conf file. Web Server Setup Instructions - UNIX - Oracle database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install Oracle database client software on the web server.
The Oracle client software must be installed before the DBI/DBD software
is installed. Configure the Oracle client software to enable connections
to the database thru the tnsnames.ora file. Test the database connection
with the tnsping utility to test the service name entered into the tnsnames.ora
file. As an additional test, use sqlplus to connect to the database
with the service name and database account/password which will be used
by the CGI scripts. Once the database software has been installed, copy the generated scripts to the Apache web server configured /cgi-bin directory. Copy the HTML files into the documents directory. If the URLs within the scripts are different from your webserver structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. Make each script executable by the user who owns the web
server software: The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script contains the line: #!/usr/bin/perl Notes for MacOS X webservers: Web Server Setup Instructions - Windows - Access database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. The Access driver software is pre-installed when Windows
is installed. Install ActiveState Perl on the Windows server if it is
not already installed. Install the Perl DBI and DBD::ODBC modules on
the web server using the ActiveState PPM feature. Install commands follow: Create the example_acs_dsn entry as a System DSN in the ODBC Control Panel. Once the database software is installed, copy the generated scripts to the /cgi-bin directory if you are using the Apache web server on Windows. Otherwise, copy the scripts to the IIS directory pointed to by the /Scripts alias (this is often the Inetpub/scripts directory). Copy the HTML files into the documents directory. If the URLs within the scripts are different from your web server structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script has a ".pl" extension. If the Apache web server is being used on Windows, the ScriptAlias /Scripts/ should be aliased to /cgi-bin/ directory in the httpd.conf file. Web Server Setup Instructions - UNIX - Access database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. The Perl scripts generated for use on UNIX servers utilize the DBI::Proxy software to connect to Access database files. The DBI::Proxy feature enables connections to Access database files without requiring the installation of an ODBC manager or ODBC driver software on the UNIX web server. DBI::Proxy makes a proxy connection to a DBI::ProxyServer running on the Access database server running on a Windows computer. Install the Perl DBI and DBD::ODBC modules on the Access
database server using the ActiveState PPM feature. On the Windows system,
install DBI 1.37 or higher. Install commands follow: Create an ODBC System DSN (not a User DSN) named example_acs_dsn on the Access database server. If there is no username or password required for connecting to the database, then clear the Username and Password fields on the Other tab of CGIScripter. Open a Windows command prompt window and startup the DBI:ProxyServer
on the Access database server. Use the following command to startup
the DBI:ProxyServer to display debugging info to the screen: If no debugging or logging is required, then use the following
command: The DBI:ProxyServer starts up with a default configuration
which allows all hosts to connect to the ProxyServer to make a database
connection. Host access lists may be implemented within a configuration
file whose name is specified on the command line as follows: [Please see the Perl DBI documentation or source code file for more info about how to write the dbiproxy_config file.] The Access database must not be opened within Access while Perl scripts are writing to the database file. The Perl scripts need to have exclusive write access to the file in order to write data into it. If the Access file is already being used by the Perl scripts then the file can be opened in read mode by the Access application. The following Perl modules need to be installed on the UNIX web server machine(s): DBI 1.38 (or higher) Web Server Setup Instructions - Windows - SQL Server
database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. The SQL Server ODBC driver software is installed during
the installation of Windows. If a later version of the SQL Server driver
needs to be installed (recommended), it can be installed from the SQL
Server install CD. Select the option to install components to manage
SQL Server on a remote computer on the frist screen of the installer
wizard. Then select the option to "create a new instance of SQL
Server or install Client Tools" on the second screen of the install
wizard. Install ActiveState Perl on the Windows server if it is
not already installed. Install the Perl DBI and DBD::ODBC modules on
the web server using the ActiveState PPM feature. Install commands follow: Create the example_sqlsvr_dsn entry as a System DSN in the ODBC Control Panel. You will generally want to select the option to use SQL Server authentication to authenticate access to the database through the database user account. Once the database client software is installed, copy the generated scripts to the /cgi-bin directory if you are using the Apache web server on Windows. Otherwise, copy the scripts to the IIS directory pointed to by the /Scripts alias (this is often the Inetpub/scripts directory). Copy the HTML files into the documents directory. If the URLs within the scripts are different from your web server structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script has a ".pl" extension. If the Apache web server is being used on Windows, the ScriptAlias /Scripts/ should be aliased to the /cgi-bin/ directory in the httpd.conf file. Web Server Setup Instructions - UNIX - SQL Server database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. The Perl scripts generated for use on UNIX servers utilize the DBI::Proxy software to connect to SQL Server databases. The DBI::Proxy feature enables connections to SQL Server databases without requiring the installation of an ODBC manager or ODBC driver software on the UNIX web server. DBI::Proxy makes a proxy connection to a DBI::ProxyServer running on the SQL Server database server running on a Windows computer. Install the Perl DBI and DBD::ODBC modules on the SQL
Server database server using the ActiveState PPM feature. On the Windows
system, install DBI 1.37 or higher. Install commands follow: Create an ODBC System DSN (not a User DSN) named example_sqlsvr_dsn on the SQL Server database server. You will generally want to select the option to use SQL Server authentication to authenticate access to the database through the database user account. Open a Windows command prompt window and startup the DBI:ProxyServer
on the SQL Server database server. Use the following command to startup
the DBI:ProxyServer to display debugging info to the screen: If no debugging or logging is required, then use the following
command: The DBI:ProxyServer starts up with a default configuration
which allows all hosts to connect to the ProxyServer to make a database
connection. Host access lists may be implemented within a configuration
file whose name is specified on the command line as follows: [Please see the Perl DBI documentation or source code file for more info about how to write the dbiproxy_config file.] The following Perl modules need to be installed on the UNIX web server machine(s): DBI 1.38 (or higher) Web Server Setup Instructions - Windows - Sybase database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. On Windows and UNIX web servers, the CGI scripts generated by CGIScripter utilize the DBI/DBD::Sybase driver. The Sybase Open Client driver software needs to be installed on the web server running the Perl CGI scripts. This Sybase software can be installed from the Sybase database installer by installing only the connectivity software, without installing the entire database. Install ActiveState Perl on the Windows server if it is
not already installed. Install the Perl DBI and DBD::Sybase modules
on the web server using the ActiveState PPM feature. Install commands
follow: [If the installation of DBD-Sybase results in an error stating that it can't be installed with the currently installed version of Perl, download DBD-Sybase and install it manually. Download DBD-Sybase with your web browser from the http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only web page. Substitute the "6xx" with your version of ActiveState Perl. Uncompress the downloaded DBD-Sybase zip file. Then open a Windows command prompt window to run the ppm installer command specified within the DBD-Sybase ReadMe file.] Use Sybase utilities or manually edit the Sybase interfaces
file on the web server with the database connectivity information. The
database name specified within the CGIScripter Database Name field is
used for the Sybase Data Source Name DSN (not to be confused with an
ODBC DSN). The Sybase DSN entry within the interfaces file (sql.ini
for Windows) may look like the following example: The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script has a ".pl" extension. If the Apache web server is being used on Windows, the ScriptAlias /Scripts/ should be aliased to the /cgi-bin/ directory in the httpd.conf file. Web Server Setup Instructions - UNIX - Sybase database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install the Sybase Open Client database client software
on the web server. The Sybase software must be installed before the
DBI/DBD software is installed. Sybase IMAGE data notes: Make each script executable by the user who owns the web
server software: The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script contains the line: #!/usr/bin/perl Web Server Setup Instructions - Windows - DB2 database Install ActiveState Perl on the Windows server if it is
not already installed. Install the Perl DBI and DBD::DB2 modules on
the web server using the ActiveState PPM feature. Install commands follow: [If the installation of DBD-DB2 results in an error stating that it can't be installed with the currently installed version of Perl, download DBD-DB2 and install it manually. Download DBD-DB2 with your web browser from the http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only web page. Substitute the "6xx" with your version of ActiveState Perl. Uncompress the downloaded DBD-DB2 zip file. Then open a Windows command prompt window to run the ppm installer command specified within the DBD-DB2 ReadMe file.] Use the DB2 Configuration Assistant utility on the web
server to create a DB2 alias with the database connectivity information
for the DB2 database. The database name specified within the CGIScripter
Database Name field is used for the DB2 database alias name. The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script has a ".pl" extension. If the Apache web server is being used on Windows, the ScriptAlias /Scripts/ should be aliased to the /cgi-bin/ directory in the httpd.conf file. Web Server Setup Instructions - UNIX - DB2 database DB2 BLOB data notes: Make each script executable by the user who owns the web
server software: The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script contains the line: #!/usr/bin/perl Web Server Setup Instructions - Windows - PostgreSQL
database The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install the PostgreSQL ODBC driver software software on
the web server. Configure the PostgreSQL user account for proper authentication
to connect to the PostgreSQL database. This will generally mean enabling
access to the database from the IP address of the web server machine
within the PostgreSQL pg_hba.conf file. Test the database connection
with the psql utility. Install the Perl DBI and DBD::ODBC modules on the web
server using the ActiveState PPM feature. Install commands follow: The PostgreSQL ODBC driver includes a Max LongVarChar parameter which is set to a default of 8190 bytes. This value needs to be changed within the psqlODBC setup panel if more than 8190 bytes need to be written to the database. Once the PostgreSQL ODBC driver software is installed, copy the generated scripts to the /cgi-bin directory if you are using the Apache webserver on Windows. Otherwise, copy the scripts to the IIS directory pointed to by the /Scripts alias. Copy the HTML files into the documents directory. If the URLs within the scripts are different from your webserver structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. The Perl scripts will be executed by the web server software whenever they are accessed because they are associated with the Perl executable by virtue of the fact that each script has a ".pl" extension.
The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install the PostgreSQL ODBC driver software software on
the web server. For UNIX servers you will need to have an ODBC driver
manager installed in order to use the psqlODBC driver. The iODBC driver
manager can be installed as the ODBC driver manager (available from
www.iodbc.org). Configure the PostgreSQL user account for proper authentication
to connect to the PostgreSQL database. This will generally mean enabling
access to the database from the IP address of the web server machine
within the PostgreSQL pg_hba.conf file. Test the database connection
with the psql utility. Install the Perl DBI and DBD::ODBC modules on the web server. Make each script executable by the user who owns the web
server software: The Perl scripts will be executed by the web server software
whenever they are accessed because they are associated with the Perl
executable by virtue of the fact that each script contains the line:
#!/usr/bin/perl
The CGI.pm Perl module is included as a standard component with current Perl distributions so you should not generally need to install it. If a reinstall of the CGI.pm module is required, it may be downloaded from www.cpan.org. For database access by scripts running on the web server
it is necessary to first install database client software and DBI/DBD
driver software on the web server. Install the FileMaker 7 ODBC driver on the web server. Install the Perl DBI and DBD::ODBC modules on the web
server using the ActiveState PPM feature. Install commands follow: Create the ODBC DSN with the name specified within the generated Perl CGI scripts as: example_fmp_dsn. The values specified for host,database, username and password are specified within the Perl CGI scripts instead of being taken from the ODBC DSN configuration. FileMaker BLOB (container field) data notes: Once the database software is installed, copy the generated scripts to the /cgi-bin directory if you are using the Apache webserver on Windows. Otherwise, copy the scripts to the IIS directory pointed to by the /Scripts alias. Copy the HTML files into the documents directory. If the URLs within the scripts are different from your webserver structure, you may either make the changes in CGIScripter and regenerate the scripts, or update the scripts manually. The Perl scripts will be executed by the web server software
whenever they are accessed because they are associated with the Perl
executable by virtue of the fact that each script has a ".pl"
extension.
|
|
|||||||||||||||||||||
|
|||||||||||||||||||||||
|