Category Archives: Ubuntu

CloudFlare Apache Module – Ubuntu 14.04 LTS

If we have CloudFlare active on the domain/subdomain that is protected with IP *validation* we need to install libapache2-mod-cloudflare, so Apache can see the real visitor IP, other way it will see the CloudFlare IP, and we wont be able to access the sub/domain.

authz-error

Step 1

echo 'deb http://pkg.cloudflare.com/ trusty main' | sudo tee /etc/apt/sources.list.d/cloudflare-main.list

Step 2

curl -C - https://pkg.cloudflare.com/pubkey.gpg | sudo apt-key add -

Step 3

sudo apt-get update

Step 4

grep ^Package: /var/lib/apt/lists/pkg.cloudflare.com_dists_trusty_main_binary-amd64_Packages

Step 5

sudo apt-get install libapache2-mod-cloudflare

Step 6

sudo service apache2 restart

 

scaleway-libapache2-mod-cloudflare

 

 

Patch and Protect Linux Glibc Getaddrinfo Stack-based Buffer Overflow Zero Day Vulnerability CVE-2015-7547 and CVE-2015-5229

A list of affected Linux distributions

  1. Red Hat Enterprise Linux Server 7
  2. Red Hat Enterprise Linux Server 6
  3. CentOS Linux 7
  4. CentOS Linux 6
  5. Debian Linux 6 squeeze
  6. Debian Linux 7 wheezy
  7. Debian Linux 8 jessie
  8. Ubuntu Linux 15.10
  9. Ubuntu Linux 14.04 LTS
  10. Ubuntu Linux 12.04 LTS
  11. SUSE Linux Enterprise Linux 11
  12. SUSE Linux Enterprise Linux 12
  13. openSUSE Leap 42.1

How to repair: http://www.cyberciti.biz/faq/linux-patch-cve-2015-7547-glibc-getaddrinfo-stack-based-buffer-overflow/

Ubuntu Landscape Dedicated Server system requirements

You can install Landscape Dedicated Server (LDS) on any server with a dual-core processor running at 2.0GHz or higher, at least 4GB of RAM, and 5GB of disk space. The operating system must be Ubuntu Server 12.04 LTS x86_64 or higher. You must also have PostgreSQL installed and network ports 80/tcp (http) and 443/tcp (https) open. You can optionally open port 22/tcp (ssh) as well for general server maintenance.

Source: https://landscape.canonical.com/static/doc/user-guide/ch03.html

Read more at https://askubuntu.com/questions/549809/how-do-i-install-landscape-for-personal-use/550625#550625

nginx – avoid 501 and 502 nginx errors

This are my settings on /etc/php5/fpm/pool.d/www.conf to avoid 501 and 502 nginx errors… on CentOS 7 location of www.conf is at /etc/php-fpm.d/.
The server has 16Gb RAM. This configuration is for a 8Gb RAM server so…

pm.max_children = 70
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 35
pm.max_requests = 500

Sources & more readings
http://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
http://jeremymarc.github.io/2013/04/22/nginx-and-php-fpm-for-performance/

ERROR 502 – connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream

 

2015/11/24 12:01:49 [error] 48055#0: *14094117 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client:

Once again, i’m struggling with nginx + php-fpm

sudo nano /etc/php5/fpm/pool.d/www.conf

search for

listen = /var/run/php5-fpm.sock

and replace it for

listen = 127.0.0.1:7777

On the *.conf files of sites-enabled (/etc/nginx/sites-enabled/)

replace (or comment)

fastcgi_pass unix:/var/run/php5-fpm.sock;

with

fastcgi_pass 127.0.0.1:7777;

More readings

Setting up my MOTD on a Ubuntu 14.04.3 LTS

Some of my servers have a fancy motd…
I like them… unfortunately my new server didn’t had it.

I had to run

apt-get install landscape-common
dpkg-reconfigure landscape-common

On dkpg-reconfigure I’v selected Run sysinfo on every login.

Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-63-generic x86_64)

* Documentation: https://help.ubuntu.com/
You have new mail.
Last login: Fri Oct 23 10:28:37 2015 from es2-84-XXX-XXX-XXX.netvisao.pt

System information as of Fri Oct 23 10:28:59 CEST 2015

System load: 0.06 Processes: 245
Usage of /: 81.9% of 411.33GB Users logged in: 1
Memory usage: 9% IP address for em0: 195.154.XXX.XXX
Swap usage: 0%

Graph this data and manage this system at:
https://landscape.canonical.com/
pjrfigueiredo@sd-48392:~$

To have the number of updates/security updates we need to run the following apt-get command….

sudo apt-get install update-notifier-common

This way we will see also

20 packages can be updated.
8 updates are security updates.

11354348_10153193542464733_1315224652_n

hpacucli on Ubuntu 14.04 trusty

Here is how

sudo -i
echo 'deb http://downloads.linux.hp.com/SDR/repo/mcp trusty/current non-free' > /etc/apt/sources.list.d/hp.list
echo 'deb http://downloads.linux.hp.com/SDR/repo/mcp precise/current non-free' >> /etc/apt/sources.list.d/hp.list
wget -q http://downloads.linux.hp.com/SDR/repo/mcp/GPG-KEY-mcp -O - | apt-key add -
aptitude update
aptitude --target-release precise install hpacucli