Install HP Support Software in your Ubuntu Server

No Comments

We have some HP Proliant DL rack servers with Ubuntu 12.04 LTS. Knowing HP officially supports Ubuntu distributions we may install their management software to help with inventory and monitoring.

What to Install

We need to add the HP Support Software repository to every system.

Add the following line

deb http://downloads.linux.hp.com/SDR/downloads/MCP/ubuntu precise current/non-free

to a new file under aptitude sources directory

$ sudo vi /etc/apt/sources.list.d/hp-proliant-support-pack.list

Please do a sudo apt-get update

Then install all these packages.

$ sudo apt-get install hpsmh hp-snmp-agents hp-smh-templates hponcfg hp-health hpacucli

Depending on what you already have installed apt may install other packages or tell you some suggestions.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  binutils libperl5.14 libsensors4 libsnmp-base libsnmp15 libssl0.9.8 libxslt1.1 snmpd
  xsltproc
Suggested packages:
  binutils-doc lm-sensors snmp-mibs-downloader
The following NEW packages will be installed:
  binutils hp-health hp-smh-templates hp-snmp-agents hpacucli hponcfg hpsmh libperl5.14
  libsensors4 libsnmp-base libsnmp15 libssl0.9.8 libxslt1.1 snmpd xsltproc
0 upgraded, 15 newly installed, 0 to remove and 2 not upgraded.
Need to get 33.3 MB of archives.
After this operation, 106 MB of additional disk space will be used.
Do you want to continue [Y/n]? 
WARNING: The following packages cannot be authenticated!
  hp-health hp-snmp-agents hpsmh hp-smh-templates hpacucli hponcfg
Install these packages without verification [y/N]?

If you are using snmpd you may like to read a previous note from me.

Final configurations

Along the installation of those packages you may have been warned:

WARNING:hp-snmp-agents is not configured.
You must type '/sbin/hpsnmpconfig' as 'root' user to configure agents.

It’s time to running it now.

Opening your browser with http://servername:2381/ let’s you see the HP System Management Homepage

Please edit /opt/hp/hpsmh/conf/smhpd.xml and restart hpsmhd so you control whom can access.

$ sudo service hpsmhd restart

Finally

Well, now browse through each package man pages to learn features and configuration tweaks. Don’t forget HP maintains a web presence to Ubuntu support

flattr this!

How to get the original IP address in Apache2 behind Nginx

No Comments

Nginx as a reverse proxy for Apache

A traditional setup is having Nginx as a frontend and then running Apache through reverse proxy. The Apache logs become full of just a single IP address, the accesses from the Nginx server – usually 127.0.0.1 if you are running both on the same server.

No more GeoIP decisions on the backend or any other feature by remote address.

But we know that Nginx passes along the original client IP address on a HTTP header named X-Forwarded-For to the backend server. It would be awesome if Apache could deal with that,

Have no fear, Reverse Proxy Add Forward is here!

Fortunately there is already a module that injects the IP on a special header to the HTTP request to Apache: mod_rpaf

The installation couldn’t be more simple than

$ sudo apt-get install libapache2-mod-rpaf

It will enabled it automatically

/etc/apache2/mods-enabled/rpaf.conf
/etc/apache2/mods-enabled/rpaf.load

In Nginx I usually include /etc/nginx/proxy.conf in my configuration. It already has these lines to help that everything works easily

proxy_set_header    Host            $host;
proxy_set_header    X-Real-IP       $remote_addr;
proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;

Just restart the Apache server

$ sudo service apache2 restart

But there’s a problem

Unfortunately it won’t work if you are using Ubuntu 12.04.

mod_rpaf is not working on Precise !

There is a bug with the package that is known to Canonical since last December as you can see in the bug track. Being a LTS version I don’t understand this attitude from them.

$ cat /etc/apache2/mods-enabled/rpaf.conf 
<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1 ::1
</IfModule>

And the problem is that it is originally named mod_rpaf-2.0.c.

$ strings /usr/lib/apache2/modules/mod_rpaf.so | grep mod_rpaf
mod_rpaf.so
mod_rpaf-2.0.c
Enable mod_rpaf
Let mod_rpaf set the hostname from X-Host header and update vhosts

Just edit the first line of /etc/apache2/mods-enabled/rpaf.conf and change it to

<IfModule rpaf_module>

Restart again the Apache2 server and you will start to get all those remote IPs on your log files.

Conclusion

If it was not for the known bug this post could have been just one line to install mod_rpaf

:-)

flattr this!

Where is my add-apt-repository in Ubuntu Server LTS 12.04 ?

No Comments

Yes, where is it ?

biafra@vm:~$ sudo add-apt-repository ppa:rwky/redis
[sudo] password for biafra: 
sudo: add-apt-repository: command not found

So, you are using the latest stable and supported LTS server distribution from Ubuntu. And it doesn’t install the package to simplify the management of PPA repositories (Personal Package Archives). The de facto Ubuntu repository for all people.

They even state that in the help text:

Read about installing

“Read about installing”

But don’t despair! They could already had installed it with one of the upgrades but… They forgot it. add-apt-repository comes with package python-software-properties

$ sudo apt-get install python-software-properties

And now at last:

biafra@vm:~$ sudo add-apt-repository ppa:rwky/redis
You are about to add the following PPA to your system:
 Redis is a in memory persistent datastore. This is package kept up
to date with the latest stable version from http://redis.io it uses
an upstart script instead of an init script which fits nicely with
the newer ubuntu distributions.
 
For support email admin {at} rwky {dot} net
 
For support in other distributions please contact me at the above
address and I'll consider other builds if there is demand.
 
If you like this package please consider flattring me
http://flattr.com/thing/360264/Redis-package-for-Ubuntu
 
Sponsored by @Food_Nation http://www.food-nation.co.uk/
 More info: https://launchpad.net/~rwky/+archive/redis
Press [ENTER] to continue or ctrl-c to cancel adding it
 
gpg: keyring `/tmp/tmp48ytqX/secring.gpg' created
gpg: keyring `/tmp/tmp48ytqX/pubring.gpg' created
gpg: requesting key 5862E31D from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp48ytqX/trustdb.gpg: trustdb created
gpg: key 5862E31D: public key "Launchpad PPA for Rowan" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

I hope this will help you like it helped me!

flattr this!

Older Entries