UNIX (non-root) Installation Notes

The Bugzilla Guide - 3.6.8 Release
Prev | Chapter 2. Installing Bugzilla | Next

# 2.6. UNIX (non-root) Installation Notes

## 2.6.1. Introduction

If you are running a *NIX OS as non-root, either due to lack of access (web hosts, for example) or for security reasons, this will detail how to install Bugzilla on such a setup. It is recommended that you read through the Section 2.1 first to get an idea on the installation steps required. (These notes will reference to steps in that guide.)

## 2.6.2. MySQL

You may have MySQL installed as root. If you're setting up an account with a web host, a MySQL account needs to be set up for you. From there, you can create the bugs account, or use the account given to you.

| You may have problems trying to set up GRANT permissions to the database. If you're using a web host, chances are that you have a separate database which is already locked down (or one big database with limited/no access to the other areas), but you may want to ask your system administrator what the security settings are set to, and/or run the GRANT command for you. Also, you will probably not be able to change the MySQL root user password (for obvious reasons), so skip that step.

### 2.6.2.1. Running MySQL as Non-Root

#### 2.6.2.1.1. The Custom Configuration Method

Create a file .my.cnf in your home directory (using /home/foo in this example) as follows....

    [mysqld]
    datadir=/home/foo/mymysql
    socket=/home/foo/mymysql/thesock
    port=8081

    [mysql]
    socket=/home/foo/mymysql/thesock
    port=8081

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/home/foo/mymysql/the.log
    pid-file=/home/foo/mymysql/the.pid

#### 2.6.2.1.2. The Custom Built Method

You can install MySQL as a not-root, if you really need to. Build it with PREFIX set to `/home/foo/mysql`, or use pre-installed executables, specifying that you want to put all of the data files in `/home/foo/mysql/data`. If there is another MySQL server running on the system that you do not own, use the -P option to specify a TCP port that is not in use.

#### 2.6.2.1.3. Starting the Server

After your mysqld program is built and any .my.cnf file is in place, you must initialize the databases (ONCE).

                  bash$
                  mysql_install_db

Then start the daemon with

                  bash$
                  safe_mysql &

After you start mysqld the first time, you then connect to it as "root" and GRANT permissions to other users. (Again, the MySQL root account has nothing to do with the *NIX root account.)

| You will need to start the daemons yourself. You can either ask your system administrator to add them to system startup files, or add a crontab entry that runs a script to check on these daemons and restart them if needed.

| Do NOT run daemons or other services on a server without first consulting your system administrator! Daemons use up system resources and running one may be in violation of your terms of service for any machine on which you are a user!

## 2.6.3. Perl

On the extremely rare chance that you don't have Perl on the machine, you will have to build the sources yourself. The following commands should get your system installed with your own personal version of Perl:

            bash$
            wget http://perl.org/CPAN/src/stable.tar.gz
            bash$
            tar zvxf stable.tar.gz
            bash$
            cd perl-5.8.1 (or whatever the version of Perl is called)
            bash$
            sh Configure -de -Dprefix=/home/foo/perl
            bash$
            make && make test && make install

Once you have Perl installed into a directory (probably in `~/perl/bin`), you will need to install the Perl Modules, described below.

## 2.6.4. Perl Modules

Installing the Perl modules as a non-root user is accomplished by running the `install-module.pl` script. For more details on this script, see `install-module.pl` documentation

## 2.6.5. HTTP Server

Ideally, this also needs to be installed as root and run under a special web server account. As long as the web server will allow the running of *.cgi files outside of a cgi-bin, and a way of denying web access to certain files (such as a .htaccess file), you should be good in this department.

### 2.6.5.1. Running Apache as Non-Root

You can run Apache as a non-root user, but the port will need to be set to one above 1024. If you type httpd -V, you will get a list of the variables that your system copy of httpd uses. One of those, namely HTTPD_ROOT, tells you where that installation looks for its config information.

From there, you can copy the config files to your own home directory to start editing. When you edit those and then use the -d option to override the HTTPD_ROOT compiled into the web server, you get control of your own customized web server.

| You will need to start the daemons yourself. You can either ask your system administrator to add them to system startup files, or add a crontab entry that runs a script to check on these daemons and restart them if needed.

| Do NOT run daemons or other services on a server without first consulting your system administrator! Daemons use up system resources and running one may be in violation of your terms of service for any machine on which you are a user!

## 2.6.6. Bugzilla

When you run ./checksetup.pl to create the `localconfig` file, it will list the Perl modules it finds. If one is missing, go back and double-check the module installation from Section 2.6.4, then delete the `localconfig` file and try again.

| One option in `localconfig` you might have problems with is the web server group. If you can't successfully browse to the `index.cgi` (like a Forbidden error), you may have to relax your permissions, and blank out the web server group. Of course, this may pose as a security risk. Having a properly jailed shell and/or limited access to shell accounts may lessen the security risk, but use at your own risk.

### 2.6.6.1. suexec or shared hosting

If you are running on a system that uses suexec (most shared hosting environments do this), you will need to set the webservergroup value in `localconfig` to match your primary group, rather than the one the web server runs under. You will need to run the following shell commands after running ./checksetup.pl, every time you run it (or modify `checksetup.pl` to do them for you via the system() command).

            for i in docs graphs images js skins; do find $i -type d -exec chmod o+rx {} \; ; done
            for i in jpg gif css js png html rdf xul; do find . -name \*.$i -exec chmod o+r {} \; ; done
            find . -name .htaccess -exec chmod o+r {} \;
            chmod o+x . data data/webdot

Pay particular attention to the number of semicolons and dots. They are all important. A future version of Bugzilla will hopefully be able to do this for you out of the box.

Prev | Home | Next
OS-Specific Installation Notes | Up | Upgrading to New Releases