====== Step by Step Installation: Ubuntu ====== This manual was tested with Ubuntu Server 10.04.1 LTS **is currently updated for Ubuntu Server 12.04 and SQL-Ledger Version 3**. It shows how to set up a simple SQL-Ledger server that runs in a local network. For servers available in the Internet, additional security measures are required. ===== Operating system ===== ====Download ISO file==== First you have to download the ISO file of the operating system. Go to the [[Ubuntu homepage]] and download, according to your needs, Ubuntu 12.04 LTS in the 32 or in the 64 bit version. ====Preparation==== You can install Linux either on 'real' hardware or in a virtual machine running on your computer. **Existing hardware** To be able to install the operating system, you have to burn the downloaded ISO-file to a CD. Don't copy the file to the CD, choose the ISO burn function in your burning software. **Virtual Machine** To create a virtual server, you can use for example **Virtualbox** that you get [[https://www.virtualbox.org/wiki/Downloads|here]]. Start Virtualbox, click "New", give your machine the **name** "SQL-Ledger" and choose Linux and Ubuntu for** operating system**. You don't need much memory, 256 - 512 MB are enough. For the virtual hard disk, use the default settings, just press ''next'' and ''finish'' until your disk and server are created. Before you start, you have to change the network settings. Open the network adapter and change it to "Bridged Adapter". Now you can turn the machine on. The First Run Wizard appears and asks for the installation media. Show him the previously downloaded ISO file. ==== Installation ==== Turn on your computer with the Linux CD in the drive or the virtual machine with the ISO file connected. * change the language on the welcome screen * select Install * choose your language and location * change the keyboard layout if it's not US * set the host name to "my-server" or a name you choose * accept or change the time zone setting as required * choose "Guided - use entire disk" for partitioning * say Yes that you want to write changes to disk Wait some minutes until the basic installation is finished. * set your user name, account name and password * don't encrypt your home directory * you probably don't have to specify an Http proxy * select no automatic updates * don't choose software to install, we will make this manually * install Grub: Yes * on a real computer, eject the CD, on a virtual machine, disconnect the ISO file. * select Continue Now the system restarts. ===== Software packages ===== Login to the server with your user name and password. To be able to install the software, we have to change to the "root" account. In this way, we get administrator rights. Type: sudo -i and enter your password. With the following command, we install the packages we need for SQL-Ledger: apt-get install ssh acpid apache2 postgresql libdbi-perl libdbd-pg-perl git-core gitweb postfix mailutils texlive The installation needs some time. While installing postfix (the mail server), the system asks you about the mail configuration. * select "satellite system" * for SMTP relay host, enter the name of your mail server (smtp...) If you use another language than English, you may want to install an additional package that supports hyphenation in your language, for example apt-get install texlive-lang-german You get a list of all available language packs with: apt-cache search texlive-lang Or, if you know from beginning that you will use several different languages or special LaTeX functions, install the complete package: apt-get install texlive-full ===== SQL-Ledger ===== We will install SQL-Ledger in the folder /usr/local/sql-ledger. For this, we change to /usr/local: cd /usr/local You have two versions to choose between, either **the original SQL-Ledger**, developed by [[DWS systems]], or the **Enhanced SQL-Ledger**, provided by [[Ledger123]]. To install the **original SQL-Ledger**, type: git clone git://github.com/Tekki/sql-ledger.git Because of a security leak , the template editor is disabled in the above repository. It is recommended not to use the master, but the full branch: cd /usr/local/sql-ledger git checkout -b full origin/full The **full** branch contains some additional features like WLprinter (see below) or an extended admin interface. For the **Ledger123 type**: git clone git://github.com/ledger123/ledger123.git sql-ledger Next, you have to create a spool directory, change the access rights to some files and folders and copy sql-ledger.conf.default to sql-ledger.conf. cd /usr/local/sql-ledger mkdir spool chown -hR www-data.www-data users templates css spool cp sql-ledger.conf.default sql-ledger.conf If the remote repositories changed, you update your installation with cd /usr/local/sql-ledger git pull In the full branch of the original SQL-Ledger, you have the possibility to update the software using the Software Administration function in the Admin interface. Before it works, you have to give the web server the right to call the git commands. For this, type visudo Then add the following line to the user privilege section: www-data ALL=(ALL) NOPASSWD: /usr/bin/git ===== Mail transport ===== ===== Printing ===== ===== CUPS ===== CUPS is the printing system for Linux. You have to install it if the SQL-Ledger server should be able to print to printers in your network. apt-get install cups hplip hpijs cupsys-driver-gutenprint cupsctl --remote-admin Now you can call from your browser the CUPS web interface at https://ip_of_your_server:631 and add your printer. Remember the name you give to your printer. Then open sql-ledger.conf nano /usr/local/sql-ledger.conf and move to "# available printers". There you see an example of two printers. Replace them with your own printer or printers. The name on the left side is the name you will see in SQL-Ledger, the one on the right side immediately after -P is the name by which the printer is known to the operating system. **WLprinter** WLprinter is a program that allows to print from SQL-Ledger directly and without further installation or configuration to printers connected to client computers. On the client side, it requires Java and on Windows machines Adobe Reader. After the installation, SQL-Ledger automatically provides an additional printer "WLprinter". **Original Version** WLprinter is part of the full branch. If you followed the above instructions, this program already installed on your server. It is recommended that you copy the config file wlprinter.conf.default to wlprinter.conf, so you can edit it: cp wlprinter.conf.default wlprinter.conf ** Ledger123** WLprinter isn't available for Ledger123. If you didn't add printers with CUPS and edit sql-ledger.conf before, open it now with nano /usr/local/sql-ledger.conf and change the printer definition to %printer = ( ); ===== Database set up ===== Edit the Postgresql database configuration. nano /etc/postgresql/9.1/main/pg_hba.conf Change the line local all all peer to local all all trust Restart the database service postgresql-9.1 restart Create a user for SQL-Ledger su postgres -c "createuser -d -S -R sql-ledger" =====Web server set up===== Your web server has to know where to find SQL-Ledger. We add a new configuration file and restart the server. cd /etc/apache2/sites-available/ wget https://raw.github.com/Tekki/sql-ledger/full/doc/sql-ledger.httpd.conf cd ../sites-enabled/ ln -s ../sites-available/sql-ledger.httpd.conf 001-sql-ledger service apache2 restart It should now be possible to access SQL-Ledger. As you didn't specify an address for your server, it was received from DHCP. Enter the following command: ifconfig eth0 You see the address after "inet addr:". In a private network, it will be something starting with "192.168...". Open your web browser, enter this address followed by "/sql-ledger". The SQL-Ledger login screen has to appear. =====Optional components and settings===== There are some additional components that make working with the SQL-Ledger server more comfortable. ====Samba==== Samba is a file server for Windows PCs. If you install it, you are able to connect to the server with its name instead of the IP address from your Windows computer. apt-get install samba If you followed our example and work on Windows, you can click on the following link to connect to your server: http://my-server/sql-ledger If you chose another name, use http://another_name/sql-ledger SQL-Ledger can use different printers to print its documents. If you want print to shared printers connected to Windows workstations, install: apt-get install samba-client Linux probably has no driver for your Windows printer. In this case use **WLprinter**. ====Webmin==== Webmin is a web based administration interface for Linux. It is very convenient for a lot of administration tasks. cd /tmp wget http://www.webmin.com/download/deb/webmin-current.deb apt-get install libapt-pkg-perl apt-show-versions libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl dpkg --install webmin-current.deb If you have installed the Samba server, Webmin is now available at https://my-server:10000 The Webmin server needs some instants (10 seconds or more) to start up. Just wait until the login screen appears and log in with your Linux user name and password. ====Statical IP address==== In the default configuration, your server gets its IP address dynamically via DHCP. This address may change from time to time. You probably want to give it a fixed address, so you can access it always in the same way. If you open the config file with nano /etc/network/interfaces it looks like this: # The primary network interface auto eth0 iface eth0 inet dhcp If you want to give your server the fixed address 192.168.1.10 and your internet router has the address 192.168.1.1, you have to change the file the following way: iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0 gateway 192.168.1.1 With this change, the server looses the possibility to configure the name servers automatically. Many routers work as name servers, so in most cases it's enough to type: echo "nameserver 192.168.1.1" > /etc/resolv.conf After that, restart the network services with service networking restart If you installed Webmin, you can make these changes in the Networking--Network Configuration tab.