Webman-framework

Lightweight, Component-based, and Database-oriented Web Application Framework

About | Overview | Documentation

 

Documentation > Installation > 3. Framework's Resources Deployment

3. Framework's Resources Deployment

Download the ZIP file format of Webman-framework distribution from http://sourceforge.net/projects/wm-framework/files/ and extract its content into the target drive. The most top level structure of the framework's directories should be as shown below:

E:\
  +-wmbase
    +-public_html
    +-webman


The public_html sub directory is the place where all online resources of the framework are published. The webman sub directory is an off-line resources of the framework that contains command line helper scripts, configuration files, framework's modules, etc.

 

3.1 Database Setup

Open framework's database configuration file (E:\wmbase\webman\conf\dbi_connection.conf). The configuration file content should be as folllows:.

### Set your db connection for DBI Perl module here.
db_host      = localhost
db_driver    = mysql
db_name      = db_webman
db_user_name = webman
db_password  = webman


For simplicity, just add new MySQL user account and database following the information given by the above database configuration file. This task could simply be done by using phpMyAdmin, a web-based mysql database management tool, one of the package included in XAMPP distribution installed.

 

3.2 Framework's Web Root Directory

Below is part of the structures underneath the framework's public_html sub directory..

E:\
  +-wmbase
     +-public_html
     | +-cgi-bin
     | | +-webman
     | |   +-appAdmin
     | |   +-appDev
     | +-webman
     +-webman

To make public_html as one of Apache's document directory, the Apache's default configuration need to be changed. If the previous XAMPP installation is made at C:\xampp, the related configuration file can normally be found at C:\xampp\apache\conf\httpd.conf. Inside the httpd.conf configuration file, enclosed by the <IfModule alias_module> directive add the following configuration setting.
Alias /wmapps/ E:/wmbase/public_html/


Outside and after the <IfModule alias_module>...</IfModule> directive scope, add the Directory directive setting as follows:
<Directory "E:/wmbase/public_html/">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


Restart Apache and try open the new added Apache's document directory using the browser by entering the URL http://127.0.0.1/wmapps/. The browser should display something like below:

 

3.3 CGI Execution Directory Setup

Inside the public_html directory there is cgi-bin directory that will becomes the root directory for the framework to run its Perl CGI scripts. Using the browser, browse this directory until the URL reach at http://127.0.0.1/wmapps/cgi-bin/webman/. The browser window will list the content of the current URL path as follows:

 

Click the test.cgi Perl script and the Apache server will response with errors as shown below:

 

The above error is occur because the directory path E:\wmbase\public_html\cgi-bin has yet not been set as Apache's active server directory for CGI script execution. To accomplish this setting, add another Directory directive as follows:
<Directory "E:/wmbase/public_html/cgi-bin">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


Below is the part of the overall Apache's settings excerpted from the httpd.conf which related to all previous configurations.
...
...
<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://localhost/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    Alias /wmapps/ E:/wmbase/public_html/

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"

</IfModule>

<Directory "E:/wmbase/public_html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<Directory "E:/wmbase/public_html/cgi-bin">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
...
...


By convention, all framework's CGI scripts will have the *.cgi extension. For this reason, make sure that inside the httpd.conf configuration file, the <IfModule mime_module> directive has the setting of handlers minimally as follows:
AddHandler cgi-script .cgi


Besides its extension as *.cgi and its specific allocation inside Apache's active directory, the test.cgi script header in the context of Perl scripting language syntax must also provide the information of where Perl's interpreter binary installation can be found. Following the previous XAMPP installation and setup the test.cgi script header should be started with something like below:
#! C:/xampp/perl/bin/perl


Since there are dozen of CGI scripts would be used by the application, the framework provides special helper command line script to modify the header of all CGI scripts inside the cgi-bin directory and its other sub directories. Inside the command prompt window go to E:\wmbase\webman directory path and type the dir command to list all available helper command line scripts provided by the framework.

 

Run one of the Perl script by typing the command perl config_perl_bin.pl and give the inputs to the script as shown below:

 

The config_perl_bin.pl command line script will modify all framework's CGI script headers following the new Perl's binary path given above (#! C:/xampp/perl/bin/perl). Also check framework's directory configuration file, E:\wmbase\webman\conf\dir_org.conf, so the part for Perl's binary path is exactly the same with the new one. Below is how the content of dir_org.conf configuration file should look like.
# Use full path directories name each categories below.
#
#
# Perl binary installation
#
perl_bin = C:/xampp/perl/bin/perl
#
#
# Framework directory structure
#
base       = __base__
local      = __base__/webman
web_public = __base__/public_html/webman
web_cgi    = __base__/public_html/cgi-bin/webman


Restart Apache and refresh browser access to the script via the URL http://127.0.0.1/wmapps/cgi-bin/webman/test.cgi. The result should be a list of all available CGI environment variables passed by Apache to the test.cgi script itself.