Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Apache2 Series



Addons & Tunnels





There seems to be fdsd info on installing and configuring Apache2 on gentoo so I will not repeat that process here. (feel free to add it your self if so inclined).

Here are the minimum requirements for Mambo 4.5

   * PHP 4.2.x or above -
   * MySQL 3.23.x or above -
   * Apache 1.13.19 or above -
   * Up to date Gentoo installation (for this how-to)

If you have these then you should be able to follow these instructions and have you new Mambo site up and running in no time. I have not tested this process extensively but tried many other failed attempts before working this out so I hope it will save you some time.

Step 1: Emerge Mambo

Fist make sure you are root to proceed. The # represents the terminal prompt.

# su root

You may already have this in your make.conf but it won't hurt to add the required USE flag here.

# USE="vhosts" emerge mambo

Note: As of this update the following version was available. And Masked.

* www-apps/mambo
    Available versions:  (4.6.1)  ~4.6.1
    Description:         Mambo is a dynamic portal engine and content management system

To unmask enter the following

# echo www-apps/mambo >> /etc/portage/package.keywords

Step 2: Create the data base

Run the data base creation script. Your Mambo version may differ from mine.

# emerge --config =mambo-

Enter a username for general access to the Mambo data base. You can probably leave the default mambo user, but I used the same username as used by my other php db's for the sake of consistency.

Enter a password for that user. Remember to use the same password if your using an existing user name.

Enter the username of a person that has power to grant permissions (usually root) and the associated password.

Step 3: Configure the webapp link

This allows Gentoo to keep the main source directory safely in the /usr/share/webapps directory and simply copies the appropriate files that are needed to the web access directory (/var/www/localhost/htdocs). It also ensures that the permissions are set correctly in the web directory. Of couse the success of this operation is dependent on you entering the correct comand line arguments so think carefully to save trouble later.

The <fqdn> represents the fully qualified domain name of your site such or whatever. I have used localhost here as I am building/testing this site offline. The -d is the directory in your web folder where the afore mentioned files will be copied. Note it is relative to the normal web folder which is /var/www/localhost/htdocs in my case. This is set up in your Apache configuration.

I have named the folder mambo but you may name it to whatever you want in your url. The last two args are the program name (mambo) and the version of that prog which is required by the webapps program.

webapp-config -I -h <fqdn> -d mambo mambo

Step 4: Configure Mambo and populate the data base

Restart Apache

# /etc/init.d/apache2 restart

You should now be able to connect to the 'Pre-installation check' web page at http://<fqdn>/mambo in your browser. Exchange <fqdn> for localhost if needed.

You may see a red warning about lack of permissions for the file configuration.php. Don't worry about this, we will fix it later.

After checking that everything is green click 'next' in the top right corner.

Accept the GPL licence blurb (after reading it carefully of course) and click next.

Enter the data that you used in the earlier mysql set-up stage. This is the user name that you entered for the mambo db not the root user which you used for granting permissions. Enter the password for that user and the name of the mambo db that you created earlier (mambo by default). Leave the sample data radio button checked.

Click next

Hopefully you will see a success message on the next page signifying that the db has been populated.

Give the site a name (this is not necessarily the url name but a name that is used in reference to the site in emails etc..)

Click next

The next page should already include the correct values in the first two fields, but alter if required. Enter an email address and an Admin password for access to the site.

Click next

Now to fix the configuration file problem that showed up earlier. Create the following file /var/www/localhost/htdocs/mambo/configuration.php. Remeber to exchange mambo for whatever your folder name is.

# vim /var/www/localhost/htdocs/mambo/configuration.php
# i (to enter insert mode)

Then cut and paste the source code shown in the mambo web installer window to that file. Save and close the file.

# :wq

Enter the following lines to set up the permission for the config file

# cd /var/www/localhost/htdocs/mambo
# chown apache:apache configuration.php
# chmod u+w configuration.php

You should be able to log onto the site now :)

If you are setting this up on a live domain for access from the web, you need to check that the configuration.php file has the correct address at the live_site parameter. It should be something like this.

$mosConfig_live_site = '';

Lastly, if all is well, delete the installation directory for security reasons. We don't want this info in the web directory.

# rm -rf /var/www/localhost/htdocs/mambo/installation

That's it. You should now have a template site that you can go crazy on. Hope this helped.

More info available here and Mambo Tutorial


If you get an error message during install beginning something like this:

# SQL=Specified key was too long; max key length is 1000 bytes:

This is probably because of your MySQL servers default character set is UTF-8 and using this encoding, every character is 16bits while others are 8bits. So, every column will have a doubled length.

You can change default character set for your tables. Open installation/sql/mambo.sql file in your favorite editor and change the string


with exactly this:


[for latin1, you may use something else]

Save the file, start mambo install again.

(Source: Mambo Forums)

Retrieved from ""

Last modified: Sun, 27 Apr 2008 19:17:00 +0000 Hits: 11,138