Discussion:
[Discussion] updated wiki for Ubuntu installation
Y.M. Dijkstra
2018-01-20 08:27:45 UTC
Permalink
The current Ubuntu installation guide is for 15.10. To get in to work on 17.10, some minor changes are needed. None of these are unsolvable with some minor googling. I suspect the Wiki submissions are limited to the maintainers (couldn't find an add account option), but I added the wiki-formatted updated text below.

Changes:
- php5_snmp and php5_curl are now php_snmp and php_curl
- added php_zip and php_gd
- changed version from 4.0.1 to 4.5
- added a directory to be made writable
- added a couple of sudos
- edit mysql.cfg to prevent the install.php FAIL.


Wiki text below.
Kind regards,
IJdo

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 for 17.10.

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:

<blockquote>
<pre>
$ sudo apt-get install php-snmp snmp-mibs-downloader php-curl php-gettext php_zip php_gd graphviz
</pre>
</blockquote>

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:

<blockquote>
<pre>
$ cd
$ wget http://opendcim.org/packages/openDCIM-4.5.tar.gz
$ cd /var/www
$ sudo tar zxpvf ~/openDCIM-4.5.tar.gz
$ sudo ln -s openDCIM-4.5 dcim
</pre>
</blockquote>

== Give Apache permission to write to certain directories ==

There are times when Apache will need to be able to write to two of the directories - specifically the /drawings (maps of your data centers) and /pictures (pictures of your devices) folders. To do this, we need to set the group for those folders to the group that Apache is running as. On a default Ubuntu 15.04 server, that group is called www-data.

<blockquote>
<pre>
$ sudo chgrp -R www-data /var/www/dcim/pictures /var/www/dcim/drawings /var/www/dcim/vendor/mpdf/mpdf/ttfontdata
</pre>
</blockquote>

== 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 <i>rootpw</i>.

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

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'.

<blockquote>
<pre>
$ cd /var/www/dcim
$ sudo cp db.inc.php-dist db.inc.php
</pre>
</blockquote>

<blockquote>
<pre>
$ sudo nano /etc/mysql/conf.d/mysql.cnf
</pre>
</blockquote>
Add the following lines:
<blockquote>
<pre>
[mysqld]
sql_mode=
</pre>
</blockquote>
Restart MySQL
<blockquote>
<pre>
$ sudo service mysql restart
</pre>
</blockquote>

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.

<blockquote>
<pre>
$ cd /etc/apache2/sites-available
$ sudo nano default-ssl.conf
</pre>
</blockquote>

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

<blockquote>
<pre>
DocumentRoot /var/www/dcim

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

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

<blockquote>
<pre>
ErrorLog ${APACHE_LOG_DIR}/dcim-error.log
CustomLog ${APACHE_LOG_DIR}/dcim-access.log
</pre>
</blockquote>

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:

<blockquote>
<pre>
$ sudo nano /var/www/dcim/.htaccess

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

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.

<blockquote>
<pre>
$ sudo htpasswd -cb /var/www/opendcim.password dcim dcim
$ sudo a2enmod ssl
$ sudo a2enmod rewrite
$ sudo a2ensite default-ssl
$ sudo service apache2 restart
</pre>
</blockquote>

== 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:

<blockquote>
<pre>
$ sudo locale-gen es_ES
</pre>
</blockquote>

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.
________________________________

AMC Disclaimer : https://www.amc.nl/disclaimer

________________________________
Scott Milliken
2018-01-22 13:20:38 UTC
Permalink
I had to turn off the non-moderated user account creation on the wiki
because some spammers created accounts and added thousands of spam links on
there some time back. I will be happy to create an account for anybody
that would like to contribute - even if it's just to fix one or two
things. Just send me your information (name / email address) to
***@opendcim.org and I'll get you set up.

Thanks,
Scott
Post by Y.M. Dijkstra
The current Ubuntu installation guide is for 15.10. To get in to work on
17.10, some minor changes are needed. None of these are unsolvable with
some minor googling. I suspect the Wiki submissions are limited to the
maintainers (couldn't find an add account option), but I added the
wiki-formatted updated text below.
- php5_snmp and php5_curl are now php_snmp and php_curl
- added php_zip and php_gd
- changed version from 4.0.1 to 4.5
- added a directory to be made writable
- added a couple of sudos
- edit mysql.cfg to prevent the install.php FAIL.
Wiki text below.
Kind regards,
IJdo
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 for 17.10.
During the installation of the operating system, you should choose to add
:: 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
<blockquote>
<pre>
$ sudo apt-get install php-snmp snmp-mibs-downloader php-curl php-gettext
php_zip php_gd graphviz
</pre>
</blockquote>
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
<blockquote>
<pre>
$ cd
$ wget http://opendcim.org/packages/openDCIM-4.5.tar.gz
$ cd /var/www
$ sudo tar zxpvf ~/openDCIM-4.5.tar.gz
$ sudo ln -s openDCIM-4.5 dcim
</pre>
</blockquote>
== Give Apache permission to write to certain directories ==
There are times when Apache will need to be able to write to two of the
directories - specifically the /drawings (maps of your data centers) and
/pictures (pictures of your devices) folders. To do this, we need to set
the group for those folders to the group that Apache is running as. On a
default Ubuntu 15.04 server, that group is called www-data.
<blockquote>
<pre>
$ sudo chgrp -R www-data /var/www/dcim/pictures /var/www/dcim/drawings
/var/www/dcim/vendor/mpdf/mpdf/ttfontdata
</pre>
</blockquote>
== 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 <i>rootpw</i>.
<blockquote>
<pre>
$ mysql -u root -prootpw
mysql> create database dcim;
mysql> quit
</pre>
</blockquote>
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'.
<blockquote>
<pre>
$ cd /var/www/dcim
$ sudo cp db.inc.php-dist db.inc.php
</pre>
</blockquote>
<blockquote>
<pre>
$ sudo nano /etc/mysql/conf.d/mysql.cnf
</pre>
</blockquote>
<blockquote>
<pre>
[mysqld]
sql_mode=
</pre>
</blockquote>
Restart MySQL
<blockquote>
<pre>
$ sudo service mysql restart
</pre>
</blockquote>
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.
<blockquote>
<pre>
$ cd /etc/apache2/sites-available
$ sudo nano default-ssl.conf
</pre>
</blockquote>
<blockquote>
<pre>
DocumentRoot /var/www/dcim
<Directory "/var/www/dcim">
Options All
AllowOverride All
Require all granted
</Directory>
</pre>
</blockquote>
It is also suggested that you change the following two lines further down
<blockquote>
<pre>
ErrorLog ${APACHE_LOG_DIR}/dcim-error.log
CustomLog ${APACHE_LOG_DIR}/dcim-access.log
</pre>
</blockquote>
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.
<blockquote>
<pre>
$ sudo nano /var/www/dcim/.htaccess
AuthType Basic
AuthName "openDCIM"
AuthUserFile /var/www/opendcim.password
Require valid-user
</pre>
</blockquote>
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.
<blockquote>
<pre>
$ sudo htpasswd -cb /var/www/opendcim.password dcim dcim
$ sudo a2enmod ssl
$ sudo a2enmod rewrite
$ sudo a2ensite default-ssl
$ sudo service apache2 restart
</pre>
</blockquote>
== 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
<blockquote>
<pre>
$ sudo locale-gen es_ES
</pre>
</blockquote>
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.
________________________________
AMC Disclaimer : https://www.amc.nl/disclaimer
________________________________
_______________________________________________
Discussion mailing list
http://list.opendcim.org/mailman/listinfo/discussion
Loading...