| 1 | # Quick installation instruction |
| 2 | |
| 3 | The installation of InDefero is composed of 2 parts, first the |
| 4 | installation of the [Pluf framework](http://www.pluf.org) and second, |
| 5 | the installation of InDefero by itself. |
| 6 | |
| 7 | ## Recommended Layout of the Files |
| 8 | |
| 9 | If your server document root is in `/var/www` a good thing is to keep |
| 10 | the number of files under the `/var/www` folder to its minimum. So, |
| 11 | you should create a `/home/www` folder in which we are going to |
| 12 | install all but the files which need to be available under the |
| 13 | document root. |
| 14 | |
| 15 | /home/www/pluf/src/ |
| 16 | /home/www/pluf/src/Pluf.php |
| 17 | /home/www/pluf/src/migrate.php |
| 18 | /home/www/indefero/src |
| 19 | /home/www/indefero/www |
| 20 | /home/www/indefero/www/index.php |
| 21 | /home/www/indefero/www/media |
| 22 | |
| 23 | The you need to link the `media` and `index.php` files into your |
| 24 | docroot. |
| 25 | |
| 26 | $ cd /var/www |
| 27 | $ ln -s /home/www/indefero/www/index.php |
| 28 | $ ln -s /home/www/indefero/www/media |
| 29 | |
| 30 | ## Installation of Pluf |
| 31 | |
| 32 | * Checkout the trunk of [Pluf](http://www.pluf.org). |
| 33 | * Install the `Mail` and `Mail_mime` classes from [PEAR](http://pear.php.net). You must use the `--alldeps` flag when installing these modules: |
| 34 | |
| 35 | $ sudo pear install --alldeps Mail |
| 36 | $ sudo pear install --alldeps Mail_mime |
| 37 | |
| 38 | The Pluf installation folder is the folder containing the file `Pluf.php`. |
| 39 | |
| 40 | ## Installation of InDefero |
| 41 | |
| 42 | The installation is composed of the following steps: |
| 43 | |
| 44 | * Get the InDefero archive. |
| 45 | * Configure it correctly. |
| 46 | * Installation the database with the `migrate.php` script. |
| 47 | * Bootstrap the application with a `bootstrap.php` script. |
| 48 | |
| 49 | Here is the step-by-step installation procedure: |
| 50 | |
| 51 | * Extract the InDefero archive somewhere. |
| 52 | * The InDefero installation folder is the folder containing this file INSTALL.mdtext. |
| 53 | * Make a copy of `src/IDF/conf/idf.php-dist` as `src/IDF/conf/idf.php`. |
| 54 | * Update the idf.php file to match your system. |
| 55 | * Open a terminal/shell and go into the `src` folder in the InDefero installation folder. |
| 56 | |
| 57 | $ cd /home/www/indefero/src |
| 58 | |
| 59 | * Run `php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -i -d -u` to test the installation of the tables. |
| 60 | * Run `php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -i -d` to really install the tables. |
| 61 | * More details about the migration is available in the [migration documentation](http://pluf.org/doc/migrations.html) of the Pluf framework. |
| 62 | * Create a bootstrap file to create the admin user for example `www/bootstrap.php`. Do not forget to update the second line with your path to Pluf: |
| 63 | |
| 64 | <?php |
| 65 | set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/home/www/indefero/src'); |
| 66 | set_include_path(get_include_path().PATH_SEPARATOR.'/home/www/pluf/src'); |
| 67 | require 'Pluf.php'; |
| 68 | Pluf::start(dirname(__FILE__).'/home/www/indefero/src/IDF/conf/idf.php'); |
| 69 | Pluf_Dispatcher::loadControllers(Pluf::f('idf_views')); |
| 70 | |
| 71 | $user = new Pluf_User(); |
| 72 | $user->first_name = 'John'; |
| 73 | $user->last_name = 'Doe'; // Required! |
| 74 | $user->login = 'doe'; |
| 75 | $user->email = 'doe@example.com'; |
| 76 | $user->password = 'yourpassword'; // the password is salted/hashed |
| 77 | // in the database, so do not worry :) |
| 78 | $user->administrator = true; |
| 79 | $user->active = true; |
| 80 | $user->create(); |
| 81 | print "Bootstrap ok\n"; |
| 82 | ?> |
| 83 | |
| 84 | * Run `php www/bootstrap.php`. |
| 85 | * Remove the `www/bootstrap.php` file. |
| 86 | * Open the `www/index.php` file and ensure that the path to Pluf and |
| 87 | Indefero are correctly set for your configuration. |
| 88 | * Now you can login with this user into the interface. |
| 89 | * Click on the Administer link on top and create your first project. |
| 90 | |
| 91 | ## Upgrade InDefero |
| 92 | |
| 93 | To upgrade: |
| 94 | |
| 95 | * Make a backup of your data, including the database. |
| 96 | * Extract the new archive on top of the current one. |
| 97 | * Update your version of Pluf. |
| 98 | * Check that the path in the `index.php` are still good. |
| 99 | * Upgrade the database with: |
| 100 | |
| 101 | $ php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -d -u |
| 102 | $ php /home/www/pluf/src/migrate.php --conf=IDF/conf/idf.php -a -d |
| 103 | |
| 104 | ## Repository Synchronization |
| 105 | |
| 106 | The documentation is available in the `doc` folder. |
| 107 | |
| 108 | * Subversion: `doc/syncsvn.mdtext`. |
| 109 | * Mercurial: `doc/syncmercurial.mdtext`. |
| 110 | |
| 111 | ## For the Apache Webserver Users |
| 112 | |
| 113 | If you are using [Apache](http://httpd.apache.org/) for your webserver |
| 114 | and want to have nice URLs like `http://yourdomain.com/p/yourproject/` |
| 115 | and not `http://yourdomain.com/index.php/p/yourproject/` you can use |
| 116 | the following `.htaccess` file to be put in the same folder of the |
| 117 | `www/index.php` file. |
| 118 | |
| 119 | RewriteEngine On |
| 120 | RewriteCond %{REQUEST_FILENAME} !-f |
| 121 | RewriteCond %{REQUEST_FILENAME} !-d |
| 122 | RewriteRule ^(.*) /index.php/$1 |
| 123 | |
| 124 | |
| 125 | ## For the Gentoo users |
| 126 | |
| 127 | If you get the error: |
| 128 | |
| 129 | T_CHARACTER Use of undefined constant T_CHARACTER - assumed 'T_CHARACTER'" |
| 130 | |
| 131 | you need to compile PHP with the "tokenizer" flag. |
| 132 | |
| 133 | ## For People with open_basedir restriction error |
| 134 | |
| 135 | If you get an error like: |
| 136 | |
| 137 | file_get_contents(): open_basedir restriction in effect. |
| 138 | File(/etc/mime.types) is not within the |
| 139 | allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) |
| 140 | |
| 141 | Just copy the file `/etc/mime.types` into the folder `/home` and put |
| 142 | this in your configuration file: |
| 143 | |
| 144 | $cfg['idf_mimetypes_db'] = '/home/mime.types'; |
| 145 | |
| 146 | |