Watch log files on Linux server with Swatch 3.2.3

– Make sure to check CentOS, PHP-FPM, memcached and MYSQL posts.

– get a fresh package from Swatch project

wget ""
tar xfz swatch-3.2.3.tar.gz 
cd swatch-3.2.3
cpan -i Date::Format File::Tail
cpan -i Date::Manip Date::Calc
cpan -i Test::Inter Test::Pod Test::Pod::Coverage Module::Build
cp /root/.cpan/sources/authors/id/S/SB/SBECK/Date-Manip-* .
tar xfz Date-Manip-*.tar.gz
cd Date-Manip-*
perl Build.PL 
./Build install
cd ..
perl Makefile.PL
make install

– configure swatch

Configuring vsFTPd on CentOS with different port

Check Installing CentOS 6.2 on VMware post.

– make sure SELINUX is disabled and iptables is configured for FTP

– add ftp user

adduser ftpuser -g ftp -s /sbin/nologin -d /server
#set password
passwd ftpuser

– configuration, more info

Adding new users and admins to Linux server

Check Installing CentOS 6.2 on VMware post.

Using admin user avoids common mistakes done when logging as root, instead use sudo to run root commands.

mkdir /server

#adding web-server user www
adduser www -d /server -s /sbin/nologin

#adding admins group to use instead of root
groupadd admins
%admins ALL=(ALL)       NOPASSWD: ALL

#add new admin 
adduser admin -g admins
#set password
passwd admin

#add email for user admin
vi /etc/aliases
#rebuild data

Configure sendmail to accept emails only if “from”, “to” or specific field matches

you can exclude an email address or even a host that is spamming you using the access file located in your etc directory, the bad news is that it does not support regex or even wildcards.

Change WordPress page order

I am not sure why Page order is not working in WordPress, but this is a simple workaround to fix it

  • go to wordpress admin -write -write page -change ALL pages “Page Order” from the right down box.
  • open file “wp-includes\template-functions-post.php” in any text editor.
  • go to line 334 or search for “function wp_list_pages($args = ”) {“
  • insert this line after the searched line ” $args .= ‘&sort_column=menu_order’;”
  • save it and now your page should order fine.