Wednesday, June 27, 2012

Fixing libdbus in 64 bit RPM based linux (Centos, SL, Fedora)


Issue affects Firefox, Thunderbird, gEdit etc.
You will see an error:

error while loading shared libraries: libdbus-1.so.3: cannot open shared object file: No such file or directory

most likly you have a 32 bit version of dbus libraries installed.
To fix that you need to install 64 version as well:

yum install dbus-libs.x86_64

Provided by: ForthScale systems, Cloud experts

Tuesday, June 26, 2012

Instalation of Nomachine NX server or VNC server on Centos 5

Both tools are great to enable external GUI remote access on Linux.

To install NX Free server:
Note. Installation of NX Server requires installation of all three packages: client, node and server due to tools and libraries dependencies.
Download the packages from Nomachine:
wget http://64.34.161.181/download/3.5.0/Linux/nxclient-3.5.0-7.x86_64.rpm
wget http://64.34.161.181/download/3.5.0/Linux/nxnode-3.5.0-9.x86_64.rpm
wget http://64.34.161.181/download/3.5.0/Linux/FE/nxserver-3.5.0-11.x86_64.rpm


Install the packages:
rpm -i nxclient-3.5.0-7.x86_64.rpm
rpm -i nxnode-3.5.0-9.x86_64.rpm
rpm -i nxserver-3.5.0-11.x86_64.rpm


VNC server installation:

yum install vnc-server
yum install xorg*
(you need to install those for VNC fonts)

Provided by: ForthScale systems, Cloud experts

Adding KDE Environment to Centos 5

List installation packs on your CentOS 5 machine:
yum grouplist

Install KDE
yum groupinstall "KDE (K Desktop Environment)"

Now you might want to enable GUI remote access with either:
VNC server or Nomachine NX.

Provided by: Forthscale systems, Cloud experts

Thursday, June 21, 2012

adding support for TCP socket proxy with Nginx


Install needed prerequisites:

apt-get install build-essential checkinstall
apt-get build-dep nginx
apt-get source nginx


Check out TCP sockets patch for nginx from git repository:

git clone  https://github.com/yaoweibin/nginx_tcp_proxy_module.git


Patch your nginx source code:

cd nginx-1.1.19/
patch -p1 < ../nginx_tcp_proxy_module/tcp.patch

Now configure and build a new package:

./configure \
--add-module=../nginx_tcp_proxy_module/  \
--conf-path=/etc/nginx/nginx.conf  \
--error-log-path=/var/log/nginx/error.log  \
--pid-path=/var/run/nginx.pid  \
--lock-path=/var/lock/nginx.lock  \
--http-log-path=/var/log/nginx/access.log  \
--with-http_dav_module  \
--http-client-body-temp-path=/var/lib/nginx/body  \
--with-http_ssl_module  \
--http-proxy-temp-path=/var/lib/nginx/proxy  \
--with-http_stub_status_module  \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi  \
--with-debug  \
 --with-http_flv_module \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx 


make

you will end with a package for your CPU architecture similar to:

/root/nginx-1.1.19/nginx_1.1.19-1_amd64.deb





Force install it:

dpkg -i --force-all /root/nginx-1.1.19/nginx_1.1.19-1_amd64.deb

Provided by: Forthscale, Cloud experts

Friday, June 15, 2012

Fixing SSH Daemon - Authentication refused: bad ownership or modes for directory

Then you are unable to connect to your ssh server with your PEM (or PPK) key with connection refused message check the /var/log/auth.log file.
If you see something similar to:
sshd: Authentication refused: bad ownership or modes for directory /Your/Home/Path
You have a home directory permission problem.
change to that user if not already one and execute:
chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys 
It will restore your permissions and you should be able to connect.

 Provided by: SiQ systems, Cloud experts

Wednesday, June 06, 2012

Couple of simple steps to debug munin plugins
First check if munin recognize the plugin.
Execute munin plugin in regular mode:
munin-run plugin_name
you will get output in format of:
some.value XX

then execute munin plugin in configuration mode:
munin-run plugin_name config

you will get output in format of:

graph_title Great Plugin
graph_args --upper-limit 100 -l 0
graph_vlabel %
graph_category some_category
graph_info This is the best munin plugin ever.
something.label LABEL

If you have any problems they can be related to the plugin having a permission problem.

Next step is to test the plugin connection via port 4949
Run a telnet on munin node port 4949

telnet munin-node.example.com 4949

You will get output in format of:

Trying munin-node.example.com...
Connected to munin-node.example.com.
Escape character is '^]'.
# munin node at munin-node.example.com

then type in console:

fetch plugin_name
or
fetch plugin_name config

It will output something similar to munin-run.

Then plugin works with munin-run command but not through telnet execution, you  most likely to have a local PATH problem. Tip: Set env.PATH for the plugin in the plugin's environment file.


Provided by: SiQ systems, Cloud experts

Wednesday, May 09, 2012

List open ports and listening services in Linux


To list open network ports (sockets) and the processes that run them on any Linux distribution use netstat. You might need to install it via yum / apt-get.
Syntax:
netstat -lnptu

Powered by 123ContactForm | Report abuse


Provided by: SiQ systems, Cloud experts

Sunday, February 19, 2012

Amazon AWS EC2 storage types


You can connect different storage types to Amazon EC2 instances, two of them provided naively by Amazon platform and the rest are either provided by external sources or tweaks.  In any EC2 instance (except micro) you have instance storage included in a package. You can also use elastic block storage (EBS) and have an option connecting different 3rd party storage over the network.
 
Instance storage is a fast non-persistent storage provided by Amazon. It means it will revert to it`s original state after any system shutdown, erasing any changes you have applied to the file-system. It is very useful for running “dumb” servers that do not store data locally or as an additional storage for temporary files.
 
Elastic block storage (EBS) is a persistent storage provided by Amazon. All and any data stored on it is available after instance shutdown and can be manipulated with on device level. For example you can detach an EBS volume from one instance and attach it to another. However EBS can not be attached to more then once instance at the same time.
 
Using S3 as a file system. S3 is a storage infrastructure provided by Amazon as a service, it is not a part of EC2 (Elastic cloud) but can be used to store and retrieve any amount of data from anywhere at any time. Because S3 infrastructure is fully managed and scaled by Amazon it is very useful for large scale web projects, backup media and large volume data transfers. Using S3 as a file system is done via FUSE in Linux or as a mapped network drive in MS Windows. We are providing a tutorial on Linux implementation of S3 as a file system .
 
There are also few companies out there providing iSCSI storage arrays for AWS, one of them is Zadara storage, company providing Virtual Private Storage Arrays and currently in beta stage. iSCSI as any other network attached storage systems will incorporate persistence and availability of EBS at much faster speed.

Sunday, February 12, 2012

Setting Filezilla Server on Amazon EC2 instance with passive ftp


If you want to set Filezilla  ftp server to handle passive connections on your AWS EC2 instances, you should do the following.

Select non used TCP ports, for example 9024-9048 range

Configure firewalls:

In your AWS EC2 security group, allow the incoming connections on chosen ports:

tcp port 20
tcp port 21
tcp port 9024-9048

If using Windows firewall  on you instance, allow connections on same ports.

Now configure Filezilla to use specific port range on Passive connections:

Open Filezilla management console.

Got to: Edit > Settings > Passive Mode Settings

'External Server IP Address for passive mode transfers'

If you use AWS Elastic IP, enter it in "Use the following IP",
if not - use Filezilla provided web service with "Retrieve external IP address from" option.

Check 'Don't use external IP for local connections'

Check 'Use custom port range'

Enter chosen values (in our example) 9024 - 9048 for custom port range.

Powered by 123ContactForm | Report abuse


Provided by:SiQ systems, Cloud experts

Wednesday, January 25, 2012

Adding global DNS servers

Sometimes you need to preconfigure your servers for dns resolution and you are not sure what local DNS addresses will be or just to use backup dns servers for resolution.
Here is small list of globally accessible DNS servers:

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 210.80.60.1
nameserver 210.80.60.2
nameserver 208.67.222.222
nameserver 208.67.220.220

Tuesday, January 24, 2012

NTP servers for Israel

For Israeli NTP servers you can use: il.pool.ntp.org

Since there are not enough servers in this zone, we recommend you buck up by use the Asia zone (asia.pool.ntp.org):

server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org

Provided by:SiQ systems, Cloud experts

Monday, October 24, 2011

allowing public access to amazon s3 bucket

You might need to give public access to bucket contents, for example if you use the bucket to load images for your site. Simple GUI option supplied by Amazon only gives access for a specific files but if you need a whole bucket, you have to use policy.

To edit policy, in GUI go to
'Bucket => Properties => Add Bucket Policy'

And add for example (just change yourbucketname with the name of your bucket:
{
    "Version": "2011-10-24",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::yourbucketname/*"
        }
    ]
}
save it and policy is applied.

Provided by:SiQ systems, Cloud experts

Monday, May 23, 2011

Upgrading PHP in CentOS 5

CentOS 5.x comes with PHP 5.1, this version is outdated and you probably would want to upgrade it. I used Atomic repository.
You can add it by running following command:
wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
Now you can update PHP:
yum update php
yum update php-mcrypt
(you might also need to update mysql)
Verify version of running PHP:
php -v
And that all modules working as order:
php -m
Restart Apache, you are all set.

Provided by:SiQ systems, Cloud experts

Sunday, May 22, 2011

"SQL Error: 13: Can't create/write to file" on other then /tmp directories (apparmor)

If you get SQL Error: 13 after changing tmpdir parameter in you my.cnf first check permissions in a new directory. If permissions are correct you might be having an issue with AppArmor. AppArmor is a GNU security module for the Linux kernel and it might prevent MySQL from writing to the new directory.
Run: aa-status
To verify if it`s on. If so you will get something like:
profiles are loaded
profiles are in enforce mode
Edit this file:
/etc/apparmor.d/usr.sbin.mysqld
and append your new temp directory in the end.
####
/usr/sbin/mysqld {
...
/new_tmp/ r,
/new_tmp/* rw,
}
Reload AppArmor with:
/etc/init.d/apparmor reload
Thats it.

Thursday, April 07, 2011

How to update an auto scale launch configuration in Amazon EC

In order to update existing auto scale launch configuration in Amazon EC you need to create a new launch configuration using as-create-launch-config and then assign it to launch configuration using as-update-auto-scaling-group


Provided by:SiQ systems, Cloud experts

Powered by 123ContactForm | Report abuse

Mounting S3 bucket as a file system on Linux (Ubuntu)

In order to mount S3 bucket on Linux you need to install ssh file system (FUSE) libraries first.
Install: aptitude install build-essential libcurl4-openssl-dev libxml2-dev libfuse-dev comerr-dev libfuse2 libidn11-dev libkadm55 libkrb5-dev libldap2-dev libselinux1-dev libsepol1-dev pkg-config fuse-utils sshfs
Follow the instantiations in S3fs WIKI:
It was using http download, not SVN.
Create a mount point for the new file system (ex. mkdir /mnt/s3)
Mount the file system:
ex.: s3fs tmpname -o use_cache=/tmp -o allow_other /mnt/s3
this mount comes with option of using a tmp as a cache for S3 content, you can clean that cache as you feel fit.


You can also add your bucket to /etc/fstab

s3fs#mybucket /mnt/s3 fuse allow_other,url=https://s3.amazonaws.com 0 0

Update for mounting S3 bucket on CentOS 5.5 and other old distros.
CentOS 5.5 comes with old FUSE version 2.7.4 as latest in it`s repository.
You need to manually compile version 2.8.4 befor you can use S3fs.

Remove old FUSE
yum remove fuse fuse* fuse-devel

Install needed libraries:
yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap

Download new FUSE from the Sourceforge:
wget "https://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz?r=&ts=1299709935&use_mirror=cdnetworks-us-1"

Untar and compile:

tar -xzvf fuse-2.8.4.tar.gz
cd fuse-2.8.4
./configure --prefix=/usr

make; make install


Configure FUSE in the system:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
ldconfig
modprobe fuse


Confirm that 2.8.4 is the version of FUSE displayed :
pkg-config --modversion fuse

Proceed with regular S3FS installation.

Have questions? Just contact us right away and we will be happy to assist

Forthscale is an AWS solution provider

Tuesday, January 04, 2011

Clearos, OpenVPN and mutiwan issue

Just had some problems running OpenVPN in mutiwan mode on ClearOS 5.2 SP1.
Sometime connection got dropped down and user could not reconnect. Problem was solved then i disabled on of the multiwan NICs. What fixed the problem was setting OpenVPN to work in TCP mode instead of UDP. I guess packets were sent using wrong NIC on UDP based connections.
Edit /etc/openvpn/clients.conf
and set "proto tcp"

Provided by:SiQ systems, Cloud experts

Tuesday, July 06, 2010

Setting DNS server on Amazon EC2

Setting up bind9 DNS server on Amazon EC2 today tough me that Amazon`s built in service definition in security group only includes TCP. be sure to open UDP port 53 as well for your server to function properly.

Provided by:SiQ systems, Cloud experts

Sunday, May 24, 2009

Searching for a pattern string under a directory

In order to search for a pattern string in all files under a specific directory you can use following command:
find $dir -exec grep $pattern {} \; -print
just replace $dir with the directory you want to start searching in and $patter with patter you are searching for.
for example:
find /etc -exec grep support {} \; -print

Saturday, May 09, 2009

changing editor in ubuntu linux

To permanently change editor in Linux do following:
edit your shell configuration file,
for example, bash configuration file is ~/.bashrc
To set editor as VI:
export VISUAL=vi
or to set nano:
export VISUAL=nano
to start it run:
source ~/.bashrc

2026. What I Actually Do Now

It’s been over 20 years of on-and-off dumping into this blog. 27 and going years in tech, more than 10 years around AI, going back to Heili ...