// -----------------------------------------------------------------------
// 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/>
// -----------------------------------------------------------------------

>> CHOOSING YOUR INSTALLATION TYPE
   AROUNDMe is set for a single webspace installation meaning that you will 
   only have a single website. AROUNDMe can be configured for a multiple 
   webspace installation meaning that many websites can be created under a 
   single instance of AROUNDMe.

   If you are performing a single webspace installation please open  
   docs/INSTALL-M.TXT else read on.


>> PRE-INSTALL
   Please check you have a PHP4.x or PHP5.x version installed with GDLib 2.x,
   curl and and FreeType. MySQL should be version 4.1 or greater.


>> WHO SHOULD INSTALL
   This is a web site and should be installed by a web site systems 
   administrator (webmaster). An understanding of DNS, Apache (or equivalent) 
   (and if running an OpenID service on the same web server Bind (or 
   equivalent) is required. We cannot support you if you are not able to 
   understand these things.


>> CONFIGURING DNS
   For multiple webspaces under one domain name you will probably want to create sub
   domains for each webspace like http://webspace_name.domain.org/

   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 not contact your domain name maintainer
   and obtain it.


   An example on Apache/Linux:

   1.  Edit your /etc/hosts file. You need one sub domain reserved against a unique
       IP address so add:

       127.0.0.1     reserved.domain.org

   2.  Ensure that the "reserved" word is included in your config variable:
       $core_config['webspace']['excluded_webspace_names']

   
   3.  Edit /etc/apache2/sites-enabled/000-default and include:

       <VirtualHost *:80>
         ServerName domain.org
         ServerAlias *.domain.org
         DocumentRoot /var/www/<path_to_aroundme>/aroundme

           <Directory /var/www/<path_to_aroundme>/aroundme>
                Options FollowSymLinks MultiViews
                AllowOverride all
                Order allow,deny
                allow from all
           </Directory>
       </VirtualHost>

   4.  Include a .htaccess file in the <path_to_aroundme>/aroundme directory

       RewriteEngine On
       RewriteCond %{REQUEST_URI} !index.php
       RewriteCond %{REQUEST_URI} !components/
       RewriteCond %{REQUEST_URI} !feed/
       RewriteCond %{REQUEST_URI} !overview.php
       RewriteCond %{REQUEST_URI} !about.php
       RewriteCond %{REQUEST_URI} !create_webspace.php
       RewriteCOnd %{REQUEST_URI} !maintain.php
       RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.org [NC]
       RewriteRule ^(.*) http://reserved.domain.org/index.php?webspace_unix_name=%1 [P,L]

   HINT: If you do not want to follow the example.barnraiser.org format then you can
   edit aroundme/components/core/inc/function.inc.php - formatSubDomainUrl function
   to redirect to the format you require.



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

   1. Copy the files to a directory in your web server. CHMOD to 770 the
      assets, and aroundme/feed directories.

   2. Use the included install/install.sql file to populate MySQL (you will need
      to manually create a new database first).

      You can edit the aroundme.sql file to change the prefix of the database 
      name. By default this is "am_<database_table_name>", but if you wish 
      to have multiple instances of AROUNDMe under one account you can edit this 
      to anything such as "am_dev_<database_table_name>" - remember to update 
      the components/core/config/core.config.php file $core_config['db']['prefix']
      variable to reflect your changes.

   3. Edit the aroundme/components/core/config/core.config.php and change the
      following variables:

     3.1 $core_config['release']['install_date'] - Enter the current date.
     3.2 $core_config['db']['host'] - Enter the MySQL host name (normally 'localhost')
     3.3 $core_config['db']['user'] - Enter the MySQL user name.
     3.4 $core_config['db']['pass'] - Enter the MySQL password.
     3.5 core_config['db']['db'] - Enter the name of the database.
     3.6 $core_config['node']['php_session_name'] - Enter a random string (A-Z) of
         approximately 8 characters.
     3.7 $core_config['resource']['maintainer_openid'][] - Enter a row containing the OpenID
         for each person that you want to be able to maintain your installation of AROUNDMe.
     3.8 $core_config['am']['webspace_creation_type']:

           a. If you want only the maintainers to be able to create webspaces then enter 0.
           b. If maintainers are required to approve new webspaces enter 1.
           c. Else enter 2 for automatic approval.

     3.9 $core_config['am']['mode'] - Change 1 to 0 (zero).

   4. For each plugin run the sql in aroundme/components/<plugin_name>/install.

   5. Go to http://<path_to_your_webspace/maintain.php, enter your OpenID, then create
      your webspace. Note the "locked" option. Uncheck the checkbox if you do not want a
      private webspace. After you create it you will see a details screen. Check that the
      status is set to "live", then click the name of the webspace (at the top of the
      form) to go to your webspace. You're done.


>> COMMON ERRORS
   1. No GDLIB Installed (Windows only)

	You will need GDLib support active for uploading images. Php4.3.x and up 
	has this built in, but not activated:

	Now you should have a file named php.ini.dist (for this document we will 
	assume it to be in in this path "c:\php\"). Rename that to php.ini and copy 
	it to the root of you Windows directory, C:/WINDOWS/ (be sure to back up 
	the one that is there).
	
	change:
		extension_dir = ":/"
	to:
		extension_dir= " C:\php\extensions"

	uncomment to extension:
	
	change:
		;extension=php_gd2.dll
	to:
		extension=php_gd2.dll
		
	You must restart to see the changes take effect.
	
   2. Session Errors (Windows only)
	You will need to set up a session save path in php.ini. Edit php.ini:
	
	change
		session.save_path = "/tmp"
	to:
		session.save_path = "C:\tmp\"
	
	(C:\tmp\ used as example - you can change the directory path to suit you)

