 dynamic content system |
Manual page for quick(start)
Quick start procedure for a MIDRIFF project
-
Look over this page before starting. We assume that you are comfortable
with unix concepts such as file permissions modes and setuid, and that you understand relevant
security issues.
Please don't proceed until you're comfortable with everything described herein.
-
Download the software from midriff.sourceforge.net
-
Edit the Makefile and set the bin directory if desired.
-
Compile using gcc or other ANSI-compliant C compiler.
-
Add the midriff bin to your search PATH
-
Think of a directory name where your project will reside (eg. /home/steve/proj1),
and decide on a unix userid that will own the project.
-
Log in as the project owner userid, and run the shell script midriff_newproject.sh
It will prompt you for full pathname of the project directory you are creating.
-
The result will be a project structure that will be used by midriff and/or shsql.
It will contain a config file that midriff programs will read whenever they are invoked.
It should also contain a demo data file called examp_people, and a couple of test page templates to play with.
-
Edit the config file, and change the dbbin entry from path to the full
path name of the bin directory where shsql executables reside. This allows midriff to
find several executables that it may need.
-
Set a shell environment variable called SHSQL_DB
and be sure that it is exportable. It should contain the full pathname
of your project directory. This won't be used by CGI processes, but is
needed in command line mode.
Eg. for /bin/ksh do: export SHSQL_DB=/home/steve/proj1
For future, add this to your .profile or .cshrc file.
-
The executable must be placed into your cgi bin.
Use cp -p or mv.
You can rename the executable to anything you like, for example, mydbcgi.
-
Permissions: Determine if you are setting up a read-write, or read-only application.
If your midriff application will need to update a shsql database or other files, it should be
setuid to the owner of the project/database directory.
Your executable should have a permissions mode of 6755 (-rwsr-sr-x); if it doesn't,
use a command like this: chmod 6755 mydbcgi
There are security concerns with respect to CGI programs and setuid, and some web hosts
place limitations here.
Further discussion.
If your midriff application will be read-only, setuid is not required, but
all files & subdirectories in your project directory (except logs) must be readable by world, and
your ./logs directory must be world-writable.
-
In your cgi-bin, make a soft link to the project config file that was just created.
It should have the same name as your mrcgi executable, with .cnf appended to the end,
for example, mydbcgi.cnf.
To make the config file link, you would use a command like this (the exact location of your cgi-bin
is system-dependent):
cd .../cgi-bin; ln -s /home/steve/myproj/config mydbcgi.cnf.
-
Try an SQL select command from the command line, eg:
shsql "select * from examp_people".
-
testpage1:
A couple of test pages should be located in your ./pages directory.
One of them, testpage1, is defined in the config file as a default page.
To access your default page, fire up your web browser and enter a URL that will
invoke your mrcgi executable, eg.
http://abc.com/cgi-bin/mydbcgi
If you have trouble with this step, check with your local systems support.
This page will display your effective user id and effective group id.
These must match the project directory owner if any database updates are to be possible.
-
A number of examples are available in the ./mrexamples directory.
You can try them now.. just copy all files from ./mrexamples to the
./pages directory (in the project directory you just built).
Then point your browser to:
http://abc.com/cgi-bin/mydbcgi?rtn=examp_index
-
You are now all set to begin developing page templates in ./pages.
Larger projects may be organized into subdirectories of pages therein.
-
Examples, troubleshooting, and support
|

dynamic content system
Copyright Steve Grubb
|