Difference between revisions of "Freeside:1.7:Documentation:MirroringRPMRepoYaST:Setup"

From Freeside
Jump to: navigation, search
(Initial Installation of the Self-Service Interface)
(Initial Setup)
 
(8 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
==Introduction==
 
==Introduction==
  
This page explains how to mirror the i386 version of the Freeside 1.7 branch "testing" RPM repository for SuSE Linux Enterprise Server (SLES) 10, using wget; and how to use your mirror using YaST2 and zypper.  There's more discussion on the main page on [[Freeside:1.7:Documentation:MirroringRPMRepo|mirroring the RPM repository]].
+
This page explains how to mirror the i386 version of the Freeside 1.7 branch "testing" RPM repository for SuSE Linux Enterprise Server (SLES) 10, using wget.  Instructions on [[Freeside:1.7:Documentation:MirroringRPMRepoYaST:UsingTheMirror|how to use your mirror using YaST2 and zypper are on another page]].  There's more discussion on the main page on [[Freeside:1.7:Documentation:MirroringRPMRepo|mirroring the RPM repository]].
  
===Proxy Servers===
+
==Proxy Servers==
  
 
The following assumes you are not accessing the internet through a proxy server, or that you are using a transparent proxy server that requires no special configuration for client programs.  If this is not the case, you may need to add command line switches to route internet accesses through your proxy server and to authenticate yourself to the server.
 
The following assumes you are not accessing the internet through a proxy server, or that you are using a transparent proxy server that requires no special configuration for client programs.  If this is not the case, you may need to add command line switches to route internet accesses through your proxy server and to authenticate yourself to the server.
  
===Other Assumptions===
 
  
*You are also using the Freeside self-service interface.
 
  
*You are installing the self-service interface on the same computer as the billing server.
+
=Instructions=
  
*You are using PostgreSQL as the database server for Freeside.
+
==Initial Setup==
 
 
*The PostgreSQL database server will be on the same computer as the billing server.
 
 
 
==Instructions==
 
 
 
===Initial Setup===
 
  
 
The Freeside RPM repository is just a web server containing the RPMs and some metadata files. To mirror this, you download the files into a folder (<code>/srv/www/freeside-repo</code>) and then make that folder available to your local client machines via a web server.
 
The Freeside RPM repository is just a web server containing the RPMs and some metadata files. To mirror this, you download the files into a folder (<code>/srv/www/freeside-repo</code>) and then make that folder available to your local client machines via a web server.
 
Replace <code>server.domain.tld</code> in the following with your actual server name.
 
  
 
To set up the mirror initially:
 
To set up the mirror initially:
Line 39: Line 29:
 
<pre>
 
<pre>
 
cd /srv/www/freeside-repo
 
cd /srv/www/freeside-repo
wget --mirror --no-parent --no-host-directories --cut-dirs=1 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/i386/
+
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/i386/
 
</pre>
 
</pre>
  
Line 47: Line 37:
  
 
<pre>
 
<pre>
wget --mirror --no-parent --no-host-directories --cut-dirs=1 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/self-service/i386/
+
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/self-service/i386/
 
</pre>
 
</pre>
  
Line 74: Line 64:
  
 
*Test the repository:
 
*Test the repository:
 +
**Load <code>http://mirror.ip.or.hostname/freeside-repo</code> in your web browser.  (Replace <code>mirror.ip.or.hostname</code> in the following with your actual server name or IP address.)
  
**Load <code>http://server.domain.tld/freeside-repo</code> in your web browser.
+
==Refreshing Your Mirror==
 
 
**Try doing an [[#Initial_Installation_of_Freeside|installation]] or [[#Updating_Your_Freeside_Installation|update]]
 
 
 
===Refreshing Your Mirror===
 
  
 
To refresh the mirror, just repeat the steps to copy down the files:
 
To refresh the mirror, just repeat the steps to copy down the files:
Line 85: Line 72:
 
<pre>
 
<pre>
 
cd /srv/www/freeside-repo
 
cd /srv/www/freeside-repo
wget --mirror --no-parent --no-host-directories --cut-dirs=1 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/i386/
+
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/i386/
wget --mirror --no-parent --no-host-directories --cut-dirs=1 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/self-service/i386/
+
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/self-service/i386/
 
</pre>
 
</pre>
  
Line 97: Line 84:
 
The above commands can be put in a shell script and executed periodically via cron.
 
The above commands can be put in a shell script and executed periodically via cron.
  
===Switching Existing Clients to Your Repository===
 
  
If you've previously installed Freeside (billing server and/or self-service) on a client machine and want to switch it to use your local repository, change the installation sources via zypper or YaST2:
 
  
<pre>
+
=Using Your Mirror=
zypper service-list # Get number of the source using freeside.biz (or wavetail.420.am), say '2'
 
zypper service-delete 2
 
zypper service-add http://server.domain.tld/freeside-repo/repo/sles/10/freeside-1.7/testing/i386
 
zypper service-list # Make sure it's correct
 
</pre>
 
 
 
There's no harm to adding the repository for the self-service files as another installation source:
 
 
 
<pre>
 
zypper service-add http://server.domain.tld/freeside-repo/repo/sles/10/freeside-1.7/testing/self-service/i386
 
</pre>
 
  
===Using Your Mirror===
 
  
Follow the instructions for using the Freeside Internet Services RPM repository ([[Freeside:1.7:Documentation:InstallingUsingYaST|SuSE]]), but substitute the URL of your repository.  These instructions are summarized below.
+
Full instructions for using your mirror are [[Freeside:1.7:Documentation:MirroringRPMRepoYaST:UsingTheMirror|on a separate page]].
 
 
====Initial Installation of Freeside====
 
 
 
<pre>
 
# Add the folder or web server containing SuSE to your installation sources if not already there
 
yast2 inst_source
 
# Enable SSL and Perl scripting for the HTTP server
 
yast2 --install apache2-mod_perl
 
yast2 http-server modules enable=ssl,perl
 
# Configure apache for SSL
 
cd /etc/apache2/vhosts.d
 
cp -p vhost-ssl.template freeside-ssl.conf
 
vi freeside-ssl.conf # and then
 
# Find '#ServerName www.example.com' and uncomment and correct ServerName
 
# Find '/#ServerAdmin root@example.com' and uncomment and correct ServerAdmin
 
# Fix up any SSL file locations if you put your server certificate somewhere other than the default
 
cd
 
# Copy server cert (csr, crt, and key) to Apache SSL folders
 
# Assumes you have server.{csr,crt,key} in /root...
 
for ext in csr crt key; do cp -p server.${ext} /etc/apache2/ssl.${ext}; done
 
# Install zypper
 
yast2 --install zypper
 
# Update the system
 
zypper -n update
 
# Install PostgreSQL (use client instead if database server is not on same box)
 
zypper -n install postgresql-server
 
# Add the Freeside repository as an installation source
 
zypper service-add http://server.domain.tld/freeside-repo/repo/sles/10/freeside-1.7/testing/i386
 
# Install Freeside itself (specify the Business::OnlinePayment module you use)
 
zypper -n install freeside-postgresql freeside freeside-mason perl-Business-OnlinePayment-AuthorizeNet
 
</pre>
 
 
 
and then finish the installation as normal, starting PostgreSQL and creating a Freeside user and database; then running freeside-setup, freeside-adduser, and restarting the web server.
 
 
 
====Initial Installation of the Self-Service Interface====
 
 
 
The first steps are almost the same as for the Freeside billing server, except that you don't have to enable mod_perl.  If you're installing the self-service server on the same machine as the billing server for testing, then you don't need to repeat these steps:
 
 
 
<pre>
 
# Add the folder or web server containing SuSE to your installation sources
 
yast2 inst_source
 
# Enable SSL for the HTTP server
 
yast2 http-server modules enable=ssl
 
# Configure apache for SSL
 
cd /etc/apache2/vhosts.d
 
cp -p vhost-ssl.template freeside-ssl.conf
 
vi freeside-ssl.conf # and then
 
# Find '#ServerName www.example.com' and uncomment and correct ServerName
 
# Find '/#ServerAdmin root@example.com' and uncomment and correct ServerAdmin
 
# Fix up any SSL file locations if you put your server certificate somewhere other than the default
 
cd
 
# Copy server cert (csr, crt, and key) to Apache SSL folders
 
# Assumes you have server.{csr,crt,key} in /root...
 
for ext in csr crt key; do cp -p server.${ext} /etc/apache2/ssl.${ext}; done
 
# Install zypper
 
yast2 --install zypper
 
# Update the system
 
zypper -n update
 
</pre>
 
 
 
To install the self-service interface you use a different repository on your mirror and install the appropriate set of RPMs:
 
 
 
<pre>
 
# Add the self-service repository to zypper's installation sources
 
zypper service-add http://server.domain.tld/freeside-repo/repo/sles/10/freeside-1.7/testing/self-service i386
 
# Install Freeside Self-Service
 
zypper -n install freeside-selfservice
 
</pre>
 
 
 
and then finish the self-service installation as normal:
 
 
 
*Set up [[Freeside:1.7:Documentation:Self-Service_Installation#SSH_setup|key-based SSH access]] and check the freeside user on the billing server can SSH into the self-service machine (even if it's localhost).
 
 
 
<pre>
 
/bin/su freeside
 
cd
 
ssh-keygen -t dsa
 
cd .ssh
 
cp -p id_dsa.pub authorized_keys2
 
ssh localhost
 
</pre>
 
 
 
*Add the self-service machine to /etc/sysconfig/freeside on the billing server.
 
 
 
<pre>
 
SELFSERVICE_MACHINES=localhost
 
</pre>
 
 
 
*Start the freeside service on the billing server and check the logs (<code>/var/log/freeside/selfservice.localhost.log</code>) to make sure it's working.  (You may need to install IPC::ShareLite, <code>zypper -n install perl-IPC-ShareLite</code>, and restart the freeside service.)
 
 
 
<pre>
 
service freeside start
 
</pre>
 
 
 
*Check you can log in via the self-service interface using the credentials for an account already in the billing server.
 
 
 
On SLES systems with a billing server installed using older Freeside RPMs, you may need to create a home directory for the freeside user and also create a freeside group if the RPM did not do this:
 
 
 
<pre>
 
mkdir /home/freeside
 
chown freeside.users /home/freeside
 
groupadd freeside
 
</pre>
 
 
 
====Updating Your Freeside Installation====
 
 
 
Just run zypper and tell it to update packages:
 
 
 
<pre>
 
zypper -t package update
 
</pre>
 

Latest revision as of 01:31, 10 May 2009

Mirroring the Freeside 1.7 Testing RPM Repository with YaST2

Introduction

This page explains how to mirror the i386 version of the Freeside 1.7 branch "testing" RPM repository for SuSE Linux Enterprise Server (SLES) 10, using wget. Instructions on how to use your mirror using YaST2 and zypper are on another page. There's more discussion on the main page on mirroring the RPM repository.

Proxy Servers

The following assumes you are not accessing the internet through a proxy server, or that you are using a transparent proxy server that requires no special configuration for client programs. If this is not the case, you may need to add command line switches to route internet accesses through your proxy server and to authenticate yourself to the server.


Instructions

Initial Setup

The Freeside RPM repository is just a web server containing the RPMs and some metadata files. To mirror this, you download the files into a folder (/srv/www/freeside-repo) and then make that folder available to your local client machines via a web server.

To set up the mirror initially:

  • Create a folder on the machine that will act as your repository server:
mkdir /srv/www/freeside-repo
  • Copy down the repository from the Freeside web server:
cd /srv/www/freeside-repo
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/i386/

(The trailing slash after the i386 prevents wget from downloading all repositories at the same level as the i386 folder.)

  • Copy down the corresponding self-service server files:
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/self-service/i386/
  • The Freeside web server auto-generated index.html files. Remove them from the mirror:
find /srv/www/freeside-repo -name 'index.html*' -print -exec /bin/rm {} \;
  • Make the folder available via the web server. Put an Apache configuration snippet in a file (freeside-repo.conf) in /etc/apache2/conf.d:
Alias /freeside-repo /srv/www/freeside-repo
<Directory /srv/www/freeside-repo>
Options +Indexes
Allow From All
Order Deny,Allow
</Directory>
  • Reload your web server:
service apache2 reload

Refreshing Your Mirror

To refresh the mirror, just repeat the steps to copy down the files:

cd /srv/www/freeside-repo
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/i386/
wget --mirror --no-parent --no-host-directories --cut-dirs=3 http://freeside.biz/~rsiddall/repo/sles/10/freeside-1.7/testing/self-service/i386/

And remove the index.html files generated by the web server from the mirror:

find /srv/www/freeside-repo -name 'index.html*' -print -exec /bin/rm {} \;

The above commands can be put in a shell script and executed periodically via cron.


Using Your Mirror

Full instructions for using your mirror are on a separate page.