Difference between revisions of "Freeside:3:Documentation:Installation"

From Freeside
Jump to: navigation, search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
 +
 +
These are from-scratch installation instructions for the raw source code.  They are suitable for intermediate-to-advanced sysadmins.  Folks looking for easy installation are advised to try the VMware appliance or Debian packages instead.
  
 
Install Freeside on a firewalled, private server, not a public (web, RADIUS, etc.) server.
 
Install Freeside on a firewalled, private server, not a public (web, RADIUS, etc.) server.
Line 7: Line 9:
 
=== Packages ===
 
=== Packages ===
  
* [http://www.perl.org/ Perl], minimum version 5.8.4
+
* [http://www.perl.org/ Perl], minimum version 5.10.1 (minimum version regularly tested is 5.14.2)
* [http://httpd.apache.org/ Apache], SSL highly recommended)
+
* [http://httpd.apache.org/ Apache], SSL highly recommended
 
* [http://perl.apache.org/ mod_perl]
 
* [http://perl.apache.org/ mod_perl]
 
** If compiling your own mod_perl, make sure you set the EVERYTHING=1 compile-time option
 
** If compiling your own mod_perl, make sure you set the EVERYTHING=1 compile-time option
 
* A '''transactional''' database engine [http://search.cpan.org/search?mode=module&query=DBD%3A%3A supported] by Perl's [http://dbi.perl.org/ DBI].  
 
* A '''transactional''' database engine [http://search.cpan.org/search?mode=module&query=DBD%3A%3A supported] by Perl's [http://dbi.perl.org/ DBI].  
 
** [http://www.postgresql.org PostgreSQL] is recommended.
 
** [http://www.postgresql.org PostgreSQL] is recommended.
** [http://www.mysql.com MySQL] is supported.  Freeside v3.4 or later and DBIx::DBSchema 0.35 or later are required.
+
** [http://www.mysql.com MySQL] and [http://www.mariadb.org/ MariaDB] are supported.  Freeside v3.4 or later and DBIx::DBSchema 0.35 or later are required.
  
 
''Note: the above only applies to the database used by the Freeside software itself. Freeside can integrate with RADIUS and other servers running a different database than the backend.''
 
''Note: the above only applies to the database used by the Freeside software itself. Freeside can integrate with RADIUS and other servers running a different database than the backend.''
Line 86: Line 88:
 
* [http://search.cpan.org/dist/Crypt-OpenSSL-RSA Crypt::OpenSSL::RSA]
 
* [http://search.cpan.org/dist/Crypt-OpenSSL-RSA Crypt::OpenSSL::RSA]
 
* [http://search.cpan.org/dist/Date-Simple Date::Simple]
 
* [http://search.cpan.org/dist/Date-Simple Date::Simple]
 +
* [http://search.cpan.org/dist/DateTime-Format-ICal DateTime::Format::ICal]
 
* [http://search.cpan.org/dist/DateTime-Set DateTime::Set]
 
* [http://search.cpan.org/dist/DateTime-Set DateTime::Set]
 
* [http://search.cpan.org/dist/DBIx-DBSchema DBIx::DBSchema]
 
* [http://search.cpan.org/dist/DBIx-DBSchema DBIx::DBSchema]
Line 109: Line 112:
 
* [http://search.cpan.org/dist/Time-Duration Time::Duration]
 
* [http://search.cpan.org/dist/Time-Duration Time::Duration]
 
* [http://search.cpan.org/dist/XML-LibXML-LazyBuilder XML::LibXML::LazyBuilder]
 
* [http://search.cpan.org/dist/XML-LibXML-LazyBuilder XML::LibXML::LazyBuilder]
 +
* [http://search.cpan.org/dist/Net-HTTPS-Any Net::HTTPS::Any]
  
 
==== Optional modules ====
 
==== Optional modules ====
Line 247: Line 251:
  
 
=== RT ===
 
=== RT ===
* Either [[Freeside:1.9:Documentation:RT_Installation|install the integrated RT ticketing system]], or delete the <code>ticket_system</code> entry from your conf table.
+
* It is recommended to [[Freeside:3:Documentation:RT_Installation|install the integrated RT ticketing system]], even if you will not be using it.  Alternatively, if you are interested in working on fixes to run without integrated ticketing, delete the <code>ticket_system</code> entry from your conf table.
  
 
<pre>
 
<pre>
Line 258: Line 262:
 
* Restart Apache (httpd) and log into the web interface using the username and password you entered above.
 
* Restart Apache (httpd) and log into the web interface using the username and password you entered above.
  
* Now proceed to the initial [[Freeside:1.9:Documentation:Administration|administration]] of your installation.
+
* Now proceed to the initial [[Freeside:3:Documentation:Administration|administration]] of your installation.

Latest revision as of 07:30, 26 September 2016

Introduction

These are from-scratch installation instructions for the raw source code. They are suitable for intermediate-to-advanced sysadmins. Folks looking for easy installation are advised to try the VMware appliance or Debian packages instead.

Install Freeside on a firewalled, private server, not a public (web, RADIUS, etc.) server.

Prerequisites

Packages

  • Perl, minimum version 5.10.1 (minimum version regularly tested is 5.14.2)
  • Apache, SSL highly recommended
  • mod_perl
    • If compiling your own mod_perl, make sure you set the EVERYTHING=1 compile-time option
  • A transactional database engine supported by Perl's DBI.
    • PostgreSQL is recommended.
    • MySQL and MariaDB are supported. Freeside v3.4 or later and DBIx::DBSchema 0.35 or later are required.

Note: the above only applies to the database used by the Freeside software itself. Freeside can integrate with RADIUS and other servers running a different database than the backend.

  • TeX (teTeX / TeX Live) and Ghostscript (included with most distributions) (Optional, enables typeset invoices)

Perl modules

Popular modules

These modules are included in most distributions.

Common modules

These modules are included in many distributions.

Additional modules

Optional modules

Note on missing modules

Prerequisites missing from the documentation? Please add them (in the appropriate section).

Download Freeside

Installation

System User

  • Add the user and group `freeside' to your system.

Database User

  • Allow the freeside user full access to the freeside database.

with Postgresql:

[ as postgres/pgsql user ]
$ createuser -P freeside 
Enter password for new role: 
Enter it again: 
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n

or with MySQL:

$ mysqladmin -u root password 'set_a_root_database_password'
$ mysql -u root -p
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP on freeside.* TO freeside@localhost IDENTIFIED BY 'set_a_freeside_database_password';

Database Access

  • Edit the top-level Makefile:
    • Configure the DATASOURCE to your DBI data source
      • Set the DB_TYPE (Pg or mysql)
      • See the DBI manpage and the manpage for your DBD for the exact syntax of your DBI data source.
    • Set DB_PASSWORD to the freeside database user's password.

Database

  • Add the freeside database to your database engine:

with Postgres:

$ su freeside
$ createdb -E UTF8 freeside

or with MySQL:

$ mysqladmin -u freeside -p create freeside 

Perl Modules

  • Build and install the Perl modules:
$ make perl-modules
$ su
# make install-perl-modules

Basic configuration Files

  • Create the necessary configuration files:
$ su
# make create-config

Invoice Typesetting

  • If you are using typeset invoices, install fslongtable.sty:
$ su
# make install-texmf

Apache & Web GUI

  • Configuration
    • Enable mod_perl
    • Run as User freeside
      • If you have other things being served by Apache on this machine (hopefully internal things), it is recommended to run a separate iteration of Apache as the freeside user.
  • Edit the Makefile and set FREESIDE_DOCUMENT_ROOT.
  • To install the web interface, run:
$ su
# make install-docs
  • Edit the Makefile and set APACHE_VERSION to 1 (mod_perl v1.XX), 1.99 (mod_perl v2 prereleases up to and including 1.999_21, shipped with Debian 3.1, CentOS/RHEL 4, others), or 2 (mod_perl v2 proper and prereleases 1.999_22 and later).
  • Edit the Makefile and set APACHE_CONF to the location of an Apache include directory (not a file). (If your Apache doesn't have an existing include directory, create one and add a line such as "Include /etc/apache/conf.d" to httpd.conf.)
  • To install the apache configs, run:
$ su
# make install-apache

Note: Do not attempt to restart Apache (httpd) yet.

Initialize Data

  • As the freeside UNIX user, run freeside-setup -d your.domain.name to create the database tables and initial data.
$ su freeside
$ freeside-setup -d example.com

Additional System Users

  • Create the Freeside system users:
$ su freeside
$ freeside-adduser -g 1 fs_queue
$ freeside-adduser -g 1 fs_daily
$ freeside-adduser -g 1 fs_selfservice
$ freeside-adduser -g 1 fs_api

Create Freeside Users

  • Create one or more Freeside users (your internal sales/tech folks, not customer accounts):
$ su freeside
$ freeside-adduser -g 1 username
$ htpasswd /usr/local/etc/freeside/htpasswd username
Password: 

Additional users can be added using the same command or from the web interface.

Queue Daemon

  • freeside-queued 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 system and QUEUED_USER with the username of a Freeside user you created above, and run make install-init)

RT

  • It is recommended to install the integrated RT ticketing system, even if you will not be using it. Alternatively, if you are interested in working on fixes to run without integrated ticketing, delete the ticket_system entry from your conf table.
su freeside
psql freeside
delete from conf where name = 'ticket_system';

Finalize

  • Restart Apache (httpd) and log into the web interface using the username and password you entered above.