From OpenDCIM Wiki
Jump to: navigation, search
(Create your openDCIM DB and point openDCIM at it)
(Configure Apache)
Line 64: Line 64:
 
<pre>
 
<pre>
 
$ cd /etc/apache2/sites-available
 
$ cd /etc/apache2/sites-available
$ nano default-ssl.conf
+
$ sudo nano default-ssl.conf
 
</pre>
 
</pre>
 
</blockquote>
 
</blockquote>

Revision as of 13:22, 11 June 2015

Many Virtual Private Server (VPS) hosting facilities have Ubuntu as an automatic install image, so it is a very popular platform. Here are the specifics.

During the installation of the operating system, you should choose to add the following packages:

OpenSSH server
LAMP server

Once the installation has completed and the system reboots, there are a few things that need to be added and configured. Order is relatively important, so do these in the order listed.

Install some additional packages needed

Log in as the user set up during the installation, and at the $ prompt you'll do the following:

$ sudo apt-get install php5-snmp snmp-mibs-downloader php5-curl php-gettext

You will be asked to confirm, and once the packages are installed it is time to download the latest version of openDCIM.

Download and unpackage openDCIM

Assuming that you wish to install openDCIM under the /var/www directory, do the following, but be sure to use the most recent package link for openDCIM:

$ cd
$ wget http://opendcim.org/packages/openDCIM-4.0a.tar.gz
$ cd /var/www
$ sudo tar zxvf ~/openDCIM-4.0a.tar.gz
$ sudo ln -s openDCIM-v4.0a.tar.gz dcim

Create your openDCIM DB and point openDCIM at it

You will need to either have your dba perform this step for you or you will need to know the MySQL root password (you are prompted to set it during installation). For our example, it is rootpw.

$ mysql -u root -prootpw
mysql> create database dcim;;
mysql> grant all on dcim.* to 'dcim'@'localhost' identified by 'dcim';
mysql> quit

This will create a database called 'dcim' and also grant full access on it to a user who can only access the db locally and using the password of 'dcim'.

$ sudo chown -R dcim:dcim /var/www/dcim (or whatever other user will be owning the content)
$ cd /var/www/dcim
$ cp db.inc.php-dist db.inc.php

If you are using a locally hosted MySQL database called 'dcim' with a user and password combination of 'dcim'/'dcim' then there is no need to edit the file once you have copied it over. If you have different values, please update the file accordingly.

Configure Apache

By default, Apache only runs on port 80 (http) and serves the content in directory /var/www/html. We want SSL encryption and we don't want the default site, either.

$ cd /etc/apache2/sites-available
$ sudo nano default-ssl.conf

Change the line that starts with DocumentRoot, plus add the following lines:

DocumentRoot /var/www/dcim

<Directory "/var/www/dcim">
    Options All
    AllowOverride All
    Require all granted
</Directory>

It is also suggested that you change the following two lines further down in the configuration file:

ErrorLog ${APACHE_LOG_DIR}/dcim-error.log
CustomLog ${APACHE_LOG_DIR}/dcim-access.log

Save the file and we're almost there.

Set up user access for your website

There are a lot of ways to control access to your web server and we are only going to cover the most basic. You can search the web for ways to integrate Apache with LDAP or Active Directory, but at that point it is an Apache issue, not an openDCIM issue.

To set up the most basic authentication possible:

$ nano /var/www/dcim/.htaccess

AuthType Basic
AuthName "openDCIM"
AuthUserFile /var/www/opendcim.password
Require valid-user

Save that file and Apache will know how to ask users to log in. We have one last thing to do before we can pull up the website.

Finalize the Apache configuration and restart it

Issue the following commands to enable the site and modules that we need. Most of these commands will tell you to restart apache after you issue them - ignore that, as you are restarting apache as the very last step.

$ sudo htpasswd -cb /var/www/opendcim.password dcim dcim
$ sudo a2enmod ssl
$ sudo a2enmod rewrite
$ sudo a2ensite default-ssl
$ sudo apache2 restart

See if it works!

Point your browser to https://yoururl and see if you are asked to log in (dcim/dcim) as created in the previous step), followed by the pre-flight checklist followed by the initial configuration. If you have any missing modules, the pre-flight checklist will pause and show you what's missing. Also, if you are not using a verified SSL Certificate, your browser will likely issue a security warning to you when you first attempt to browse the site.

Special note about Internationalization

You will notice that openDCIM has several alternate languages available in the drop down list. However, until you install that specific locale on your system, it will only display the source language (en_US). To add support for another language, such as Spanish (es_ES), do the following:

$ sudo locale-gen es_ES

You can generate as many locales on a system as you wish, but to save disk space, the installation only comes with the one selected during original installation.