<Directory /usr/local/sql-ledger> AllowOverride All Options -MultiViews -Indexes -FollowSymLinks Order allow,deny Allow from all </Directory> The way apache starts is it: Blocks all access to the physical file system / Opens access to the physical file system /var/www/html Opens access to the physical file system /var/www/perl Opens access to the physical file system /var/www/cgi-bin Opens access to the physical file system /var/www/protected-cgi-bin Opens access to the physical file system /home/*/public_html Opens access to the physical file system /home/*/public_html/cgi-bin Opens access to the physical file system /var/www/icons Opens access to the physical file system /usr/share/doc Since you're trying to access files outside of those allowed paths, you have to specifically allow it. It's done this way because of some past exploits with the pathnames. Rather than trust that there will never be another bug within apache that will let you get somewhere you don't want, you set it up securely out of the box so that apache won't let itself go somewhere that you don't want it to.
# Authentication Types (AUTH_TYPE) # ================================ # # AUTH_TYPE indicates the method used to authenticate users. The username # is specified in the connection request. A different AUTH_TYPE can be # specified for each record in the file. # # # ident: For TCP/IP connections, authentication is done by contacting # the ident server on the client host. Remember, this is # only as secure as the client machine. On machines that # support unix-domain socket credentials (currently Linux, # FreeBSD, NetBSD, and BSD/OS), this method also works for # "local" connections. # # AUTH_ARGUMENT is required: it determines how to map # remote user names to Postgres user names. The # AUTH_ARGUMENT is a map name found in the # $PGDATA/pg_ident.conf file. The connection is accepted # if that file contains an entry for this map name with # the ident-supplied username and the requested Postgres # username. The special map name "sameuser" indicates an # implied map (not in pg_ident.conf) that maps each ident # username to the identical PostgreSQL username. #
To use without frames
$ w3m http://localhost/sql-ledger/login.pl?terminal=lynx
Alias /sql-ledger/ "C:/apache/sql-ledger/" <Directory "c:/apache/sql-ledger"> AllowOverride All AddHandler cgi-script .pl Options +ExecCGI Order Allow,Deny Allow from All </Directory> <Directory "c:/apache/sql-ledger/users"> Order Deny,Allow Deny from All </Directory>
AddHandler cgi-script .pl Alias /sql-ledger/ /var/www/sql-ledger/ <Directory /var/www/sql-ledger> Options +ExecCGI </Directory> <Directory /var/www/sql-ledger/users> Order Deny,Allow Deny from All </Directory>
To send the document to the printer check the "Postscript" or "PDF" format, enter the number of copies and click on the "Print" button.
The printer field is available only when you edit the user's preferences with admin.pl
Note: html format is for screen preview. Use your browser's print function.
- perl-DBD-Pg
- postgresql
- postgresql-contrib
- postgresql-devl
- postgresql-docs
- postgresql-libs
- postgresql-perl
- postgresql-server
- postgresql-test
> sux - (change to root)
- If not done by the installation, setup disk directory for your db:
# mkdir /var/lib/pgsql/data
# chown postgres /var/lib/pgsql/data
Note that there are man pages for initdb and pg_ctl.
# touch /var/log/pgsql
# chown postgres:postgres /var/log/pgsql
# sux postgres
- Initialize postgres:
> /usr/bin/initdb -D /var/lib/pgsql/data
(creating ... Success...)
- Start the postgres daemon:
> /usr/bin/pg_ctl -D /var/lib/pgsql/data -l /var/log/pgsql start (start db)
(postmaster successfully started)
- > psql -d template1
(Welcome ... \q to exit psql)
\q
- Try setting up another db user:
> createuser <db-user> (<db-user> should match an existing Linux user)
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) n
Unless a problem with DBD::Pg (perl interface), postgres is ready to go.
> sux postgres
> psql template1
=# CREATE DATABASE my_database; (create your database)
=# \q
> cd /var/lib/pgsql/backups (assuming your backups are here)
The next command should have been performed earlier from the
previous installed version of postgres and your database:
> pg_dump -d my_database.sql.bak (from previous ver postgres)
> cp my_database.sql.bak my_database.sql
- Use vi to change all occurrances of 'current_date' to current_date
in file my_database.sql .
The vi command for this is :g/'current_date'/s//current_date/g
> psql my_database < my_database.sql > my_database.log
- Check my_database.log for errors.
# mkdir /usr/local/sql-ledger
# cd /usr/local/sql-ledger
# ./setup.pl
- Enter i
- Enter httpd owner and group if different than displayed default.
(Download occurs and status is displayed...)
- Surf to http://my_computer/sql-ledger/admin.pl
- Click enter (no password needed).
->Database Administration
- Leave fields Host and Port enpty for local installations.
- Enter your database name in the "Connect to" field.
- Enter the database user you setup (postgres, sql-ledger, etc.)
- Enter a password, only if a password is assigned to the database.
- To update an existing sql-ledger database: ->Update Database
Should see: The following Datasets need to be updated.
->Continue
Do more admin. You will need to setup at least one login.
To exit: ->Database Admin
- Surf to http://my_computer/sql-ledger/login.pl
- Enter the login name you just created. Main menu screen should appear.
Some of the applications have newer versions however the installation instructions remain the same. Just substitute the old version with a newer version.
AddHandler cgi-script .pl Alias /sql-ledger/ /usr/local/www/sql-ledger/ <Directory /usr/local/www/sql-ledger> Options +ExecCGI </Directory> <Directory /usr/local/www/sql-ledger/users> Order Deny,Allow Deny from All </Directory>
The long version was provided by Gordon Haverland.
/usr/local/www/sql-ledger.Remember where you have unpacked it.
dpkg -l | grep -i 'ii postgresql 'A typical response would be:
ii postgresql 7.1.3-5 Object....[stuff deleted]Indicating, that version 7.1.3 is installed (the -5 is a Debian patch level). You can use dselect or apt-get to install postgresql if you need to. You can visit the Debian maintainer's page for much more information on related packages at
http://people.debian.org/~elphick/postgresql/Older versions of Debian's PostgreSQL installation use a file called postmaster.init, while newer versions use a file called postmaster.conf, either residing in /etc/postgresql.
# su postgres $ createuser -d sql-ledger ... $ exit #As shown above, we then typed "exit" after createuser was done, to stop being the "postgres" user. The "-d" switch (you called also use "--createdb") specifies that this user can create databases.
AddHandler cgi-script .plSecond, we need to map our SQL-Ledger installation to be easy for users to find it (in srm.conf if separate).
Alias /sql-ledger/ /usr/local/www/sql-ledger/The "/" at the end of sql-ledger in both strings is important! Next, we need to allow the server to execute files from those directories, include things and follow links. This information is in httpd.conf (old or new installations).
<Directory /usr/local/www/sql-ledger> Options ExecCGI Includes FollowSymLinks </Directory>If we decided to put SQL-Ledger somewhere other than /usr/local/www/sql-ledger, we would use different paths above.
# cd /usr/local/www/sql-ledger # chown www-data:www-data users templates users/membersYou may get an "error" about users/members not existing. It is safe to ignore this error.
/etc/init.d/apache restart
http://localhost/sql-ledger/admin.pl
http://localhost/sql-ledger/login.pland login as the user you created
check the permission for the users directory.
AddHandler cgi-script .plin your httpd.conf file.
include the terminal variable on the URL
http://localhost/sql-ledger/login.pl?terminal=lynx
Valid terminal variables are lynx and mozilla
users/ templates/ users/members # chown nobody:nogroup users templates users/members
<Directory /usr/local/sql-ledger> Options ExecCGI Includes FollowSymlinks </Directory>
Typical setups: /usr/local/vh/www <- DocumentRoot for virtual host /usr/local/vh/sql-ledger <- Alias for sql-ledger /usr/local/vh/users <- users directory out of reachThe location for the users directory can be specified in sql-ledger.conf
/usr/local/vh/www <- DocumentRoot for virtual host /usr/local/vh/www/sql-ledger <- Alias for sql-ledger /usr/local/vh/www/sql-ledger/users <- users configuration files and tmp space <Directory /usr/local/vh/www/sql-ledger/users> <- disable webserver access Order Deny,Allow for users directory Deny from All </Directory>