This document provides information regarding the installation and initial setup of Demyo. Further documentation on software usage is or will be found in the contectual help of Demyo itself.

Requirements

Demyo requires a Web server and SQL database, and has been tested with PHP5 and MySQL 4+. If you already have one, proceed to installing. If you don't have one or don't know (in which you most likely don't have one), read the following.

On Windows

Extract the Demyo archive (.zip or .tar.gz) in a temporary directory of your choice (your desktop or documents folder is fine).

XAMPP

Download XAMPP-Lite (you can download the full package but the Lite is enough and smaller) from the XAMPP website.

Install the package. If you plan to use it on an USB key, you have to install at the root, so that the folder where XAMPP files are is exactly X:\xampplite (where X is the letter of your USB key). If you don't want to have entries in your Start menu, I recommend the use of the ZIP version. If you don't install on your USB drive and still choose to use the ZIP version, please refer to the XAMPP documentation.

Note: If you chose the full package, the extracted folder might be named xampp. Don't rename it, and follow the guide just like you would have done, but replacing X:\xampplite by X:\xampp

Setting up the files

Copy the contents of Demyo's xampp-windows folder into the main XAMPP folder (e.g. X:\xampplite). If asked to overwrite files, answer "Yes" to all.

Now, start XAMPP by running X:\xampplite\xampp_start.exe. A DOS window appears, minimize it.

Note: The DOS window advertises when XAMPP is starting, but not when it has started. Waiting 5 seconds should be enough.

Security

If you copied files correctly three steps above, your installation should already be pretty secure. The page at http://localhost/security/index.php says otherwise but:

Finishing and using

The server installation is now complete. Each time you want to start Demyo, start the server by running X:\xampplite\xampp_start.exe. To stop it, run X:\xampplite\xampp_stop.exe.

Alternatively, you can use xampp-control.exe, which has a nice GUI to start both Apache and MySQL, and minimizes to the system tray.

On Linux, with your distribution's packages

Extract the Demyo archive (.zip or .tar.gz) in a temporary directory of your choice. In the following, we will assume that the file was extracted to /tmp/demyo-VERSION.

Debian

Under Debian (probably also under Ubuntu), you can install the following packages : apache2 libapache2-mod-php5 mysql-server php5-mysql php5-gd . During the installation of the SQL database, you could be prompted for a password for the root account. Fill it, and remember it. If asked wether the SQL server should be available from the network

You should also follow the following steps:

The server will automatically be started on boot.

Other distributions

Please refer to your system's documentation for Apache installation on other Linux distributions.

On Linux, with LAMPP

Extract the Demyo archive (.zip or .tar.gz) in a temporary directory of your choice. In the following, we will assume that the file was extracted to /tmp/demyo-VERSION.

If your distribution doesn't have packages for Apache or if they are somehow broken (consider reporting a bug to your distribution), you can also set up an all-in-one server.

Note: installing your distribution's packages should be the preferred way and I offer limited or no support for this procedure.

XAMPP

Download XAMPP for Linux from the XAMPP website.

Extract the downloaded file to /opt : in a terminal, change to the directory where the file was downloaded and run tar zxf xampp-linux-VERSION.tar.gz -C /opt . You will need root privileges to do that (either use su or sudo).

Note: It is only possible to run XAMPP for Linux from /opt , though you could install it anywhere and make a symbolic link from /opt to your directory of choice. This restricts the usage from a USB key to a computer where you can have root access (or where someone can set you a symbolic link once).

Security

Copy the recommended configuration files: in a terminal, run cp -rf /tmp/demyo-VERSION/xampp-linux/* /opt/lampp/.

Finishing and using

The server installation is now complete. Each time you want to start Demyo, start the server by running /opt/lampp/demyo start. To stop it, run /opt/lampp/demyo stop.

Installing

Now that you have a functionnal Web server (make sure it's running), you can install the actual Demyo software.

On Windows

Creating a user

A database user will now be added. This user is a bit like an account for a forum: it helps defining what you can and cannot do.

Go to http://localhost/phpmyadmin/ . Click click on Privileges, then on the "SQL" tab at the top of the page. Copy and paste the content of the create-user.sql file, then click go. You can change the password if you want, but you will have to change the configuration.

.sql files can be opened with Wordpad.

Creating the database

Once again, click on the SQL tab. This time, copy, paste and run the contents from create-database.sql.

Creating the tables

Click one last time on the SQL tab and run the contents from create-tables.sql.

Copying the files

You can now copy the demyo directory (the one from inside the extracted archive) into your server's hosting directory, that is X:\xampplite\htdocs if you followed the above procedure.

Copy the directory, not its contents, so that a file htdocs\demyo\index.php exists along with the app and cake directories (there can also be a few other files and directories).

On Linux

Note: the steps below use the mysql command. If you installed XAMPP on linux, you need to call /opt/lampp/bin/mysql instead.

Creating a user

A database user will now be added. This user is a bit like an account for a forum: it helps defining what you can and cannot do.

In a terminal, run mysql -u demyo -p < /tmp/demyo-VERSION/create-user.sql. You will have to type the password for the root database user (which you were told to remember in the above procedure).

You can edit the file beforehand and change the password if you want, but you will have to change the configuration.

Creating the database

In a terminal, run mysql -u demyo -p < /tmp/demyo-VERSION/create-database.sql. You will have to type the password for the root database user (which you were told to remember in the above procedure).

Creating the tables

In a terminal, run mysql -u demyo -p < /tmp/demyo-VERSION/create-tables.sql. You will have to type the password for the database user (default is password).

Copying the files

You can now copy the demyo directory (the one from inside the extracted archive) into your server's hosting directory. A common setting is /var/www (/opt/lampp/htdocs if you installed XAMPP for Linux).

In a terminal, run cp -r /tmp/demyo-VERSION/demyo /var/www/demyo.

Fix the privileges for Demyo: run (replacing $DEMYO_USER by your normal user name)

chown -R $DEMYO_USER:www-data /var/www/demyo
chmod -R u=rwX,g=rX,o= /var/www/demyo
chmod -R g+w /var/www/demyo/app/tmp /var/www/demyo/app/config/demyo.php \
	/var/www/demyo/app/webroot/img/thumbs
chown -R www-data /var/www/demyo/app/webroot/img/demyo_images
chmod -R go=rwX /var/www/demyo/app/webroot/img/demyo_images

Configuration

If you didn't follow the exact steps above (for example, you used a different user, password or database name), you will have to edit the database configuration in demyo/app/config/database.php to supply the user, password and database name.

Done !

That's it, Demyo should be available on your machine with any browser at http://localhost/demyo/ if you followed the steps above (the exact URL can change if you didn't follow the steps).