whew more install docs and automation
authorivan <ivan>
Tue, 30 Oct 2001 11:47:54 +0000 (11:47 +0000)
committerivan <ivan>
Tue, 30 Oct 2001 11:47:54 +0000 (11:47 +0000)
FS/bin/freeside-adduser
Makefile
httemplate/docs/admin.html
httemplate/docs/config.html
httemplate/docs/index.html
httemplate/docs/install.html

index 4517a83..e66b0d0 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# $Id: freeside-adduser,v 1.1 2001-10-30 10:20:32 ivan Exp $
+# $Id: freeside-adduser,v 1.2 2001-10-30 11:47:54 ivan Exp $
 
 use strict;
 use vars qw($opt_h $opt_c);
@@ -33,9 +33,9 @@ freeside-adduser - Command line interface to add (freeside) users.
 
 =head1 SYNOPSIS
 
-  freeside-adduser [ -h htpasswd_file [ -c ] ] username
+  freeside-adduser [ -h htpasswd_file [ -c ] ] secretfile username
 
-=head DESCRIPTION
+=head1 DESCRIPTION
 
 Adds a user to the Freeside billing system.  This is for adding users (internal
 sales/tech folks) to the web interface, not for adding customer accounts.
index 90b6bf4..3b02625 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,11 @@
 #!/usr/bin/make
 
-#Pg
 DATASOURCE = DBI:Pg:host=localhost;dbname=freeside
+#DATASOURCE=DBI:mysql:freeside
 #pgsql on some systems; check /etc/passwd
-DB_ADMIN_USER = postgres
-DB_ADMIN_PASSWORD=
 
-#mysql
-#DATASOURCE=DBI:mysql:freeside
-#DB_ADMIN_USER=mysql
-#DB_ADMIN_PASSWORD=
+DB_USER = freeside
+DB_PASSWORD=
 
 TEMPLATE = asp
 #mason's a bit dodgy stil
@@ -57,7 +53,7 @@ perl-modules:
 
 install-perl-modules: perl-modules
        cd FS; \
-       make install
+       make install UNINST=1
 
 install: install-perl-modules install-docs
 
@@ -65,12 +61,14 @@ deploy: install
        /etc/init.d/apache restart
 
 create-database:
-       perl -e 'use DBIx::DataSource qw( create_database ); create_database( \'${DATASOURCE}\', \'${DB_ADMIN_USER}\', \'${DB_ADMIN_PASSWORD}\' ) or die $DBIx::DataSource::errstr;'
+       perl -e 'use DBIx::DataSource qw( create_database ); create_database( \'${DATASOURCE}\', \'${DB_USER}\', \'${DB_PASSWORD}\' ) or die $DBIx::DataSource::errstr;'
 
 create-config: install-perl-modules
        [ -d ${FREESIDE_CONF} ] || mkdir ${FREESIDE_CONF}
        chown freeside ${FREESIDE_CONF}
 
+       echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
+
        [ -d "${FREESIDE_CONF}/conf.${DATASOURCE}" ] \
          || mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
        chown freeside "${FREESIDE_CONF/conf.${DATASOURCE}"
index f137188..1dab439 100755 (executable)
   /home/httpd/html/freeside, and your web browser's DocumentRoot is
   /home/httpd/html, open https://your_host/freeside/. Replace
   "your_host" with the name or network address of your web server.
-
-  <li>Once in the Freeside web interface, you must first create a
-  service definition.  An example of a service definition would be a dial-up
-  account or a domain.  For starters, it is necessary to create a domain
-  definition.  Click on <u>View/Edit service definitions</u> and
-  <u>Add a new service definition</u> with <i>Table</i> <b>svc_domain</b>
-  (and no modifiers).
+  <li>Select <u>Configuration</u> from the main menu and update your configuration values.
+  <li>Next you must create a service definition.  An example of a service
+  definition would be a dial-up account or a domain.  For starters, it is
+  necessary to create a domain definition.  Click on <u>View/Edit service
+  definitions</u> and <u>Add a new service definition</u> with <i>Table</i>
+  <b>svc_domain</b> (and no modifiers).
 
   <li>Now that you have created your first service, you must create a package
   including this service which you can sell to customers.  Zero, one, or many
index 6567237..9caf3bb 100644 (file)
@@ -3,6 +3,7 @@
 </head>
 <body>
   <h1>Configuration files</h1>
+<font size="+1" color="#ff0000">Configuration is now done by the top-level Makefile and web interface.  The instructions below are no longer necessary.</font>
 <ul>
   <li>Create the <b>/usr/local/etc/freeside</b> directory to hold your configuration.
   <li>Setting up <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">Apache user authetication</a> is mandatory.
@@ -18,9 +19,9 @@ admin secretfile
 john secretfile
 sam secretfile
 </pre>
-  <li>Next, the filename(s) referenced in <b>/usr/local/etc/freeside/mapsecrets</b> file should be created in the <b>/usr/local/etc/freeside/</b> directory.  Each file contains three lines: <a href="http://search.cpan.org/doc/TIMB/DBI-1.15/DBI.pm">DBI data source</a> (for example,
+  <li>Next, the filename(s) referenced in <b>/usr/local/etc/freeside/mapsecrets</b> file should be created in the <b>/usr/local/etc/freeside/</b> directory.  Each file contains three lines: <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI data source</a> (for example,
   <tt>DBI:mysql:freeside</tt> or <tt>DBI:Pg:host=localhost;dbname=freeside</tt>), database username, and database password.
-  These files should not be world readable.  See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.15/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source.  In a normal installation such as the example above, a single file <b>/usr/local/etc/freeside/secretfile</b> would be created - for example:
+  These files should not be world readable.  See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source.  In a normal installation such as the example above, a single file <b>/usr/local/etc/freeside/secretfile</b> would be created - for example:
 <pre>
 DBI:Pg:host=localhost;dbname=freeside
 dbusername
index 2d6bfe7..932df05 100644 (file)
@@ -14,7 +14,9 @@
   <li><a href="upgrade6.html">Upgrading from 1.2.3 to 1.3.0</a>
   <li><a href="upgrade7.html">Upgrading from 1.3.0 to 1.3.1</a>
   <li><a href="upgrade8.html">Upgrading from 1.3.1 to 1.4.0</a>
+<!--
   <li><a href="config.html">Configuration files</a>
+!-->
   <li><a href="admin.html">Administration</a>
 <!--
   <li><a href="../index.html#admin">Administration</a>
index 3a14fa7..f2db59f 100644 (file)
@@ -51,20 +51,35 @@ Install the Freeside distribution:
   <li>Add the user `freeside' to your system.
   <li>Allow the freeside user full access to the freeside database.
     <ul>
-      <li> with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#User_Account_Management">MySQL</a>:<pre>$ mysqladmin -u root password '<i>set_a_root_database_password</i>'
+      <li> with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/user-manag.html#DATABASE-USERS">PostgreSQL</a>:
+        <pre>
+$ su freeside
+$ createuser -P freeside</pre>
+      <li> with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#User_Account_Management">MySQL</a>:
+        <pre>
+$ mysqladmin -u root password '<i>set_a_root_database_password</i>'
 $ mysql -u root -p
 mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP on freeside.* TO freeside@localhost IDENTIFIED BY '<i>set_a_freeside_database_password</i>';</pre>
-      <li> with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/user-manag.html#DATABASE-USERS">PostgreSQL</a>
     </ul>
-  <li>Add the freeside database to your database engine.  (with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#CREATE_DATABASE">MySQL</a>) (with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/managing-databases.html#MANAGE-AG-CREATEDB">PostgreSQL</a>)
   <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.20/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.20/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source.
+      <li>Set <tt>DB_ADMIN_PASSWORD</tt> to the freeside database user's password.
+    </ul>
+  <li>Add the freeside database to your database engine:
+    <pre>
+$ su
+# make create-database</pre>
   <li>Build and install the Perl libraries:
     <pre>
-$ cd FS/
-$ perl Makefile.PL
-$ make
+$ make perl-modules
+$ su
+# make install-perl-modules</pre>
+    <li>Create the necessary configuration files:<pre>
 $ su
-# make install UNINST=1</pre>
+# make create-config
+</pre>
     <li>You should run a separate iteration of Apache[-SSL] with mod_perl enabled as the freeside user.
 </ul>
 <table>
@@ -113,22 +128,32 @@ require "/usr/local/apache/conf/handler.pl";
   </tr>
 </table>
 <ul>
-<li>Restrict access to this web interface.  (with <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache</a>).    For example, to configure user authentication with flat files:
-<font size="-1"><pre>
+<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>
 &lt;Directory /usr/local/apache/htdocs/freeside-asp&gt;
 PerlSetVar Global /usr/local/etc/freeside/asp-global/
 AuthName Freeside
 AuthType Basic
-AuthUserFile /usr/local/etc/apache/htpasswd
+AuthUserFile /usr/local/etc/freeside/htpasswd
 require valid-user
 &lt;/Directory&gt;
 </pre>
-<li>Create the necessary <a href="config.html">configuration files</a>.
-<li>Create the `/usr/local/etc/freeside/counters.<i>datasrc</i>', 
-  `/usr/local/etc/freeside/cache.<i>datasrc</i>', and 
-  `/usr/local/etc/freeside/export.<i>datasrc</i>' directories for each <i>datasrc</i> (owned by the freeside user).
-  <li>As the freeside user, run bin/fs-setup to create the database tables.
-  <li>freeside-queued was installed with the Perl modules.  Start it now and ensure that is run upon system startup.
+  <li>Create one or more Freeside users (your internal sales/tech folks, not customer accounts).  These users are setup using using Apache authentication; they're not UNIX user accounts.  For example, using <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files):
+    <ul>
+      <li>First user:<font size="-1">
+<pre>$ su
+$ freeside-adduser -h /usr/local/etc/freeside/htpasswd -c /usr/local/etc/freeside/secrets <i>username</i></pre></font>
+      <li>Additional users:<font size="-1">
+<pre>$ su
+$ freeside-adduser -h /usr/local/etc/freeside/htpasswd /usr/local/etc/freeside/secrets <i>username</i></pre></font>
+    </ul>
+  <i>(using other auth types, add each user to your <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache authentication</a> yand then run: <tt>freeside-adduser /usr/local/etc/freeside/secrets <b>username</b></tt></i>
+  <li>As the freeside UNIX user, run <tt>bin/fs-setup <b>username</b></tt> to create the database tables, passing the username of a Freeside user you created above:
+<pre>
+$ su freeside
+$ bin/fs-setup <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.
   <li>Now proceed to the initial <a href="admin.html">administration</a> of your installation.
 </ul>
 </body>