Showing posts with label configuration. Show all posts
Showing posts with label configuration. Show all posts

Wednesday, July 15, 2015

zabbix-server does not start - zbx_tcp_listen() fatal error

Zabbix 2.4.x
CentOS 6.6

Although I have rarely seen something like this but my deployment of Zabbix via Puppet caused a very strange issue where Zabbix service would not start

Error in logs
listener failed: zbx_tcp_listen() fatal error: unable to serve on any address [[-]:10051]

Service status and when trying to start
[root@abc-zabserver-b zabbix]# service zabbix-server status
zabbix_server is stopped
[root@abc-zabserver-b zabbix]# service zabbix-server start
Starting Zabbix server:                                    [  OK  ]
[root@abc-zabserver-b zabbix]# service zabbix-server status
zabbix_server is stopped

Process is running (sometimes shows multiple processes running)
[root@abc-zabserver-b zabbix]# ps afx | grep -i zabbix
 3852 pts/1    S+     0:00  |       \_ grep -i zabbix
 2150 ?        S      0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf

But service is still stopped
[root@abc-zabserver-b zabbix]# service zabbix-server status
zabbix_server is stopped

If I kill the process(es) then Zabbix service comes up fine.
Cause
When I was deploying Zabbix with Puppet I was using
ensure => installed
instead of
ensure => '2.4.1.-5.el6' (or some other specific version)

Basically my config file for Zabbix was still and older version and it didn't play too well with the new Zabbix that became available through the repos.

I ended up refreshing the config file.

Saturday, June 18, 2011

Change Swappiness

I installed CentOS on VirtualBox on my work laptop which has very poor specs. I gave it 512 MB RAM and a single core. Within about 20 minutes the VM started swapping and the whole laptop became extremely slow. I had been researching the problem and came across "swappiness".

I have changed this setting to zero (0) on this VM. I will test and report back.

What is swappiness and how to change it?

Friday, January 14, 2011

Installing and Configuring Squid on Fedora 14

Start with, as usual: yum install squid

The main configuration file is in /etc/squid/squid.conf

The default configuration should be okay for most scenarios.
However, here is how to configure:
Squid Configuration Basics

Use these links to configure reverse proxy on Squid:
Official Squid Reverse Proxy Guide
Visolve Squid Reverse Proxy Guide

Tuesday, January 11, 2011

Postfix + Dovecot + SSL/TLS

Ok so I was trying the next step. After getting Postfix+Dovecot working with plain text authentication. I wanted to try TLS. I saw these errors:

warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms
fatal: no SASL authentication mechanisms

Solutions is to yum install cyrus-sasl-plain

Here is the source

TLSv1 has deprecated SSLv3, and Dovecot seems to use it by default, but if that doesn't work then edit configuration files in /etc/dovecot/ directory.

Dovecot SSL Setup:
Dovecot SSL from Official Website
Here is another very useful HOWTO guide:
CentOS + Postfix + Dovecot + SASL + SSL

To check if SSL/TLS is being used:
openssl s_client -connect mail.platinumfactor.com:995
(Thanks to mick_laptop on #dovecot on Freenode for help in testing)

Monday, January 10, 2011

Postfix with Dovecot Configuration

Without making things too complicated, all I wanted was a running mail server which will send and receive email. I decided to use Dovecot for POP3 functionality. The install is simply yum install dovecot.

These are the 3 real lines in my /etc/dovecot/dovecot.conf

protocols = imap pop3 lmtp
listen = *
!include conf.d/*.conf

Go into /etc/dovecot/conf.d and edit 10-auth.conf
Change this line:
disable_plaintext_auth = no
This is because we are not using SSL yet.

Aside from this, proper trust and relay permissions need to be set in /etc/postfix/main.cf file
I made these changes:
mynetworks_style = class
mynetworks = 192.168.1.0/24, 127.0.0.0/8


NOTE: Mailbox type needs to be changed from mbox to Maildir/ in /etc/postfix/main.cf. This caused me a lot of heartache trying to get Dovecot to work!

Fiddling with Postfix

I am just reading up on Postfix.

I wanted to try exchanging some mail locally for test and tried to find the mail MUA, but couldn't. It is actually now called mailx (or nail) package, so yum install mailx should get it.

Trying to do nslookup and dig, but that wasn't installed. Search yielded that they are part of bind-utils package. Do a yum install bind-utils

Here is the output of my postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, www.$mydomain, ftp.$mydomain
mydomain = platinumfactor.com
myhostname = mail.platinumfactor.com
mynetworks = 192.168.1.0/24, 127.0.0.0/8
mynetworks_style = class
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.7.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.7.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550

Sunday, January 2, 2011

Logical Volume Manager Setup and Configuration

Here is a short summary of LVM configuration and setup.

Check to make sure you have LVM2:
vgscan --version

If vgscan complains about missing driver:
modprobe dm_mod

Create physical volumes:
pvcreate /dev/sda1
pvcreate /dev/sda2

Add the physical volumes to a volume group:
vgcreate VolGroup01 /dev/sda1 /dev/sdb1

To create logical volumes out of the volume group:
lvcreate -L <length> -n LogVol01 VolGroup01
ex: lvcreate -L 500M VolGroup01 -n LogVol01
ex: lvcreate -L 20G VolGroup01 -n LogVol01

Create a filesystem
mkfs -t ext3 /dev/VolGroup01/LogVol01

Mount the logical volume
mount /dev/VolGroup01/LogVol01 /mnt/debian

Extending Logical Volume

Unmount the Logical Volume
umount /dev/VolGroup01/LogVol01

If there is free space in the volume group:
lvextend -L +1G /dev/VolGroup01/LogVol01

If the volume group is full then add a disk/partition to it:
vgextend VolGroup01 /dev/sdc1
and then extend the logical volume:
lvextend -L +1G /dev/VolGroup01/LogVol01

Finally, extend the filesystem (any of the below 3 methods)
extendfs -F ext3 /dev/VolGroup01/LogVol01
resize2fs /dev/VolGroup01/LogVol01
resize2fs /dev/VolGroup01/LogVol01 500M

Mount the logical volume

mount /dev/VolGroup01/LogVol01 /mnt/debian

Wednesday, December 29, 2010

Fedora 14 Minimum Install Challenges

I decided to play with KVM since everyone is talking about it, and did a minimal install of Fedora 14 to use as hypervisor for KVM.

I was quite happy with how "minimal" this install really was, and during boot time only 10 or so services were started. However, I came across some problems, and this was a great opportunity to learn.

  • No Internet Connectivity
    • Did ifconfig and did not see eth0
    • Did ifconfig eth0 up, which didn't give an ip to the nic
    • Did dhclient eth0 (thanks to xand in #networking on Freenode). However, this will have to be done after every reboot and doesn't enable eth0 automatically at boot time
    • Type chkconfig network on
    • Edit /etc/sysconfig/network-scripts/ifcfg-eth0 (thank you nirik on #fedora on Freenode)
    • Since I did a "minimal" install, I do want to keep this small and that's why I didn't install NetworkManager or system-config-network utilities whereas they could've made my job a lot easier as far as configuring network goes.
  • No Nano
    • yum install nano
      • But this wasn't working for me before because I had no internet, so I edited the above file using vi. Another great learning opportunity.
      • Link to vi Cheat Sheet
  • Disable SELinux and IPTables
    • For temporary disable do "echo 0 >/selinux/enforce"
    • For permanent permissive or disable mode, edit /etc/selinux/config
    • Here is more information on changing SELinux settings
    • For my environment, I do not need iptables
      • chkconfig iptables off
      • chkconfig ip6tables off
        • Reboot