From Andreida
Jump to navigation Jump to search

Download and preparation

So you can create your own html2pdf

 apt-get install htmldoc

Create the file

 vi /usr/local/bin/html2pdf

With the content

 htmldoc --webpage -f $2 $1

Allow the execution

 chmod a+x /usr/local/bin/html2pdf

Now to the real openTimeTool Url to the download:

Get the INSTALL file

Create a folder like

mkdir /var/www/openTimeTool. 

Unpack the archive with

 tar -xzf openTimetool_x.x.x.tar.gz

Open the INSTALL file and keep it open.

less /var/www/openTimeTool/INSTALL

Prepare the database

First of all, backup your database, just in case

 mysqldump -p --all-databases > all-databases.sql

Open the console

 mysql -p

Create the database

 mysql> create DATABASE openTimetool;

Create a new user who has all rights for this new database

 mysql>GRANT ALL PRIVILEGES ON openTimetool.* TO 'username'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES;

Import the openTimetool structure into the new database

 mysql -uusername -p openTimetool < /var/www/openTimetool/mysql.sql

Create the apache file


touch /etc/apache2/sites-available/ssl-openTimetool

enable it

cd /etc/apache2/sites-enabled
ln -s ../sites-available/ssl-openTimetool

put something like this into it

<IfModule mod_ssl.c>
<VirtualHost openTimetool.<your-domain>:443>
    DocumentRoot /var/www/openTimetool/
    <Directory /var/www/openTimetool>
        Options FollowSymLinks
        AllowOverride All
       <IfModule mod_php4.c>
           php_flag register_globals off
      <IfModule mod_php5.c>
           php_flag register_globals off
    <IfModule mod_dir.c>
        DirectoryIndex index.php
  SSLEngine on
  SSLCertificateFile    /etc/<path>/<file>.cert
  SSLCertificateKeyFile /etc/<path>/<file>.key

Modify .htaccess

Open the file

 vi /var/www/openTimetool/htdocs/.htaccess


 php_value auto_prepend_file "/srv/www/htdocs/openTimetool/config.php"


 php_value auto_prepend_file "/var/www/openTimetool/config.php"

Change the php files

 cd /var/www/openTimetool

Create the config-local.php from a copy of the default

 cp config-local.php.dist  config-local.php

Edit the config-local.php

 vi config-local.php


  $config->dbDSN = 'mysql://<account>:<password>@localhost/openTimetool';

Create links to the languages, yes for english too

 cd /var/www/openTimetool/htdocs
 ln -s . en
 ln -s . de

Restart the apache

/etc/init.d/apache2 reload