Difference between revisions of "Freeside:1.7:Documentation:InstallingOnFreeBSD"

From Freeside
Jump to: navigation, search
(reverting spam)
 
(29 intermediate revisions by 16 users not shown)
Line 1: Line 1:
Setting up a FreeBSD server for Freeside
+
'''Setting up a FreeBSD server for Freeside'''
  
  
1. Install FreeBSD.  -  Do the complete install from CD.
+
:1. Install FreeBSD.  -  Do the complete install from CD.
  
a. Insert Freebsd CD & boot to CD
+
::a. Insert Freebsd CD & boot to CD
  
b. Select “Custom”
+
::b. Select “Custom”
  
c. Select “Partition”
+
::c. Select “Partition”
  
d. Use “D” to Delete any existing partitions
+
::d. Use “D” to Delete any existing partitions
  
e. Use “C” to Create slices (this is just the drive, use one slice)
+
::e. Use “C” to Create slices (this is just the drive, use one slice)
  
f. Use “Q” to save & exit
+
::f. Use “Q” to save & exit
  
g. Select “BootMgr”
+
::g. Select “BootMgr”
  
h. Select “Label”
+
::h. Select “Label”
  
i. Use “C” to create partitions
+
::i. Use “C” to create partitions
  
j. Setup swap partition first (2 x RAM) – use “m” at end of number to denote mb
+
::j. Setup swap partition first (2 x RAM) – use “m” at end of number to denote mb
  
k. Select “swap” as partition type
+
::k. Select “swap” as partition type
  
l. Setup other partitions – mount point for OS is “/”
+
::l. Setup other partitions – mount point for OS is “/”
  
m. Use “Q” to save & finish
+
::m. Use “Q” to save & finish
  
n. Select “Distributions”
+
::n. Select “Distributions”
  
o. Select “All”
+
::o. Select “All”
  
p. Select “Yes”
+
::p. Select “Yes”
  
q. Select “Exit”
+
::q. Select “Exit”
  
r. Select “Media”
+
::r. Select “Media”
  
s. Select “CD/DVD”
+
::s. Select “CD/DVD”
  
t. Select “Commit”
+
::t. Select “Commit”
  
u. Select “Yes”
+
::u. Select “Yes”
  
v. Select “No”
+
::v. Select “No”
  
w. Select “Exit”
+
::w. Select “Exit”
  
x. Select “X”
+
::x. Select “X”
  
y. Select “Yes” & remove CD
+
::y. Select “Yes” & remove CD
  
2. Configure the server
+
:2. Configure the server
  
a. adduser  “adduser” (set up a user for use later so you don’t have to log into root everytime)
+
::a. adduser  “adduser” (set up a user for use later so you don’t have to log into root everytime)
  
b. set root password  “passwd”
+
::b. set root password  “passwd”
  
c. Edit the rc.conf in etc
+
::c. Edit the rc.conf in etc
  
i. hostname=”boxname.your.domain”
+
:::i. hostname=”boxname.your.domain”
  
ii. ifconfig_fxp0=”your.ip.here netmask your.subnet.here”
+
:::ii. ifconfig_fxp0=”your.ip.here netmask your.subnet.here”
  
iii. defaultrouter=”your.gateway.ip.here”
+
:::iii. defaultrouter=”your.gateway.ip.here”
  
iv. inetd_enable=”YES”
+
:::iv. inetd_enable=”YES”
  
v. sshd_enable=”YES”
+
:::v. sshd_enable=”YES”
  
vi. keyrate=”fast”
+
:::vi. keyrate=”fast”
  
vii. update_motd=”NO”
+
:::vii. update_motd=”NO”
  
viii. kern_securelevel_enable=”NO”
+
:::viii. kern_securelevel_enable=”NO”
  
ix. usbd_enable=”YES”
+
:::ix. usbd_enable=”YES”
  
x. syslogd_flags=”-s”
+
:::x. syslogd_flags=”-s”
  
xi. sendmail_enable=”NONE”
+
:::xi. sendmail_enable=”NONE”
  
xii. apache22_enable=”YES”
+
:::xii. apache22_enable=”YES”
  
xiii. postgresql_enable=”YES”
+
:::xiii. postgresql_enable=”YES”
  
  
d. Enable root ssh logon
+
::d. Enable root ssh logon
  
i. Edit /etc/ssh/sshd_config to allow root login by changing to yes and unremarking line
+
::i. Edit /etc/ssh/sshd_config to allow root login by changing to yes and unremarking line
  
e. “cd /etc”
+
::e. “cd /etc”
  
f. “vi resolv.conf”
+
::f. “vi resolv.conf”
  
i. domain your.domain
+
:::i. domain your.domain
  
ii. nameserver your.dns.ip.here
+
:::ii. nameserver your.dns.ip.here
  
  
g. reboot
+
::g. reboot
  
h. portsnap fetch
+
::h. portsnap fetch
  
i. portsnap extract
+
::i. portsnap extract
  
3. Perl is already installed with Freebsd, use existing install (Satisfies Freeside install step 1.)
+
:3. Perl is already installed with Freebsd, use existing install (Satisfies Freeside install step 1.) However, make sure you're running Perl v5.8.8 'perl -v' otherwise you'll have some syntax errors later on.
  
4. Install Apache
+
:4. Install Apache
  
a. “cd /usr/ports/www/apache22”
+
::a. “cd /usr/ports/www/apache22”
  
b. “make && make install” (use defaults for any gui)
+
::b. “make && make install” (use defaults for any gui)
  
c. “vi  usr/local/etc/apache22/httpd.conf”
+
:::c. “vi  usr/local/etc/apache22/httpd.conf”
  
i. Listen IP:Port  
+
:::i. Listen IP:Port  
  
ii. ServerAdmin youremail@yourdomain.com
+
:::ii. ServerAdmin youremail@yourdomain.com
  
iii. ServerName your.servername:80
+
:::iii. ServerName your.servername:80
  
iv. Reboot
+
:::iv. Reboot
  
5. Step two of Freeside install instructions almost completed, set up ssl later.
+
:5. Step two of Freeside install instructions almost completed, set up ssl later.
  
6. Install the cpan bundle & Apache bundle
+
:6. Install the cpan bundle & Apache bundle
  
a. “perl –MCPAN –e shell; “
+
::a. “perl –MCPAN –e shell; “
  
b. type “no“
+
::b. type “no“
  
c. “install Bundle::CPAN“ (watch error messages at end has taken as many as 7 times to get full load)
+
::c. “install Bundle::CPAN“ (watch error messages at end has taken as many as 7 times to get full load)
  
d. “reload cpan“
+
::d. “reload cpan“
  
e. “install Bundle::Apache2”
+
::e. “install Bundle::Apache2”
  
f. “quit”
+
::f. “quit”
  
7. Install mod_perl – first download the latest mod_perl to one of your ftp servers
+
:7. Install mod_perl – first download the latest mod_perl to one of your ftp servers
  
a. “mkdir /home/youruserfromstep2a/programs”
+
::a. “mkdir /home/youruserfromstep2a/programs”
  
b. “cd  /home/ youruserfromstep2a /programs”
+
::b. “cd  /home/ youruserfromstep2a /programs”
  
c. “ftp yourftpserver“
+
::c. “ftp yourftpserver“
  
d. “cd filelocation “
+
::d. “cd filelocation “
  
e. “bin“
+
::e. “bin“
  
f. “get mod_perl-2.0-current.tar.gz”
+
::f. “get mod_perl-2.0-current.tar.gz”
  
g. “quit“
+
::g. “quit“
  
h. “tar –xvzf mod<tab>“
+
::h. “tar –xvzf mod<tab>“
  
i. “cd mod_perl-2.0.3“
+
::i. “cd mod_perl-2.0.3“
  
j. “perl Makefile.PL APACHE_SRC=/usr/ports/www/apache22\
+
::j. “perl Makefile.PL APACHE_SRC=/usr/ports/www/apache22\
 
EVERYTHING=1“ (apxs source is /usr/local/sbin/apxs)
 
EVERYTHING=1“ (apxs source is /usr/local/sbin/apxs)
  
k. “make && make install“
+
::k. “make && make install“
  
l. “/usr/local/sbin/apxs –q LIBEXECDIR“ (should be /usr/local/libexec/apache22, so line would be libexec/apache22/mod_perl.so)
+
::l. “/usr/local/sbin/apxs –q LIBEXECDIR“ (should be /usr/local/libexec/apache22, so line would be libexec/apache22/mod_perl.so)
  
m. add to httpd.conf – LoadModule perl_module results of above/mod_perl.so (at bottom of LoadModule section)
+
::m. add to httpd.conf – LoadModule perl_module results of above/mod_perl.so (at bottom of LoadModule section)
  
n. “apachectl restart“
+
::n. “apachectl restart“
  
8. Install OpenSSH (use defaults on GUI)
+
:8. Install OpenSSH (use defaults on GUI)
  
a. “cd /usr/ports/security/openssh“
+
::a. “cd /usr/ports/security/openssh“
  
b. “make && make install && reboot“
+
::b. “make && make install && reboot“
  
9. Install rsync: (use defaults on GUI)
+
:9. Install rsync: (use defaults on GUI)
  
a. “cd /usr/ports/net/rsync“
+
::a. “cd /usr/ports/net/rsync“
  
b. “make && make install && reboot“
+
::b. “make && make install && reboot“
  
10. Install Postgresql (use defaults on GUI)
+
:10. Install Postgresql (use defaults on GUI)
  
a. “cd /usr/ports/databases/postgresql81-server“
+
::a. “cd /usr/ports/databases/postgresql81-server“
  
b. “make && make install“
+
::b. “make && make install“
  
c. Initialize postgresql  -- “/usr/local/etc/rc.d/postgresql initdb” (you should see it build the database files needed here, if it doesn’t, then the postgresql install was bad and you need to restart the build process)
+
::c. Initialize postgresql  -- “/usr/local/etc/rc.d/postgresql initdb” (you should see it build the database files needed here, if it doesn’t, then the postgresql install was bad and you need to restart the build process)
  
d. Configure for OID
+
::d. Configure for OID
  
i. “vi /usr/local/pgsql/data/postgresql.conf“
+
:::i. “vi /usr/local/pgsql/data/postgresql.conf“
  
ii. enable oid by changing to yes and unremarking line
+
:::ii. enable oid by changing to yes and unremarking line
  
e. reboot
+
::e. reboot
  
  
11. Install teTex
+
:11. Install teTex
  
a. “cd /usr/ports/print/teTeX”
+
::a. “cd /usr/ports/print/teTeX”
  
b. “make && make install”
+
::b. “make && make install”
  
12. Install the required perl modules (At this point I recommend two interfaces into the box.  I usually use the terminal and an SSH session.  If a module errors out, go to a different screen and force the install before proceeding to the next item.  I’ve found the order these modules load seems to matter.  You must cd to /root/.cpan/build and find the package directory and cd into it to run the manual make.  First run “perl Makefile.PL”, then “make” and finally “make install”)
+
:12. Install the required perl modules (At this point I recommend two interfaces into the box.  I usually use the terminal and an SSH session.  If a module errors out, go to a different screen and force the install before proceeding to the next item.  I’ve found the order these modules load seems to matter.  You must cd to /root/.cpan/build and find the package directory and cd into it to run the manual make.  First run “perl Makefile.PL”, then “make” and finally “make install”)
  
a. “perl –MCPAN –e shell;”
+
::a. “perl –MCPAN –e shell;”
  
b. type “no”
+
::b. type “no”
  
c. install MIME::Base64
+
::c. install MIME::Base64
  
d. install Digest::MD5
+
::d. install Digest::MD5
  
e. install URI
+
::e. install URI
  
f. install HTML::Tagset
+
::f. install HTML::Tagset
  
g. install HTML::Parser
+
::g. install HTML::Parser
  
h. i /libnet/
+
::h. i /libnet/
  
i. install (full name of latest version of libnet)
+
::i. install (full name of latest version of libnet)
  
j. install Locale::Country
+
::j. install Locale::Country
  
k. install Net::Whois::Raw
+
::k. install Net::Whois::Raw
  
l. install libwww  
+
::l. install libwww  
  
m. install Bundle::LWP
+
::m. install Bundle::LWP
  
n. install Business::CreditCard
+
::n. install Business::CreditCard
  
o. i /MailTools/
+
::o. i /MailTools/
  
p. install (full name of latest version of mailtools)
+
::p. install (full name of latest version of mailtools)
  
q. i /TimeDate/
+
::q. i /TimeDate/
  
r. Install (full name of latest version of TimeDate)
+
::r. Install (full name of latest version of TimeDate)
  
s. install DateManip
+
::s. install DateManip
  
t. install File::CounterFile
+
::t. install File::CounterFile
  
u. install FreezeThaw
+
::u. install FreezeThaw
  
v. install String::Approx
+
::v. install String::Approx
  
w. install Text::Template
+
::w. install Text::Template
  
x. install DBI
+
::x. install DBI
  
y. install DBD::Pg
+
::y. install DBD::Pg
  
z. install DBIx::DBSchema
+
::z. install DBIx::DBSchema
  
aa. install Net::SSH
+
::aa. install Net::SSH
  
bb. install String::ShellQuote
+
::bb. install String::ShellQuote
  
cc. i /IVAN/Net/
+
::cc. i /IVAN/Net/
  
dd. install (full name of latest version of NET-SCP)
+
::dd. install (full name of latest version of NET-SCP)
  
ee. install HTML::Mason (apache src is /usr/ports/www/apache22)
+
::ee. install HTML::Mason (apache src is /usr/ports/www/apache22)
  
ff. install Tie::IxHash
+
::ff. install Tie::IxHash
  
gg. install Time::Duration
+
::gg. install Time::Duration
  
hh. install HTML::Widgets::SelectLayers
+
::hh. install HTML::Widgets::SelectLayers
  
ii. install Storable
+
::ii. install Storable
  
jj. install Cache::Cache
+
::jj. install Cache::Cache
  
kk. install NetAddr::IP
+
::kk. install NetAddr::IP
  
ll. install Chart::Base
+
::ll. install Chart::Base
  
mm. install Crypt::PasswdMD5
+
::mm. install Crypt::PasswdMD5
  
nn. install Locale::SubCountry
+
::nn. install Locale::SubCountry
  
oo. install JavaScript::RPC
+
::oo. install JavaScript::RPC
  
pp. install Frontier::RPC2
+
::pp. install Frontier::RPC2
  
qq. i /JWIED/Text/
+
::qq. install Text::CSV_XS
  
rr. install (full name of latest version of Text-CSV_X)
+
::rr. install Spreadsheet::WriteExcel
  
ss. install Spreadsheet::WriteExcel
+
::ss. install IO::Stringy
  
tt. install IO::Stringy
+
::tt. install MIME::Tools
  
uu. install MIME::Tools
+
::uu. install Apache::Session
  
vv. install Apache::Session
+
::vv. install HTML::TreeBuilder
  
ww. install HTML::TreeBuilder
+
::ww. install HTML::FormatText
  
xx. install HTML::FormatText
+
::xx. install Test::Inline
  
yy. install Test::Inline
+
::yy. install Class::ReturnValue
  
zz. install Class::ReturnValue
+
::zz. install DBIx::SearchBuilder
  
aaa. install DBIx::SearchBuilder
+
::aaa. install Log::Dispatch
  
bbb. install Log::Dispatch
+
::bbb. install Locale::Maketext::Lexicon
  
ccc. install Locale::Maketext::Lexicon
+
::ccc. install Locale::Maketext::Fuzzy
  
ddd. install Locale::Maketext::Fuzzy
+
::ddd. install Text::Wrapper
  
eee. install Text::Wrapper
+
::eee. install Time::ParseDate
  
fff. install Time::ParseDate
+
::fff. install Term::ReadKey
  
ggg. install Term::ReadKey
+
::ggg. install Text::Autoformat
  
hhh. install Text::Autoformat
+
::hhh. install Text::Quoted
  
iii. install Text::Quoted
+
::iii. install Regexp::Common
  
jjj. install Regexp::Common
+
::jjj. install HTML::Scrubber
  
kkk. install HTML::Scrubber
+
::kkk. install Tree::Simple
  
lll. install Tree::Simple
+
::lll. install JSON
  
mmm. install JSON
+
::mmm. install GD
  
nnn. install GD
+
::nnn. install DateTime::Format::Strptime
  
ooo. install DateTime::Format::Strptime
+
::ooo. install IPC::Run3
  
ppp. install IPC::Run3
+
::ppp. install Color::Scheme
  
qqq. install Color::Scheme
+
::qqq. install Data::Table
  
rrr. install Data::Table
+
::rrr. install Lingua::EN::NameParse
  
sss. install Lingua::EN::NameParse
+
::sss. install Lingua::EN::Inflect
  
ttt. install Lingua::EN::Inflect
+
::ttt. install Apache::DBI
  
uuu. install Apache::DBI
+
::uuu. install HTTP::BrowserDetect
  
vvv. install HTTP::BrowserDetect
+
::vvv. “quit”
  
www. “quit”
 
  
  
  
 +
'''Setting up a FreeSide server.'''
  
Setting up a FreeSide server.
 
  
 +
:1. Get Freeside ready to install  -  Download the latest freeside tarball to your ftp server
  
1. Get Freeside ready to install  -  Download the latest freeside tarball to your ftp server
+
::a. “cd /home/ youruserfromstep2a /programs“
  
a. “cd /home/ youruserfromstep2a /programs“
+
::b. “ftp yourftpserver“ (log in)
  
b. “ftp yourftpserver“ (log in)
+
::c. “cd filelocation “
  
c. “cd filelocation “
+
::d. “bin”
  
d. “bin”
+
::e. “get free<tab>”
  
e. “get free<tab>”
+
::f. “get Makefile”
  
f. “get Makefile”
+
::g. “quit”
  
g. “quit”
+
::h. “tar –xvzf free<tab>“
  
h. “tar –xvzf free<tab>“
+
::i. “cp Makefile ./freeside/Makefile”
  
i. “cp Makefile ./freeside/Makefile”
+
::j. “cd free<tab>“
  
j. “cd free<tab>“
+
:2. adduser freeside (start with “adduser” and answer questions, pwd yourpasswdhere)
  
2. adduser freeside (start with “adduser” and answer questions, pwd yourpasswdhere)
+
:3. “mkdir /usr/local/www/apache22/data/freeside”
  
3. “mkdir /usr/local/www/apache22/data/freeside”
+
:4. “chown freeside:www /usr/local/www/apache22/data/freeside”
  
4. “chown freeside:www /usr/local/www/apache22/data/freeside”
+
:5. Allow the freeside user full access to the freeside database
  
5. Allow the freeside user full access to the freeside database
+
::a. su pgsql
  
a. su pgsql
+
::b. createuser –P freeside
  
b. createuser –P freeside
+
::c. set password (yourpasswdhere)
  
c. set password (yourpasswdhere)
+
::d. not a superuser
  
d. not a superuser
+
::e. yes to create database
  
e. yes to create database
+
::f. no to create role
  
f. no to create role
+
:6. Add the freeside database
  
6. Add the freeside database
+
::a. su freeside
  
a. su freeside
+
::b. createdb –E sql_ascii freeside
  
b. createdb –E sql_ascii freeside
+
:7. Build and install the Perl modules
  
7. Build and install the Perl modules
+
::a. Exit all the way to root
  
a. Exit all the way to root
+
::b. make perl-modules
  
b. make perl-modules
+
::c. make install-perl-modules
 +
:8. Create config files:  “make create-config”
  
c. make install-perl-modules
+
:9. Edit /usr/local/etc/apache22/httpd.conf
  
8. Create config files:  “make create-config”
+
::a. Change user & group to freeside
  
9. Edit /usr/local/etc/apache22/httpd.conf
+
:10. apachectl restart
  
a. Change user & group to freeside
+
:11. ps –aux (make sure apache now running as freeside)
 +
:12. “make install-docs”
  
10. apachectl restart
+
:13. Edit the httpd.conf for freeside
  
11. ps –aux (make sure apache now running as freeside)
+
::a. Edit /usr/local/etc/apache22/httpd.conf
  
12. “make install-docs”
+
::b. At bottom add “Include etc/apache22/Includes/”
  
13. Edit the httpd.conf for freeside
 
  
a. Edit /usr/local/etc/apache22/httpd.conf
+
:14. Create the database tables and initial data
  
b. At bottom add “Include etc/apache22/Includes/”
+
::a. su freeside
  
 +
::b. freeside-setup –d your.domain
  
14. Create the database tables and initial data
 
  
a. su freeside
 
  
b. freeside-setup –d your.domain
+
:15. Create the Freeside system users
  
 +
::a. su freeside
  
 +
::b. freeside-adduser –g 1 fs_queue
  
15. Create the Freeside system users
+
::c. freeside-adduser –g 1 fs_daily
  
a. su freeside
+
::d. freeside-adduser –g 1 fs_selfservice
  
b. freeside-adduser –g 1 fs_queue
+
:16. Correct access_user.pm
  
c. freeside-adduser –g 1 fs_daily
+
::a. edit /usr/local/lib/perl5/site_perl/5.8.8/FS/access_user.pm
  
d. freeside-adduser –g 1 fs_selfservice
+
::b. change the call to $htpasswd_file to ‘/usr/local/etc/freeside/htpasswd’ instead of just ‘htpasswd’ (about line 18)
  
16. Correct access_user.pm
+
::c. change the        system('htpasswd', '-b', @_,  to        system('/usr/local/sbin/htpasswd', '-b', @_, (about line 130)
  
a. edit /usr/local/lib/perl5/site_perl/5.8.8/FS/access_user.pm
+
:17. Create one or more Freeside users
  
b. change the call to $htpasswd_file to ‘/usr/local/etc/freeside/htpasswd’ instead of just ‘htpasswd’ (about line 18)
+
::a. su freeside
  
c. change the        system('htpasswd', '-b', @_,  to        system('/usr/local/sbin/htpasswd', '-b', @_, (about line 130)
+
::b. freeside-adduser –g 1 yournewuser
  
17. Create one or more Freeside users
+
::c. htpasswd /usr/local/etc/freeside/htpasswd yournewuser
  
a. su freeside
 
  
b. freeside-adduser –g 1 yournewuser
+
:18. Reboot
  
c. htpasswd /usr/local/etc/freeside/htpasswd yournewuser
+
:19. Get the correct httpd.conf with all the RT info
  
 +
::a. Edit the /usr/local/etc/apache22/httpd.conf file
  
18. Reboot
+
::b. Add the following near the end
  
19. Get the correct httpd.conf with all the RT info
 
  
a. Edit the /usr/local/etc/apache22/httpd.conf file
+
:::<Directory /usr/local/www/apache22/data/freeside>
  
b. Add the following near the end
+
:::<Files ~ "\.(cgi|html)">
  
 +
:::AddHandler perl-script .cgi .html
  
<Directory /usr/local/www/apache22/data/freeside>
+
:::PerlHandler HTML::Mason
  
<Files ~ "\.(cgi|html)">
+
:::</Files>
  
AddHandler perl-script .cgi .html
+
:::AuthName freeside
  
PerlHandler HTML::Mason
+
:::AuthType Basic
  
</Files>
+
:::AuthUserFile /usr/local/etc/freeside/htpasswd
  
AuthName freeside
+
:::Require valid-user
  
AuthType Basic
+
:::</Directory>
  
AuthUserFile /usr/local/etc/freeside/htpasswd
+
:::<Perl>
  
Require valid-user
+
:::require "/usr/local/etc/freeside/handler.pl";
  
</Directory>
+
:::</Perl>
  
<Perl>
+
:::<Directory /usr/local/www/apache22/data/freeside/rt/NoAuth>
  
require "/usr/local/etc/freeside/handler.pl";
+
:::<Limit GET POST>
  
</Perl>
+
:::allow from all
  
<Directory /usr/local/www/apache22/data/freeside/rt/NoAuth>
+
:::Satisfy Any
  
<Limit GET POST>
+
:::SetHandler perl-script
  
allow from all
+
:::PerlHandler HTML::Mason
  
Satisfy Any
+
:::</Limit>
  
SetHandler perl-script
+
:::</Directory>
  
PerlHandler HTML::Mason
 
  
</Limit>
+
:::<Directory /usr/local/www/apache22/data/freeside/rt/REST/1.0/NoAuth>
  
</Directory>
+
:::<Limit GET POST>
  
 +
:::allow from all
  
<Directory /usr/local/www/apache22/data/freeside/rt/REST/1.0/NoAuth>
+
:::Satisfy any
  
<Limit GET POST>
+
:::SetHandler perl-script
  
allow from all
+
:::PerlHandler HTML::Mason
  
Satisfy any
+
:::</Limit>
  
SetHandler perl-script
+
:::</Directory>
  
PerlHandler HTML::Mason
 
  
</Limit>
+
:::<DirectoryMatch "^%/usr/local/www/apache22/data/freeside/rt/.*NoAuth/images">
  
</Directory>
+
:::SetHandler None
  
 +
:::</DirectoryMatch>
  
<DirectoryMatch "^%/usr/local/www/apache22/data/freeside/rt/.*NoAuth/images">
 
  
SetHandler None
+
:::<Directory /usr/local/www/apache22/data/freeside/rt/Ticket/Attachment>
  
</DirectoryMatch>
+
:::SetHandler perl-script
  
 +
:::PerlHandler HTML::Mason
  
<Directory /usr/local/www/apache22/data/freeside/rt/Ticket/Attachment>
+
:::</Directory>
  
SetHandler perl-script
 
  
PerlHandler HTML::Mason
+
:::<Directory /usr/local/www/apache22/data/freeside/rt/Search>
  
</Directory>
+
:::SetHandler perl-script
  
 +
:::PerlHandler HTML::Mason
  
<Directory /usr/local/www/apache22/data/freeside/rt/Search>
+
:::</Directory>
  
SetHandler perl-script
 
  
PerlHandler HTML::Mason
 
  
</Directory>
+
::c. Immediately after  the LoadModules, add
  
  
 +
:::PerlModule HTML::Mason
  
c. Immediately after  the LoadModules, add
 
  
  
PerlModule HTML::Mason
+
:20. adduser rt (password yourpasswordforrt)
  
 +
:21. cd /home/ youruserfromstep2a /programs/freeside
  
 +
:22. Install & setup RT
  
20. adduser rt (password yourpasswordforrt)
+
::a. Make configure-rt
  
21. cd /home/ youruserfromstep2a /programs/freeside
+
::b. Make create-rt
  
22. Install & setup RT
+
::c. Make install-rt
  
a. Make configure-rt
+
:23. Set freeside to run on startup
  
b. Make create-rt
+
::a. su root
  
c. Make install-rt
+
::b. make install-init
  
23. Set freeside to run on startup
+
:24. Reboot
  
a. su root
+
:25. Log into Freeside
  
b. make install-init
+
:26. Go to Ticketing main
  
24. Reboot
+
:27. Go back to billing main
  
25. Log into Freeside
+
:28. Add employee root
  
26. Go to Ticketing main
+
:29. reboot
  
27. Go back to billing main
+
:30. log back into freeside as root
  
28. Add employee root
+
:31. Go to ticketing main, Configuration, Global, User Rights, Give your uid superuser rights
  
29. reboot
+
:32. Go back to billing main and disable the root user
 
 
30. log back into freeside as root
 
 
 
31. Go to ticketing main, Configuration, Global, User Rights, Give your uid superuser rights
 
 
 
32. Go back to billing main and disable the root user
 

Latest revision as of 17:06, 25 July 2009

Setting up a FreeBSD server for Freeside


1. Install FreeBSD. - Do the complete install from CD.
a. Insert Freebsd CD & boot to CD
b. Select “Custom”
c. Select “Partition”
d. Use “D” to Delete any existing partitions
e. Use “C” to Create slices (this is just the drive, use one slice)
f. Use “Q” to save & exit
g. Select “BootMgr”
h. Select “Label”
i. Use “C” to create partitions
j. Setup swap partition first (2 x RAM) – use “m” at end of number to denote mb
k. Select “swap” as partition type
l. Setup other partitions – mount point for OS is “/”
m. Use “Q” to save & finish
n. Select “Distributions”
o. Select “All”
p. Select “Yes”
q. Select “Exit”
r. Select “Media”
s. Select “CD/DVD”
t. Select “Commit”
u. Select “Yes”
v. Select “No”
w. Select “Exit”
x. Select “X”
y. Select “Yes” & remove CD
2. Configure the server
a. adduser “adduser” (set up a user for use later so you don’t have to log into root everytime)
b. set root password “passwd”
c. Edit the rc.conf in etc
i. hostname=”boxname.your.domain”
ii. ifconfig_fxp0=”your.ip.here netmask your.subnet.here”
iii. defaultrouter=”your.gateway.ip.here”
iv. inetd_enable=”YES”
v. sshd_enable=”YES”
vi. keyrate=”fast”
vii. update_motd=”NO”
viii. kern_securelevel_enable=”NO”
ix. usbd_enable=”YES”
x. syslogd_flags=”-s”
xi. sendmail_enable=”NONE”
xii. apache22_enable=”YES”
xiii. postgresql_enable=”YES”


d. Enable root ssh logon
i. Edit /etc/ssh/sshd_config to allow root login by changing to yes and unremarking line
e. “cd /etc”
f. “vi resolv.conf”
i. domain your.domain
ii. nameserver your.dns.ip.here


g. reboot
h. portsnap fetch
i. portsnap extract
3. Perl is already installed with Freebsd, use existing install (Satisfies Freeside install step 1.) However, make sure you're running Perl v5.8.8 'perl -v' otherwise you'll have some syntax errors later on.
4. Install Apache
a. “cd /usr/ports/www/apache22”
b. “make && make install” (use defaults for any gui)
c. “vi usr/local/etc/apache22/httpd.conf”
i. Listen IP:Port
ii. ServerAdmin youremail@yourdomain.com
iii. ServerName your.servername:80
iv. Reboot
5. Step two of Freeside install instructions almost completed, set up ssl later.
6. Install the cpan bundle & Apache bundle
a. “perl –MCPAN –e shell; “
b. type “no“
c. “install Bundle::CPAN“ (watch error messages at end has taken as many as 7 times to get full load)
d. “reload cpan“
e. “install Bundle::Apache2”
f. “quit”
7. Install mod_perl – first download the latest mod_perl to one of your ftp servers
a. “mkdir /home/youruserfromstep2a/programs”
b. “cd /home/ youruserfromstep2a /programs”
c. “ftp yourftpserver“
d. “cd filelocation “
e. “bin“
f. “get mod_perl-2.0-current.tar.gz”
g. “quit“
h. “tar –xvzf mod<tab>“
i. “cd mod_perl-2.0.3“
j. “perl Makefile.PL APACHE_SRC=/usr/ports/www/apache22\

EVERYTHING=1“ (apxs source is /usr/local/sbin/apxs)

k. “make && make install“
l. “/usr/local/sbin/apxs –q LIBEXECDIR“ (should be /usr/local/libexec/apache22, so line would be libexec/apache22/mod_perl.so)
m. add to httpd.conf – LoadModule perl_module results of above/mod_perl.so (at bottom of LoadModule section)
n. “apachectl restart“
8. Install OpenSSH (use defaults on GUI)
a. “cd /usr/ports/security/openssh“
b. “make && make install && reboot“
9. Install rsync: (use defaults on GUI)
a. “cd /usr/ports/net/rsync“
b. “make && make install && reboot“
10. Install Postgresql (use defaults on GUI)
a. “cd /usr/ports/databases/postgresql81-server“
b. “make && make install“
c. Initialize postgresql -- “/usr/local/etc/rc.d/postgresql initdb” (you should see it build the database files needed here, if it doesn’t, then the postgresql install was bad and you need to restart the build process)
d. Configure for OID
i. “vi /usr/local/pgsql/data/postgresql.conf“
ii. enable oid by changing to yes and unremarking line
e. reboot


11. Install teTex
a. “cd /usr/ports/print/teTeX”
b. “make && make install”
12. Install the required perl modules (At this point I recommend two interfaces into the box. I usually use the terminal and an SSH session. If a module errors out, go to a different screen and force the install before proceeding to the next item. I’ve found the order these modules load seems to matter. You must cd to /root/.cpan/build and find the package directory and cd into it to run the manual make. First run “perl Makefile.PL”, then “make” and finally “make install”)
a. “perl –MCPAN –e shell;”
b. type “no”
c. install MIME::Base64
d. install Digest::MD5
e. install URI
f. install HTML::Tagset
g. install HTML::Parser
h. i /libnet/
i. install (full name of latest version of libnet)
j. install Locale::Country
k. install Net::Whois::Raw
l. install libwww
m. install Bundle::LWP
n. install Business::CreditCard
o. i /MailTools/
p. install (full name of latest version of mailtools)
q. i /TimeDate/
r. Install (full name of latest version of TimeDate)
s. install DateManip
t. install File::CounterFile
u. install FreezeThaw
v. install String::Approx
w. install Text::Template
x. install DBI
y. install DBD::Pg
z. install DBIx::DBSchema
aa. install Net::SSH
bb. install String::ShellQuote
cc. i /IVAN/Net/
dd. install (full name of latest version of NET-SCP)
ee. install HTML::Mason (apache src is /usr/ports/www/apache22)
ff. install Tie::IxHash
gg. install Time::Duration
hh. install HTML::Widgets::SelectLayers
ii. install Storable
jj. install Cache::Cache
kk. install NetAddr::IP
ll. install Chart::Base
mm. install Crypt::PasswdMD5
nn. install Locale::SubCountry
oo. install JavaScript::RPC
pp. install Frontier::RPC2
qq. install Text::CSV_XS
rr. install Spreadsheet::WriteExcel
ss. install IO::Stringy
tt. install MIME::Tools
uu. install Apache::Session
vv. install HTML::TreeBuilder
ww. install HTML::FormatText
xx. install Test::Inline
yy. install Class::ReturnValue
zz. install DBIx::SearchBuilder
aaa. install Log::Dispatch
bbb. install Locale::Maketext::Lexicon
ccc. install Locale::Maketext::Fuzzy
ddd. install Text::Wrapper
eee. install Time::ParseDate
fff. install Term::ReadKey
ggg. install Text::Autoformat
hhh. install Text::Quoted
iii. install Regexp::Common
jjj. install HTML::Scrubber
kkk. install Tree::Simple
lll. install JSON
mmm. install GD
nnn. install DateTime::Format::Strptime
ooo. install IPC::Run3
ppp. install Color::Scheme
qqq. install Data::Table
rrr. install Lingua::EN::NameParse
sss. install Lingua::EN::Inflect
ttt. install Apache::DBI
uuu. install HTTP::BrowserDetect
vvv. “quit”



Setting up a FreeSide server.


1. Get Freeside ready to install - Download the latest freeside tarball to your ftp server
a. “cd /home/ youruserfromstep2a /programs“
b. “ftp yourftpserver“ (log in)
c. “cd filelocation “
d. “bin”
e. “get free<tab>”
f. “get Makefile”
g. “quit”
h. “tar –xvzf free<tab>“
i. “cp Makefile ./freeside/Makefile”
j. “cd free<tab>“
2. adduser freeside (start with “adduser” and answer questions, pwd yourpasswdhere)
3. “mkdir /usr/local/www/apache22/data/freeside”
4. “chown freeside:www /usr/local/www/apache22/data/freeside”
5. Allow the freeside user full access to the freeside database
a. su pgsql
b. createuser –P freeside
c. set password (yourpasswdhere)
d. not a superuser
e. yes to create database
f. no to create role
6. Add the freeside database
a. su freeside
b. createdb –E sql_ascii freeside
7. Build and install the Perl modules
a. Exit all the way to root
b. make perl-modules
c. make install-perl-modules
8. Create config files: “make create-config”
9. Edit /usr/local/etc/apache22/httpd.conf
a. Change user & group to freeside
10. apachectl restart
11. ps –aux (make sure apache now running as freeside)
12. “make install-docs”
13. Edit the httpd.conf for freeside
a. Edit /usr/local/etc/apache22/httpd.conf
b. At bottom add “Include etc/apache22/Includes/”


14. Create the database tables and initial data
a. su freeside
b. freeside-setup –d your.domain


15. Create the Freeside system users
a. su freeside
b. freeside-adduser –g 1 fs_queue
c. freeside-adduser –g 1 fs_daily
d. freeside-adduser –g 1 fs_selfservice
16. Correct access_user.pm
a. edit /usr/local/lib/perl5/site_perl/5.8.8/FS/access_user.pm
b. change the call to $htpasswd_file to ‘/usr/local/etc/freeside/htpasswd’ instead of just ‘htpasswd’ (about line 18)
c. change the system('htpasswd', '-b', @_, to system('/usr/local/sbin/htpasswd', '-b', @_, (about line 130)
17. Create one or more Freeside users
a. su freeside
b. freeside-adduser –g 1 yournewuser
c. htpasswd /usr/local/etc/freeside/htpasswd yournewuser


18. Reboot
19. Get the correct httpd.conf with all the RT info
a. Edit the /usr/local/etc/apache22/httpd.conf file
b. Add the following near the end


<Directory /usr/local/www/apache22/data/freeside>
<Files ~ "\.(cgi|html)">
AddHandler perl-script .cgi .html
PerlHandler HTML::Mason
</Files>
AuthName freeside
AuthType Basic
AuthUserFile /usr/local/etc/freeside/htpasswd
Require valid-user
</Directory>
<Perl>
require "/usr/local/etc/freeside/handler.pl";
</Perl>
<Directory /usr/local/www/apache22/data/freeside/rt/NoAuth>
<Limit GET POST>
allow from all
Satisfy Any
SetHandler perl-script
PerlHandler HTML::Mason
</Limit>
</Directory>


<Directory /usr/local/www/apache22/data/freeside/rt/REST/1.0/NoAuth>
<Limit GET POST>
allow from all
Satisfy any
SetHandler perl-script
PerlHandler HTML::Mason
</Limit>
</Directory>


<DirectoryMatch "^%/usr/local/www/apache22/data/freeside/rt/.*NoAuth/images">
SetHandler None
</DirectoryMatch>


<Directory /usr/local/www/apache22/data/freeside/rt/Ticket/Attachment>
SetHandler perl-script
PerlHandler HTML::Mason
</Directory>


<Directory /usr/local/www/apache22/data/freeside/rt/Search>
SetHandler perl-script
PerlHandler HTML::Mason
</Directory>


c. Immediately after the LoadModules, add


PerlModule HTML::Mason


20. adduser rt (password yourpasswordforrt)
21. cd /home/ youruserfromstep2a /programs/freeside
22. Install & setup RT
a. Make configure-rt
b. Make create-rt
c. Make install-rt
23. Set freeside to run on startup
a. su root
b. make install-init
24. Reboot
25. Log into Freeside
26. Go to Ticketing main
27. Go back to billing main
28. Add employee root
29. reboot
30. log back into freeside as root
31. Go to ticketing main, Configuration, Global, User Rights, Give your uid superuser rights
32. Go back to billing main and disable the root user