From LifeType Wiki
If you've downloaded LifeType from the LifeType project page, the files should have arrived on your computer in an archived format. In Windows, WinZip is capable of reading both .tar.gz and .tar.bz2, and the same with StuffIt in Mac OS X. In Linux or in any other Unix-like operating system, the 'tar' command line tool will extract the files for you:
tar zxvpf LifeType_DOWNLOADED_TARBALL
Or in the case of LifeType 1.2
tar zxvpf lifetype-1.2.tar.gz
NOTE: Please do not forget the 'p' modifier when using tar as some of the folders inside the package have special permissions that should be kept when unpacking (by default, tar does not keep the same permissions as in the package). See below in Setting up for Installation.
This will create a folder called "lifetype-1.2" This folder contains several PHP scripts and some more folders, each one of them containing things like the code needed by the application, translations, templates, and so on. In any case, this folder name is arbitrary, so rename it to whatever name you'd like.
Setting up for Installation
- Checking permissions and creating additional folders
Make sure that the contents of the folder we just created can be read by the user running the web server. Please consult the documentation of your operating system to check for the name of that user ("www", "apache", "nobody", etc).
LifeType also needs two additional folders with special permissions. Those folders are tmp/ and gallery/. They should have the right permissions if you did not forget the 'p' modifier when using the tar tool but even if we did not forget it, it's a good idea to check the permissions again. Both of these folders should have write access for the user running the web server. It is very important that these files have the permissions set right, or else we'll run into all sort of permission-related troubles.
chmod 777 tmp chmod 777 gallery
Before starting the installation process, make sure that the file config/config.properties.php is also writable by the web server. This is necessary so that wizard.php can save the configuration settings in it. Once installation is complete, permissions can be reverted to some more secure settings.
- Setting up the database.
In order to set up the database tables needed by LifeType, you need a MySQL server and a valid user with enough privileges to run CREATE and INSERT statements. Once the tables have been created, the user needed for running LifeType only needs privileges to execute SELECT, DELETE, INSERT and UPDATE statements.
- If you already know your MySQL username, password, and the name of a database that can be used for LifeType's data tables, you can proceed directly to the installation process. If you use the installation wizard, it will create all the data tables needed for LifeType. For users on shared servers (for example, web hosting services) who are limited to only one MySQL database or user, LifeType will prefix the name of each of its tables to prevent naming conflicts with other (non-LifeType) data tables.
- If you are the administrator of your own MySQL server, you have more flexibility. For security or convenience, you may wish to dedicate a database to LifeType, in which case you will want to create a new database on the MySQL server (for example, named "LifeType"). You can also create a user who has privileges only to access the LifeType database.
- If you want to create a database just for LifeType, create one using the root or other privileged account you set up when MySQL was installed:
mysqladmin -uuser -ppassword create LifeTypedb
The LifeType installation wizard can create a LifeType database for you, but you will want to do it yourself if you intend to create a MySQL user who only has access to the LifeType database.
If you wish to create a user for the LifeType database which has the rights needed to use LifeType and create and alter tables:
mysql -uuser -ppassword LifeTypedb GRANT select, insert, update, delete, create, alter ON LifeTypedb.* TO LifeTypeger@localhost IDENTIFIED BY 'password';
Detailed help for creating a MySQL database or adding a valid user to a MySQL database is out of the scope of this document. Please refer to the MySQL documentation for more information on this topic (see Adding New User Accounts to MySQL for specifics or Getting Started with MySQL for a general introduction).
Installing LifeType with user data providers
Since version 1.1, LifeType is able to use an external system as the source of its user data, a feature known in the LifeType jargon as "user data providers". This means that we can integrate LifeType into a site that is running a Joomla site or PHPBB2 forum, while transparently allowing LifeType to use the user base already available rather than asking users to register again in the blogging portion of the site.
When installing LifeType, if you are planning to use an external user base (via user data providers), you must also configure the file config/userdata.properties.php to use the correct provider. Additional information is available in the page describing how to configure and these providers. So instead of first installing LifeType and then switching, it is recommended that you first enable the provider configuration and then install LifeType. All LifeType will do is create a new user in your source of user data, rather than creating it in its own database.
It is also possible to switch after the installation but you will run into problems, most likely because of non-matching user identifiers (if the user that was created in the LT database had '1' as its identifier, all data like blogs and articles was linked to it, but user '1' may or may not exist in your new source of user data)
This page will guide you through the process of installing LifeType using the wizard.php script, an automated installer that will walk you through every step of the installation process. Up to LifeType 0.3.2 it was possible to perform the installation manually but this is no longer possible so now wizard.php remains as the only posible way to get LifeType installed.
In order to start the wizard, point your browser to the installation script at http://your.LifeType.host/LifeType_folder/wizard.php. Before starting, it would be good if you checked the following things:
- Make sure that the tmp/ folder in your LifeType folder exists and is world-writable, or at least writable by the user running the web server. The wizard needs to generate some temporary files that will be stored there.
- Make sure that the config/config.properties.php file is world-writable, or at least writable by the user running the web server. Once the installation process has finished, please restore its original permissions (not writable by anybody, for security reasons)
The script will warn you if these steps have not been taken.
NOTE: If the web server shows an error message that "server encountered an internal error or misconfiguration" it could be that Apache is not configured to accept an .htaccess file in the LifeType directory. You may safely remove the .htaccess file if necessary.
The installation wizard consists of seven different steps:
This step will perform some basic checks to your environment to verify that it complies with the software requirements. Some requirements are strict (the installer will not proceed until they have been fulfilled) while other requirements are only recomendations and the installer will allow you to proceed with the installation process although it will display a warning message.
If everything is correct, there will be a button labeled "Next" at the bottom right corner.
Now we should provide the installer with our database settings: database server, database user, database password, name of the database that will be used to store the tables and a table prefix.
Please refer to the documentation in the previous section on how to create users and grant them privileges to access a database and its table. The user should have at least enough privileges to carry out SELECT, UPDATE, DELETE and INSERT statements. Alternatively, the user may be created by the installation wizard. The only catch is that, in order to do so, the script must have permission to execute both CREATE DATABASE and CREATE TABLE statements.
The table prefix is used in case we want to run more than one version of LifeType (stable and development, for example) at the same time in the same database. The stable installation could use the default "lt_" prefix while the development installation could use "lt_dev_" as its prefix. These prefixes affect the way tables are called.
Fill in the required fields and click "Next". If you do not know these values, please ask your hosting provider for more information.
In this step we will have to confirm the data that was just entered as confirmation. Additionally, the installation script will also perform a first test connection to the database and inform you if the settings were correct so at this point, these settings have already been saved to the file config/config.properties.php.
If there was an error connecting to the database, please use the "Back" button to return to the previous page and correct the issue.
It is also possible to use the default character set for the database. The default value is latin1 and should be enough for users of the iso-8859-1 character encoding. If your installation requires a different encoding such as UTF-8, please select the right value here. If you do not know what you are doing, please leave the default value.
We are given the to create the database for us if it does not exist yet. We should check where it says "Please check this if you want the installer to create the database." If checked, it will first create the database with the name we chose and then it will create the tables. If unchecked, only the tables will be created, so please make sure that the database exists and that it can be accessed by the user we specified in the previous step.
LifeType will now attempt to create the new tables and load them with default values. There shouldn't be any problem here unless we are still using the wrong database settings or the user doesn't have enough permissions to create tables.
- If there is any error creating or initializing the tables, LifeType will show an error message and the installation process will be halted.
If everything went well, we should only see a very brief screen informing us that the previous operation was successful and that we can proceed to the next step.
Now is time to create the first user.
As the first user, this user will be given administrator privileges and will be set as the owner of the blog we will create later on. Administrator users have access to the "Site Admin" section of the administration backend.
The only things required here are a valid username, a password, and a valid email address for this first user. Optionally we can provide this user's full name.
After filling in the form, click "Next." If data was correct, the user will be created and we will proceed to the next step. If some of the information was not valid or missing, the same screen will be shown again and we will be given the chance to try once again.
Once the user has been created, we will create a blog. This blog will be owned by the user that was just created so please select a meaningul name for your blog, a locale (translation) and a template set.
Click the Next button at the bottom right corner when ready.
Once the user and the blog have been created, the installation process is now complete. During the last step of the installation process LifeType will also auto-detect whether GD2 or ImageMagick are available as image handling backends and select the most suitable one (with GD2 being preferred over ImageMagick as it is a native PHP extension)
Finalizing the Installation
Now everything is ready so please remember to revert the permissions of the config/config.properties.php to safer values (r--r--r-- would be fine).
The installation script has buttons pointing to the different areas of your new blog: index.php as the blog entry point, admin.php as the admin interface and summary.php as the central point of your community (if needed)
Remember to remove wizard.php file since it is not needed anymore. Also, if you are not planning to use your newly installed LifeType to give a blogging service, please remove both the summary.php and register.php scripts.
LifeType runs by default using plain URLs. If you wish to use the so-called search-engine-friendly URLs (only available when using Apache), have a look at the .htaccess file and fix, if needed, the paths of the lines starting with ErrorDocument:
ErrorDocument 401 /LifeType/error.php ErrorDocument 403 /LifeType/error.php ErrorDocument 404 /LifeType/error.php
Many people install LifeType in a folder called /LifeType/, but if you installed it in the root of your web server, those lines should look like:
ErrorDocument 401 /error.php ErrorDocument 403 /error.php ErrorDocument 404 /error.php
The rule is that Apache needs to know the full path to the error.php script, so if you installed LifeType under /myuser/diary/, then the .htaccess file should have the following contents:
ErrorDocument 401 /myuser/diary/error.php ErrorDocument 403 /myuser/diary/error.php ErrorDocument 404 /myuser/diary/error.php
Otherwise, you might get odd "Internal Server Error" messages from your Apache server...
Now you can safely turn on the cruft-free URLs from the "Global Settings" section in the "Site Admin" tab.
Congratulations, your Installation is complete!