#1 2015-08-22 23:54:59

larzeni
Member
Registered: 2015-08-21
Posts: 24

[SOLVED] Installing Ionize on Debian Wheezy walkthrough

This is a newbie experience on installing Ionize on debian linux

  • Install php5 and mysql-server-5.5. Between the dependencies of php5 you'll find most packages that are needed to work with php as, for example, apache2-mpm-prefork. After the installation of apache:

  1. edit /etc/apache2/sites-available/default and change "AllowOverride Note" to "AllowOverride All" inside the "/var/www" directory

  2. enable mod_rewrite (running as root a2enmod rewite)

  3. restart apache to let it pick the configuration changes (as root: /etc/init.d/apache2 restart

  • You will need few other packages: php5-gd, php5-mysql and php5-curl. Please note that debian has 2 mysql drivers, both of them claims to include mysqli: php5-mysql and php5-mysqlnd. I don't know which one is better, I choose php5-mysql and thing are working fine, so I suggest you to do the same.

At this point your system is able to run Ionize, but, before it can work, you need to create a user and a database for ionize. You can do this using the command line, but it's by far easier to manage mysql using mysql-workbench, so I suggest you to use this tool to create them.

Now you can follow the instructions given in the installation manual; under debian you will need to uncompress the zip file under the folder "/var/www" (remove the index.html file that was placed in this folder by the apache2 installation package), but you'll need to be root to write in this folder.

If you do this (that is, if you write the files as root user), the setup will complain that many files and folder are not writeable. It depends on the user that is running the web server (on debian it's "www-data"), and this user cannot write files or folders owned by root.

I wrote a little script to change permission and ownership of ionize files: cd to the /var/www folder, and, as root user, run the following script (you'll need to save it and make it executable)

#!/bin/sh

FILES_TO_CHANGE="
	application/logs \
	application/config \
	cache \
	files \
	files/pictures \
	themes \
	themes/foundation5 \
	application/config/config.php \
	application/config/database.php \
	application/config/email.php \
	application/config/ionize.php \
	application/config/language.php \
	application/config/modules.php \
	"

WWW_USER="www-data"

for i in ${FILES_TO_CHANGE}; do
	echo "Processing $i"
	chmod ug+w $i
	chgrp ${WWW_USER} $i
done

exit 0

Please note that somewhere in the docs, the log folder is (wrongly) reported to be "system/logs". Somewhere else instead, it's (correctly) reported that the log folder is "application/logs". This is the reason why I made it writable by the "www-data" user, otherwise logs would not be available.

If you follow the manual, sometimes you'll see a warning on top of the screen that complains that ionize cannot save the changes. Look in the logs and you will spot a filename that is non writable by the wen user. Change its permissions and ownership as in the previous script and retry. Now it should work.

To install a translation package
I'm not a native english speaker so I like to use a translation for the admin site. May be that for other people it was obvious, but I could not find any info explaining how to install it. Well, it's very simple: unzip the translation package in the root folder. It will add the following folders to the system:

./system/language/xx
./install/language/xx
./application/language/xx

where "xx" is your language code.

After this, login to the admin site, choose from menu the "settings > ionize interface" window and select your language.

... I'm now following the manual... to be continued ...

Last edited by larzeni (2015-08-25 23:12:34)

Offline

#2 2015-08-23 00:26:58

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: [SOLVED] Installing Ionize on Debian Wheezy walkthrough

you can install for database manage the phpmyadmin:

root@hostname:~# apt-get install phpmyadmin

The full lamp server installation is this:

root@hostname:~# apt-get install apache2 php5 mysql-server phpmyadmin mailutils

if you want access the mysql from outside then edit the /etc/mysql/my.cnf
Search the bind-address and replace 127.0.0.1 to your server ip, after that restart the mysql:

root@hostname:~# service mysql restart

dont use /etc/init.d because that not will restart the depencies of a service
after mysql restart on phpmyadmin you must add a user with any host (%)

The file permission problem can be handled easier:

root@hostname:~# chown www-data:www-data -R /path/to/www
root@hostname:~# chmod +w -R /path/to/www

after installation try your mailer because on debian not every time working (or just missing by default):

root@hostname:~# echo "Test Message" | mail -s "Testing mail on Server" user@address.tld

If mail can't send an email then the PHP is unable on local.

Most of the cases one server handling multiple sites, you can configure in the apache sites folder: /etc/apache2/sites-available/
In that forlder you will find .conf files, create your own from the default one:

<VirtualHost *:80>
        ServerName www.example.com
        ServerAdmin webmaster@localhost

        DocumentRoot /path/to/www/

        <Directory /path/to/www/>
                Options +Indexes +FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

If your file is read in the sites-available then your can enable sites with a2ensite:

root@hostname:~# a2ensite 001-example_com.conf
root@hostname:~# service apache2 reload

If you have a domain with nameservers then you can configure your domain on web then create a "A record" for your server and it will be work, If you want to test the virtualhost without dns, then put into your hosts file the test domain:

11.22.33.44    example.com

hosts file default locations:

Linux: /etc/hosts
Windows: C:\Windows\System32\drivers\etc\hosts
Mac: /private/etc/hosts


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#3 2015-08-24 12:42:22

larzeni
Member
Registered: 2015-08-21
Posts: 24

Re: [SOLVED] Installing Ionize on Debian Wheezy walkthrough

Hi Adam,
thanks for your hints.

A question: I'm scared about giving file ownership to wwww-data user. This would open road to many security breaks. This is the reason that I choose to expand files as root and give write access to "www-data" user  only on a limited subset of files.

What do you think about security issues?
Thanks,
larzeni

Offline

#4 2015-08-24 13:08:26

adaliszk
Ionize Friend
From: Germany
Registered: 2010-09-20
Posts: 397
Website

Re: [SOLVED] Installing Ionize on Debian Wheezy walkthrough

larzeni wrote:

Hi Adam,
thanks for your hints.

A question: I'm scared about giving file ownership to wwww-data user. This would open road to many security breaks. This is the reason that I choose to expand files as root and give write access to "www-data" user  only on a limited subset of files.

What do you think about security issues?
Thanks,
larzeni

Root can write in any file on linux, www-data not. Also www-data cant access to the root and system files, so changeing the owner to www-data is safer. You can still edit the files with root, but use your user with sudo instead. On a server you dont want use root if its not necesseary.


Webdeveloper, Programmer, Application developer, Ionize friend
@adaliszk

Offline

#5 2015-08-24 13:28:04

larzeni
Member
Registered: 2015-08-21
Posts: 24

Re: [SOLVED] Installing Ionize on Debian Wheezy walkthrough

Well, outside of a development system, no one should be allowed to edit the CMS files, nor have the need to do this.

That's exactly the reason why files should belong to root, or to another restricted user, but not to www-data: so that no one can change them, unless they are explicitly authorized to do so .

I understand that, using that admin tool, there is sometimes the need to change php files; but since the admin tool executes with the rights of www-data user, denying write access to files is a mean to avoid that an intruder could damage the site.

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations