// -----------------------------------------------------------------------
// This file is part of AROUNDMe
// 
// Copyright (C) 2003-2007 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING.txt.  If not, see
// <http://www.gnu.org/licenses/>
// -----------------------------------------------------------------------


>> AROUNDMe collaboration server installation guide
   AROUNDMe can be used to create one or many Internet based interest
   groups which we term 'webspaces'.


>> WHO SHOULD INSTALL
   An understanding of domain name setup, FTP, changing directory
   privileges and web servers is required.


>> EASY INSTALL
   Please read the terms of the license prior to install.

   1. Set up your domain / subdomain (see SUBDOMAIN.txt) and copy the files to the directory in your web server.

   2. Type your domain / subdomain into a browser and add "/maintain.php". The installer will start. Follow the instructions there.

   3. You are done:)
   

>> MANUAL INSTALL
   Please read the terms of the license prior to install.
   
   AROUNDMe collaboration server (AMc) requires PHP5.x with curl and GD
   library. To check that you have these installed create a file in your
   root web directory called 'phpinfo.php'. Edit it and write.

   <?php
   phpinfo();
   ?>

   Using your browser got to the url
   (example: http://www-domain.com/phpinfo.php) and you will see detailed
   information about your PHP installation. At the top of the page you
   will see your PHP installation version which should be greater that 5.0.
   You should see a section called 'Curl' with 'curl support' set to
   'enabled'. You should also see a section called 'gd' with 'GD support'
   set to 'enabled' and a 'GD version' at, or greater than 2.0.

>> Overview of webspace creation
   AMc can be configured so that only you; the maintainer can create a
   webspace or so that anyone can create a webspace. If AMc is set for
   anyone to create a webspace then you can have this happen automatically
   or as an application process from which you approve webspace application
   requests.

   Each webspace has a name, for instance gardening and plumbing webspaces.
   These webspaces are accessed via a URL; for example
   http://gardening.example.com and http://plumbing.example.com . The next
   step prior to installation is to get your domain names right.

>> Choose the option closest to your installation requirement:

      1. I want to use subdomains like http://gardening.example.com and
         http://plumbing.example.com Please visit Appendix A(1) for
         configuration information.
      2. I want to use directories like http://example.com/gardening and
         http://example.com/plumbing Please visit Appendix A(2) for
         configuration information.
      3. I just want one webspace as my website like http://www.example.com
         Please visit Appendix A(3) for configuration information.
      4. I want to install this on my local computer for testing. Please
         visit Appendix A(4) for configuration information.

>> Installation
   Once your domains are working you can visit http://your_domain.org/maintain.php
   to begin installation. Follow the steps on the installer.


>> Appendix A (1) - Using subdomains
   For multiple webspaces under one domain name you will probably want to create
   subdomains for each webspace like http://gardening.example.com

   You will only be able to use subdomains if you have full control over your
   webserver. If not, then see 'single subdomain'.

   To do this you must have wildcard domain names pointing to your server. You can
   test this by typing the following domains into your browser:

      http://www.your_domain.org
      http://foo.your_domain.org
      http://your_domain.org

   All of these should go to your webserver. If they do, then you are ready to
   continue to install AMc. If not contact your domain name maintainer and request
   that all sub domains be pointed to your webserver.

>> Single subdomain
   Most shared hosting solutions provide you with an interface to create a subdomain 
   such as http://example.your_domain.org . If you have that then make a subdomain
   there and point it to your installation directory. When creating your webspace
   you must use the same name (in this case 'example') as your webspace name.


>> Appendix A (1) - Using directories
   The following assumes you have access to edit your Apache vhosts file which is 
   typically held in /etc/apache2/sites-enabled/ (backup then edit 000-default).
   Then add the texts below. Once complete restart Apache.

   #start of copy into 000-default ................
   <VirtualHost *:80>
     ServerName domain.org
     DocumentRoot /var/www/path/to/aroundme_c
       <Directory /var/www/path/to/aroundme_c>
                   Options FollowSymLinks MultiViews
                   AllowOverride all
                   Order allow,deny
                   allow from all
       </Directory>
   </VirtualHost>
   #end of copy into 000-default ................


   Create a file in the aroundme_c/directory called '.htaccess'. Copy the texts
   below into it and save.

   #start of copy into .htaccess ................
   RewriteRule ^([^/\.]+)/?$ /index.php?$1 [L]
   #end of copy into .htaccess ................


>> Appendix A (3) – one URL
   The following uses the example webspace name of 'gardening'. Create a file in the
   aroundme_c/directory called '.htaccess'. Copy the texts below into it and save.

   #start of copy into .htaccess ................
   RewriteEngine On
   RewriteCond %{HTTP_HOST} !^gardening\.barnraiser\.org [NC]
   RewriteRule ^(.*)$ http://gardening.barnraiser.org/$1 [R=301,L]
   #end of copy into .htaccess ................


>> Appendix A (3) – localhost
   If you are installing on a localhost then there is a good chance that you are a
   different user that your web server. You therefore need to alter the owner of
   the AMc files and modify their permissions. 

   Establish the owner name of your web server (in this example we use Apache).
   Type 'ps aux' into your command line and look for processes with the name 'apache'.
   You will see the owner; in this case 'www-data':

   Change the owner recursively ( -R) to 'www-data' on the AMc directory.

   chown -R www-data aroundme_c/

   You may need to be connected as root to do this. If the operating system reports
   that you do not have permissions then repeat the equivalent command as
   root (example for Ubuntu):

   sudo chown -R www-data aroundme_c/

   Next modify the permissions:

   chmod -R 770 aroundme_c/

   The following uses the example webspace name of 'gardening'. The following assumes
   you have access to edit your Apache vhosts file which is typically held in
   /etc/apache2/sites-enabled/ (backup then edit 000-default). Then add the texts
   below. Once complete restart Apache.

   <VirtualHost *:80>
      ServerName gardening.localhost
      DocumentRoot /home/www/aroundme_c/aroundme_c
      DirectoryIndex index.php index.html index.html index.htm index.shtml
   </VirtualHost>

// END OF DOCUMENT -------------------------------------------------------------------