Forums | Mahara Community

Support /
Installation on Debian unstable


anonymous profile picture
Account deleted
Posts: 5

12 January 2014, 10:12

Hi,

on my Debian GNU/Linux unstable (sid) Desktop machine I want to install
Mahara from source: mahara-1.8.1.tar.gz

I'm trying to follow this tutorial:
How_to_install_Mahara_in_Ubuntu

but I want to do it in a little different way:

1.
I have installed all dependencies.

2.
I have unpacked mahara/htdocs/ directory that I did copy to:
/usr/share/mahara/htdocs/

The permissions of this directory and subdirectories, files are:
$ ls -l /usr/share/mahara/
total 84

-rw-rw-r--  1 root root 35147 Dec 17 23:57 COPYING
-rw-rw-r--  1 root root 32103 Dec 17 23:57 ChangeLog
-rw-rw-r--  1 root root  2415 Dec 17 23:57 Makefile
-rw-rw-r--  1 root root  3652 Dec 17 23:57 README
drwxrwxr-x 26 root root  4096 Jan 10 21:49 htdocs
-rw-rw-r--  1 root root   561 Dec 17 23:57 phpunit.xml

3.
make the mahara directory here:
/var/lib/mahara/

sudo chown -R www-data:www-data /var/lib/mahara/

4.
Configure the Database:


sudo su - postgres
 createuser -SRDP mahara
 [password]
 [confirm password]
 createdb -O mahara -EUTF8 mahara
 exit

5.
Configure Apache2:

This want I edit so so it should correspond to
/etc/apache2/sites-enabled/moodle.conf

because it doesn't uses Virtualhost, but Aliase and I want not to use

So, in
moodle.conf I have following:

<code>
Alias /moodle /usr/share/moodle/
<Directory /usr/share/moodle/>

Options +FollowSymLinks
AllowOverride None

order deny,allow
deny from all

allow from 127.0.0.0/8
allow from localhost

<IfModule mod_php5.c>
        php_flag magic_quotes_gpc Off
        php_flag magic_quotes_runtime Off
        php_flag file_uploads On
        php_flag session.auto_start Off
        php_flag session.bug_compat_warn Off

        php_value upload_max_filesize 2M
        php_value post_max_size 2M
</IfModule>

<IfModule mod_dir.c>

<IfModule mod_dir.c>
        DirectoryIndex index.php
</IfModule>

</Directory>
</code>

So, I edited the mahara.conf like:

sudo nano /etc/apache2/sites-available/mahara.conf

<code>
Alias /mahara /usr/share/mahara/htdocs/
<Directory /usr/share/mahara/htdocs/>

Options +FollowSymLinks

AllowOverride None

order deny,allow
deny from all

allow from 127.0.0.0/8
allow from localhost

</Directory>

</code>

sudo a2ensite mahara.conf

6.

Mahara Configuration

cd /usr/share/mahara/htdocs/
sudo cp config-dist.php config.php
sudo nano config.php

<code>
$cfg = new stdClass();

$cfg->dbtype   = 'postgres';
$cfg->dbhost   = 'localhost';
$cfg->dbport   = null;
$cfg->dbname   = 'mahara';
$cfg->dbuser   = 'mahara';
$cfg->dbpass   = 'SecretPassword';


$cfg->dbprefix = '';

$cfg = new stdClass();
$cfg->wwwroot = ' localhost/mahara/';

$cfg->dataroot = '/var/lib/mahara';
$cfg->directorypermissions = 0750;

$cfg->emailcontact = '';

$cfg->passwordsaltalt1 = 'old salt value';
</code>

sudo /etc/init.d/apache2 restart


Now, when I open in my Internet Browser site:
localhost/mahara/

I get error messages:

[WAR] f0 Creating default object from empty value
Call stack (most recent first):

    log_message("Creating default object from empty value", 8, true,
    true, "/usr/share/mahara/htdocs/config.php", 32) at
    /usr/share/mahara/htdocs/lib/errors.php:430
    error(2, "Creating default object from empty value",
    "/usr/share/mahara/htdocs/config.php", 32, array(size 11)) at
    /usr/share/mahara/htdocs/config.php:32

    require("/usr/share/mahara/htdocs/config.php") at
    /usr/share/mahara/htdocs/init.php:69
    require("/usr/share/mahara/htdocs/init.php") at
    /usr/share/mahara/htdocs/index.php:16

Mahara: Site unavailable
Your server configuration references an unknown database type. Valid
values are "postgres" and "mysql". Please change the database type
setting in config.php.


As one can see, I have already "postgres" in the config.php file.

What could be the problem here?

--
Regards from Pal

anonymous profile picture
Account deleted
Posts: 5

12 January 2014, 22:03

Maybe the PostgreSQL version 9.2, that I have installed is not
appropriate for mahara, because I read in the
/usr/share/mahara/htdocs/init.php

the following lines ( from 137 to 142 ):

    // Now we have a connection, verify the server is a new enough
    version
    $dbversion = $db->ServerInfo();
    if (is_postgres()) {
        $okversion = '8.3';
        $dbfriendlyname = 'PostgreSQL';
    }

So, my version of the installed PostgreSQL is 9.2, but for the init.php
it should be version 8.3?

No, I think not, because when I change the line

$okversion = '8.3';

to

$okversion >= '8.3';

and try to refresh the localhost/mahara site, I get the same error.

Robert Lyon's profile picture
Posts: 757

13 January 2014, 7:29

Hi Pál

Looking at the code for the config.php file you posted, you have the $cfg = new stdClass(); in there twice. It only needs to appear once as the first line.

Also try commenting out the $cfg->wwwroot line to see if the system can detect your wwwroot automatically when you browse to the url of the Mahara site.

Cheers

Robert

 

anonymous profile picture
Account deleted
Posts: 5

14 January 2014, 4:14

Hi Robert,

I delete now the second line:

$cfg = new stdClass();

so it appeares only once as the first line of config.php file.

When I commented out the line:

$cfg->wwwroot = 'localhost/mahara/';

so I have now:

//$cfg->wwwroot = 'localhost/mahara/';

and try to open the webpage

//localhost/mahara

Note! I must to omit the http in abowe lines, because I get the message:

Sorry, newly registered users aren't allowed to post links or images. Please reword your post to remove these and try again.

 

I get error message:

Not Found

The requested URL /admin/index.php was not found on this server.


Apache/2.4.7 (Debian) Server at localhost Port 80
 
but, when I leave it uncommented, Finally I get the Mahara installation webpage!
 
Thank you for the help!
 
Regards, from Pál
4 results