	fml CGI interface setup guide on Unix

				Ken'ichi Fukamachi
------------------------------------------------------------
1	Overview
1.1	Introduction
1.2	step of CGI setup

2	Example: install fml cgi under apache 1.3.14, suexec enabled
2.1	~/public_html 

3	hierarychy of CGI model

4	prepare CGI scripts

5	modify apache's httpd.conf

6	Configure MTA's
6.1	untile sendmali 8.9.3 
6.2	after sendmail 8.10
6.3	postfix

7	restart apache (httpd)
7.1	restart apache (httpd)
7.2	Here we go to access CGI menu

8	When you use suEXEC
8.1	Condition for suEXEC
8.2	enable apache to use suEXEC
8.3	prepare ~/public_html/

9	enable a mailing list to be configured on cgi menu

Appendix A	troubleshoot
------------------------------------------------------------


1	Overview

1.1	Introduction

1.2	step of CGI setup

2	Example: install fml cgi under apache 1.3.14, suexec enabled

	/usr/local/apache/logs/error_log
	/usr/local/apache/logs/suexec_log

2.1	~/public_html 

	makefml admin.cgi config 

 which ? (0-7) [0] 4

 user (fml) [fml] fml

 % /usr/local/apache/bin/htpasswd /usr/local/fml/www/authdb/admin/htpasswd fml
 New password: 
 Re-type new password: 

 which ? (0-7) [0] 5

  * create /home/fukachan/public_html/cgi-bin/fml/admin/.htaccess
  * create CGI scripts in /home/fukachan/public_html/cgi-bin/fml/admin/
    menu.cgi makefml.cgi mlmenu.cgi menubar.cgi index.cgi newml.cgi rmml.cgi 

   # touch /var/spool/ml/etc/aliases.db

    # tar zxvf apache_1.3.14.tar.gz
    # cd apache_1.3.14/
    # ./configure --enable-suexec --suexec-caller=nobody
    # make
    # make install 

    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI
    </A>

    AddHandler cgi-script .cgi

	# apachectl configtest
	OK
	# apachectl restart

   Apache/1.3.14 (Unix) configured -- resuming normal operations
   suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)

	# chmod -R go+rx `find /usr/local/fml/www/authdb -type d -print`
	# chmod -R go+r /usr/local/fml/www/authdb

	% chmod -R go-w ~/public_html/	
	% chown -R fml:fml  ~/public_html/	

3	hierarychy of CGI model

   $EXEC_DIR/www/share/cgi-bin/fml/admin/

   $EXEC_DIR/www/share/cgi-bin/fml/ml-admin/$ml/

4	prepare CGI scripts

% makefml admin.cgi config

   ************************************************************

        <<< makefml --- FML CGI Configuration Interface --- >>>

0     END
1     USE_MOD_SSL         YES
2     REAL_CGI_PATH       /usr/local/fml/www/share/cgi-bin/fml
3     CGI_AUTHDB_DIR      /usr/local/fml/www/authdb
4     CHANGE PASSWORD
5     REMAKE CGI SCRIPTS
6     MTA                 sendmail
7     HOW TO UPDATE ALIAS newaliases

which ? (0-7) [0] 

	6	postfix
	7	postalias /var/spool/ml/etc/aliases

5	modify apache's httpd.conf

	User fml

	# ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" 

	ScriptAlias /cgi-bin/fml/ "/usr/local/fml/www/share/cgi-bin/fml/"

	ScriptAlias /cgi-bin/fml/ "/usr/local/fml/www/share/cgi-bin/fml/"
	ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

6	Configure MTA's

6.1	untile sendmali 8.9.3 

   O AliasFile=/etc/aliases

   O AliasFile=/etc/aliases,/var/spool/ml/etc/aliases

   # touch /var/spool/ml/etc/aliases.db

6.2	after sendmail 8.10

	T fml

6.3	postfix

	alias_maps = hash:/etc/aliases, 
		hash:/var/spool/ml/etc/aliases

	# permit :include: operation in aliases
	allow_mail_to_commands = alias,forward,include

7	restart apache (httpd)

7.1	restart apache (httpd)

	# apachectl configtest

	# apachectl restart

7.2	Here we go to access CGI menu

    http://web.fml.org/cgi-bin/fml/admin/menu.cgi

8	When you use suEXEC

   http://www.xxx.yyy/~fml/cgi-bin/fml/admin/menu.cgi

8.1	Condition for suEXEC

8.2	enable apache to use suEXEC

    # tar zxvf apache_1.3.14.tar.gz
    # cd apache_1.3.14/
    # ./configure --enable-suexec --suexec-caller=nobody
    # make
    # make install 

    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI
    
    AddHandler cgi-script .cgi

    <Directory /home/*/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI
    
    AddHandler cgi-script .cgi

8.3	prepare ~/public_html/

	% su fml
	% mkdir ~/public_html
	% chmod 755 ~/public_html

	% makefml admin.cgi config

   0     END
   1     USE_MOD_SSL         YES
   2     REAL_CGI_PATH       /usr/local/fml/www/share/cgi-bin/fml
   3     CGI_AUTHDB_DIR      /usr/local/fml/www/authdb
   4     CHANGE PASSWORD
   5     REMAKE CGI SCRIPTS
   6     MTA                 sendmail
   7     HOW TO UPDATE ALIAS newaliases

   which ? (0-7) [0] 

	~/public_html/cgi-bin/fml/admin/*.cgi

	% su fml
	% chown -R fml ~/public_html
	% chgrp -R fml ~/public_html
	% chmod -R go-w ~/public_html

9	enable a mailing list to be configured on cgi menu

   % makefml ml-admin.cgi elena config

   0     END
   1     USE_MOD_SSL         YES
   2     CHANGE PASSWORD
   3     REMAKE CGI SCRIPTS

Appendix A	troubleshoot

Q: SSL 

/usr/local/fml/www/share/cgi-bin/fml/admin/.htaccess: 

	% makefml admin.cgi config 

			  )

	% chmod -R go-w ~/public_html/	
	% chown -R fml:fml  ~/public_html/	

     % ls -lR ~/public_html
     total 1
     drwxr-xr-x  4 fml  fml  512 Nov 28 09:07 cgi-bin/

     /home/fml/public_html/cgi-bin:
     total 2
     drwxr-xr-x  2 fml  fml  512 Nov 28 09:07 admin/
     drwxr-xr-x  3 fml  fml  512 Nov 28 09:07 fml/

     /home/fml/public_html/cgi-bin/admin:

     /home/fml/public_html/cgi-bin/fml:
     total 1
     drwxr-xr-x  2 fml  fml  512 Dec 16 21:18 admin/

     /home/fml/public_html/cgi-bin/fml/admin:
     total 7
     -rwxr-xr-x  1 fml  fml  618 Dec 16 21:18 index.cgi
     -rwxr-xr-x  1 fml  fml  575 Dec 16 21:18 makefml.cgi
     -rwxr-xr-x  1 fml  fml  616 Dec 16 21:18 menu.cgi
     -rwxr-xr-x  1 fml  fml  622 Dec 16 21:18 menubar.cgi
     -rwxr-xr-x  1 fml  fml  648 Dec 16 21:18 mlmenu.cgi
     -rwxr-xr-x  1 fml  fml  618 Dec 16 21:18 newml.cgi
     -rwxr-xr-x  1 fml  fml  616 Dec 16 21:18 rmml.cgi

(13)Permission denied: Could not open password file: /usr/local/fml/www/authdb/admin/htpasswd

	# chmod -R go+r /usr/local/fml/www/authdb

	# chmod -R go+rx `find /usr/local/fml/www/authdb -type d -print`
	# chmod -R go+r /usr/local/fml/www/authdb

Q: Options ExecCGI is off in this directory

    <Directory /home/*/public_html>
        AllowOverride FileInfo AuthConfig Limit
        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI
    </A>

   # ./configure --enable-suexec --suexec-caller=nobody

   # ./configure --enable-suexec --suexec-caller=www

$FML: INSTALL_CGI.wix,v 1.23.2.2 2001/08/23 11:46:45 fukachan Exp $
