# Setting up LAMP and more.groupware

## Short installation instructions

These are the short installation instructions (for the impatient). See further below for detailed instructions.

1. Extract the more.groupware archive (.tar or .zip) to the desired location.

2. Give the webserver write permission to the moregw folder.

3. Create a database on your database server and remember the name... :) Create a database user to use with more.groupware (for added security DO NOT use the root user!). Give the database user you want to use the rights to CREATE and DROP tables on the database you just created. To upgrade an existing more.groupware-database please see the appendix for upgrade instructions.

4. Point your browser to `/setup/index.php` in your more.groupware folder. For example `http://yourdomain.com/moregroupware/setup/index.php` Follow these instructions during the installation.

## Detailed installation instructions

Examples are using MySQL, Apache and general UNI* syntax! They may (or may not) work for your environment...

1. Obviously you need a running webserver with support for PHP. If you don't have one yet, explaing how to install a webserver is beyond the scope of this document. You may find some hints in the documents explaining how to set up more.groupware on Win32 (see file "Windows" in docs directory) and RedHat (see file "RedHat" in docs directory) and at various places around the Internet (e.g. httpd.apache.org ).

2. And you need a database server. See previous item for tips on how to install this.

3. If you want, you can set up a virtual host for use with more.groupware exclusively. See your webservers documentation on how to do this. You should also consider using SSL to add security to your setup!

4. Extract the more.groupware distribution archive to the desired location (i.e. to the document root of your (new) (virtual) host. You may safely rename the more.groupware folder to make typing in the URL faster, or to add some more "security through obscurity"

                 #> cd /path/to/your/docroot/
                 #> tar xzf moregroupware-x.y.z.tar.gz

5. Make sure your webserver has the right to write to the more.groupware directory. This is needed to create the configuration file during setup, as well as the directories for template caching and the modules. The easiest way is to make the more.groupware directory world writable. Unfortunately this is the most insecure method as well, so you should consult your webserver's documentation on how to this in a more secure manner.

                 #> chmod o+w moregroupware/

6. Create a database for use with more.groupware. If you cannot do this (e.g. because you are in a shared hosting environment and have no rights to do so), you may use an existing database - all tables created by more.groupware have a prefix of "mgw_". But creating an own database is by far the preferred method!

                 #> mysqladmin -u root -p create moregroupware

7. Create a database user for use with more.groupware. This user must have the rights to SELECT, INSERT, UPDATE and DELETE in the more.groupware database. Furthermore the USER must be able to CREATE tables. During setup the user additionally needs DROP rights, which may be removed again after successful setup.

                 #> mysql -u root -p mysql
                 !> INSERT INTO user (host,user,password,select_priv,insert_priv,update_priv,
                 delete_priv,create_priv,drop_priv) VALUES ('localhost','moregw',
                 PASSWORD('securePW'),'Y','Y','Y','Y','Y','Y');

8. Now point your favourite browser to the setup directory (e.g. `http://yourdomain.com/moregroupware/setup/index.php`). Follow these instructions during installation. If errors occur, the setup will (in most cases) tell you exactly what went wrong. You may fix the issue and repeat the last step, until you got everything right.

## Very detailed installation instructions

The following is a step-by-step guide originally written by Bjørn Roger Rasmussen (just like the Windows setup guide). It gives some instructions on setting up Apache and MySQL as well, so you might want to read it if you need even more guidance than in the earlier parts.

### more.groupware together with Red Hat Linux 7.x and 8.x

An alternative to follow this instruction is to install LinuxEasyInstaller in stead. LinuxEasyInstaller is software package with scripts which does the job with installing MySql, Apache, PHP and phpMyAdmin very easy. You can find more information at http://www.phpmylinux.net/?rub=lei

Below you will find the manually way to install MGW without any help from LinuxEasyInstaller:

This step-by-step - guide is suited for you who intend to install more.groupware to run at your Red Hat Linux 7.x or 8.x computer. If you use another Linux distribution you will find that not everything written below will work at the same way as described.

### Making your computer ready for running more.groupware

I started with a clean installation of Red Hat Linux. I did a custom installation and I selected to install everything. With this kind of installation you get both Apache, PHP and MySQL installed on your PC.

After completing the installation of Linux I logged in as root and started from the shell Setup followed by System services. The following services must be running / selected:

- httpd (Apache web - server)

- mysqld (MySql database)

- Optional: sshd (secure "FTP" and "Telnet")

Select the services mentioned above and reboot your computer. (If you know what you are doing it is also possible to manually start the services without rebooting, e. g. `/etc/init.d/mysqld start` and `/etc/init.d/httpd start`).

In stead of using setup you can give the commands:

        chkconfig httpd on
        chkconfig mysqld on

After doing the changes in setup or with chkconfig the necessary services will start automatically every time you reboot your computer.

Start your web browser with the address http://ipaddress_of_your_computer/ and check that you get the Apache test page. To check that PHP works you should make a little text file with the following contents (you could use the text editor Pico at you Linux computer):

    <?php phpinfo(); ?>

Save the file in `/var/www/html` e. g. with the name `test.php`. Start your browser with the webpage http://ipaddress_of_your_computer/test.php You should get a lot of information about PHP.

### Configuring MySQL

Run the following MySQL commands from shell:

          mysqladmin -u root password choose_a_password
          mysqladmin -u root -p create MGW # (enter password defined above when prompted)
          mysql -u root -p # (enter password defined above when prompted)

Give the following command after you have got the mysql - prompt: `grant all on MGW.* to MGW@localhost identified by 'you_choose_a_password';` Write \q to quit!

Explanation:

After the installation of Red Hat Linux MySQL has as default a user called root with no password (password blank) defined. In the first mysql - line above we changed from blank root password to a self - chosen password.

In line two we made a new database with the name MGW which we shall use together with more.groupware later. To get the permission to make the database we used the MySQL user root with the password we defined in MySql line 1 above.

In line three we choose to log into the MySql - shell as the MySql root user. In line four (the grant all - command) we choose to give all the rights to access the MGW - database to a user with the same name as the database (MGW) with a self - chosen password.

To log out of MySQL (the MySql - prompt) you write \q

### Unpacking the more.groupware files

Unzip the files (if necessary) and copy them to `/var/www/html/moregroupware/` at your Linux computer.

I downloaded (and unzipped) the more.groupware - files to my Windows computer. To transfer the files to the Linux PC I used WinSCP (SSH FTP). You can download WinSCP from http://winscp.vse.cz/eng/

Check the file / folder permissions after the transfer. The owner of the more.groupware folder shall be root (user = root, group = root) with permissions 757.

### Configuring more.groupware

Start your web - browser and open the web - page `http://yourPCname/moregroupware/setup/index.php`. The setup is described here in full detail.

### Security

After you have got more.groupware to run you should do some work with securing your setup. Under the installation you got the following message:

"The more.groupware Team recommends to adjust the rights of the moregroupware folder in a way that not everybody can modify or run the scripts. Grant full rights only to the webserver user."

In Red Hat Linux the HTML - folder (`/var/www/html/`) is by default owned by root and the web - server is running as root. This is not the safest solution on earth. I recommend you to search the net and find more information about how you can secure your Linux - computer.