How To: Getting Started with Amazon EC2

By | BSD, CentoOS, Debian, DragonFlyBSD, FreeBSD, Gentoo, Linux | 2 Comments

Así.. sin valium y sin nada:

Amazon EC2 is among the more potent items in Amazon's web services arsenal. You've probably heard of many of the other services such as S3 for storage and FPS for payments. EC2 is all about the "elastic compute cloud." In layman's terms, it's a server. In slightly less layman's terms, EC2 lets you easily run and manage many instances (like servers) and given the proper software and configurations, have a scalable platform for your web application, outsource resource-intensive tasks to EC2 or for whatever you would use a server farm.

There are three different sizes of EC2 instances you can summon and they're all probably more powerful than the server currently running your blog. Unless you're offloading video processing or something intense to EC2, the default small instance with its 1.7GB of RAM and 160GB disk should be more than fine. It's just nice to know that if for any reason I need a farm of machines each with 15GB of RAM, I can get that easily.

EC2 has been around for a while but has gained interest in the last few weeks as Amazon released an elastic IP feature. One of the larger EC2 issues deals with data persistence on instances. There are many limitations with EC2 that make it difficult to use unless you carefully build around the EC2 architecture and don't just assume that you can move your app to EC2 flawlessly. If an instance crashes and you run it again, you'll loose data and when the instance comes back up it will have a new IP, adding another hurdle with DNS issues. Fortunately, the elastic IP feature lets you assign a static IP address to your instances.

As the title of this article implies, this article is meant to be a beginner's look into tinkering with EC2. Just because you will be able to host a page on EC2 at the end of this article does not mean you should start using it as your only server. Many considerations need to be made when using EC2 to get around the data persistence issue. If your startup is looking to use EC2 as a scalable platform, fortunately there are many services that have already built stable systems on top of EC2, ready for your consumption: WeoCeo, Scalr and RightScale. Enough talk, shall we jump right in?

Note: Most of the information below (and more) is available in the EC2 API doc if you enjoy reading those things.

Read More

Analizando logs

By | CentoOS, Linux, Red Hat | No Comments

Un pequeño apunte para sacar datos de /var/log/secure

En este caso un listado de ataques a uno de los servidores.

root@elserver [~]#  cat /var/log/secure | grep Failed | cut -d: -f7 | cut -d' ' -f1 | sort| uniq -c

root@elserver [~]#  netstat -np | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | awk '{if ($1>2){print $0}}'

iptables TIP

By | CentoOS, Debian, Gentoo, Linux, Red Hat, SuSE, Ubuntu | One Comment

Necesitamos que un equipo tenga acceso a toda la red corporativa y a si mismo, pero no al 'resto del mundo'.

iptables -F
iptables -X
iptables -Z

# abrimos trafico a la red interna

iptables -A INPUT -s -j ACCEPT
iptables -A OUTPUT -s -j ACCEPT
iptables -A INPUT -s -j ACCEPT
iptables -A INPUT -s -j ACCEPT

iptables -A OUTPUT -d ! -j DROP

Instalación de Nagios / Centreon

By | CentoOS, Linux | 8 Comments

Nagios, aveces peca de ser poco usable a la hora de tener la usabilidad que debería tener amén de que podría implementar tambien toda una serie funcionalidades.

(Nagios) / (Nagios+Centreon)

Quick Install de Centron

Añadir repositorios: (https://www.solusan.com/actualizar-repositorios-centos.html)

En esta parte del post explicaré como agregar repositorios de software que podemos necesitar para la instalación que nos ocupa

Sistema Operativo:

  • Centos 5


  • Los colocamos en /etc/yum.repos.d
  • Damos rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

Enlace de cosulta: http://wiki.centos.org/Repositories


# yum install rrdtool rrdtool-perl net-snmp
# yum install php-mysql php-pear php-snmp php-gd libgd2 gd-devel libpng libpng-devel perl-config-IniFiles perl-Crypt-DES perl-Digest-HMAC perl-Digest-SHA1 perl-GD perl-IO-Socket-INET6 perl-Net-SNMP perl-rrdtool perl-Socket6
# yum install php-pear-DB php-pear-DB-DataObject php-pear-DB-DataObject-FormBuilder php-pear-MDB2 php-pear-Date php-pear-Numbers-Roman php-pear-Numbers-Words php-pear-HTML-Common php-pear-HTML-QuickForm php-pear-HTML-QuickForm-advmultiselect php-pear-HTML-Table php-pear-Archive-Tar php-pear-Auth-SASL php-pear-Console-Getopt php-pear-HTTP php-pear-Image-Canvas php-pear-Image-Color php-pear-Image-Graph php-pear-Image-GraphViz php-pear-Mail php-pear-Mail-Mime php-pear-Net-SMTP php-pear-Net-Socket php-pear-Net-Traceroute php-pear-Net-Ping php-pear-Validate php-pear-XML-RPC
# vi /etc/php.ini
memory_limit = 16M
# wget http://download.pear.php.net/package/HTML_QuickForm_advmultiselect-1.1.0.tgz
# tar zxvf HTML_QuickForm_advmultiselect-1.1.0.tgz
# cd HTML_QuickForm_advmultiselect-1.1.0
# cp advmultiselect.php /usr/share/pear/HTML/QuickForm

Read More

Actualizar repositorios CentOS

By | CentoOS, Linux | 9 Comments

Tip de como actualizar los repositorios en CentOS en este caso la Release 5:
Sistema Operativo:

  • Centos 5


  • dag
  • karan

Gracias @sharker