diff options
author | ivan <ivan> | 2003-04-23 23:15:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-04-23 23:15:02 +0000 |
commit | 00c61e51058e44a07ea3a47acffba4a0e294d4fb (patch) | |
tree | 8516333c0426e6ebdb4518b12e64b6f5b813c877 | |
parent | 547368c36357ea54ec634b9b019240c1278326b7 (diff) |
compatible with mason 1.1! closes: bug#492
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | htetc/handler.pl | 27 | ||||
-rw-r--r-- | httemplate/docs/install.html | 16 |
3 files changed, 28 insertions, 20 deletions
@@ -10,6 +10,8 @@ TEMPLATE = asp #TEMPLATE = mason ASP_GLOBAL = /usr/local/etc/freeside/asp-global +MASON_HANDLER = /usr/local/etc/freeside/handler.pl +MASONDATA = /usr/local/etc/freeside/masondata FREESIDE_DOCUMENT_ROOT = /var/www/freeside @@ -102,6 +104,9 @@ install-docs: docs [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true + [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true + [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true + [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true perl-modules: cd FS; \ diff --git a/htetc/handler.pl b/htetc/handler.pl index 49bcbc0..3e37b7e 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -28,20 +28,25 @@ use strict; # Create Mason objects # -my $parser = new HTML::Mason::Parser; -my $interp = new HTML::Mason::Interp (parser=>$parser, - comp_root=>'/var/www/masondocs', - data_dir=>'/home/ivan/freeside_current/masondata', - out_mode=>'stream', - ); -my $ah = new HTML::Mason::ApacheHandler ( interp => $interp, - #auto_send_headers => 0, - ); + +#my $parser = new HTML::Mason::Parser; +#my $interp = new HTML::Mason::Interp (parser=>$parser, +# comp_root=>'/var/www/masondocs', +# data_dir=>'/usr/local/etc/freeside/masondata', +# out_mode=>'stream', +# ); +my $ah = new HTML::Mason::ApacheHandler ( + #interp => $interp, + #auto_send_headers => 0, + comp_root=>'/var/www/masonside', + data_dir=>'/usr/local/etc/freeside/masondata', + #out_mode=>'stream', +); # Activate the following if running httpd as root (the normal case). # Resets ownership of all files created by Mason at startup. # -chown (Apache->server->uid, Apache->server->gid, $interp->files_written); +#chown (Apache->server->uid, Apache->server->gid, $interp->files_written); sub handler { @@ -111,7 +116,7 @@ sub handler *CGI::redirect = sub { my( $self, $location ) = @_; - + use vars qw($m); #http://www.masonhq.com/docs/faq/#how_do_i_do_an_external_redirect $m->clear_buffer; # The next two lines are necessary to stop Apache from re-reading diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 4d72311..93bb249 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -47,7 +47,7 @@ Before installing, you need: <li><a href="http://search.cpan.org/search?dist=Net-SSH">Net-SSH</a> <li><a href="http://search.cpan.org/search?dist=String-ShellQuote">String-ShellQuote</a> <li><a href="http://search.cpan.org/search?dist=Net-SCP">Net-SCP</a> - <li><a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a> (use version 1.0x - Freeside is not yet compatible with version 1.1x) + <li><a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a> <li><a href="http://search.cpan.org/search?dist=Tie-IxHash">Tie-IxHash</a> <li><a href="http://search.cpan.org/search?dist=Time-Duration">Time-Duration</a> <li><a href="http://search.cpan.org/search?dist=HTML-Widgets-SelectLayers">HTML-Widgets-SelectLayers</a> @@ -63,7 +63,7 @@ Install the Freeside distribution: <ul> <li> with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/user-manag.html#DATABASE-USERS">PostgreSQL</a>: <pre> -$ su postgres +$ su postgres (pgsql on some distributions) $ createuser -P freeside Enter password for user "freeside": Enter it again: @@ -79,7 +79,7 @@ mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP on freeside.* T <!-- <li>Unpack the tarball: <pre>gunzip -c fs-x.y.z.tar.gz | tar xvf -</pre>--> <li>Edit the top-level Makefile: <ul> - <li>Set <tt>DATASOURCE</tt> to your <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI data source</a>, for example, <tt>DBI:Pg:host=localhost;dbname=freeside</tt> for PostgresSQL or <tt>DBI:mysql:freeside</tt> for MySQL. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">manpage for your DBD</a> for the exact syntax of your DBI data source. + <li>Set <tt>DATASOURCE</tt> to your <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI data source</a>, for example, <tt>DBI:Pg:dbname=freeside</tt> for PostgresSQL or <tt>DBI:mysql:freeside</tt> for MySQL. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">manpage for your DBD</a> for the exact syntax of your DBI data source. <li>Set <tt>DB_PASSWORD</tt> to the freeside database user's password. </ul> <li>Add the freeside database to your database engine: @@ -141,11 +141,10 @@ PerlSetVar Debug 2 </pre></font> </ul></td> <td><ul> - <li>(use version 1.0x - Freeside is not yet compatible with version 1.1x) <li>Run <tt>make masondocs</tt> <li>Copy <tt>masondocs/</tt> to your web server's document space. - <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory. - <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt> + <li>Copy <tt>htetc/handler.pl</tt> to an appropriate directory (use htetc/handler.pl-1.0x for Mason versions before 1.10). + <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/masondata</tt> <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example: <font size="-1"><pre> PerlModule HTML::Mason @@ -155,7 +154,7 @@ AddHandler perl-script .cgi PerlHandler HTML::Mason </Files> <Perl> -require "/usr/local/apache/conf/handler.pl"; +require "/usr/local/etc/freeside/handler.pl"; </Perl> </Directory> </pre></font> @@ -166,7 +165,6 @@ require "/usr/local/apache/conf/handler.pl"; <li>Restrict access to this web interface - see the <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache documentation on user authentication</a>. For example, to configure user authentication with <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files): <pre> <Directory /usr/local/apache/htdocs/freeside-asp> -PerlSetVar Global /usr/local/etc/freeside/asp-global/ AuthName Freeside AuthType Basic AuthUserFile /usr/local/etc/freeside/htpasswd @@ -192,7 +190,7 @@ $ bin/fs-setup <b>username</b> <li>As the freeside UNIX user, run <tt>bin/populate-msgcat <b>username</b></tt> (in the untar'ed freeside directory) to populate the message catalog, passing the username of a Freeside user you created above: <pre> $ su freeside -$ cd <b>/path/to/freeside-1.4.0/</b> +$ cd <b>/path/to/freeside/</b> $ bin/populate-msgcat <b>username</b> </pre> <li><tt>freeside-queued</tt> was installed with the Perl modules. Start it now and ensure that is run upon system startup (Do this manually, or edit the top-level Makefile, replacing INIT_FILE with the appropriate location on your systemand QUEUED_USER with the username of a Freeside user you created above, and run <tt>make install-init</tt>) |