Wednesday, August 1, 2012

Create you own repo server CentOS/RedHat/Fedora


The reposync command provides a few major advantages over an rsync based approach:
reposync uses HTTP by default, so it is easier on firewalls you probably already have outbound ports 80/443 open  reposync can use multiple mirrors, as specified in the ‘mirrorlist’ directive. So there is no longer a dependency on a single server on the remote end to be up and running Lastly, and not technically an advantage of reposync itself, but there are significantly more HTTP mirrors than rsync ones, so my reposync scripts can play nicely and distribute the load over a larger number of servers.


On your local server, install reposync


yum install yum-utils -y


For CentOS /Redhat 


# reposync --gpgcheck -l --repoid=rhel-x86_64-server-5 --download_path=/repo-rpms


# cd /repo-rpms


createrepo


Then configure the repository on the client system want to update.


For Feodra



Next, tell reposync to pull down the content


# reposync -r f16-x86-64-release -p /repo-rpms/


Lastly, recreate the yum metadata.


# createrepo /repo-rpm/f16-x86_64-release/

Monday, July 30, 2012

Openmeetings installation Redhat/CentOS/Fedora


OpenMeetings is a free browser-based software that allows you to set up instantly a conference in the Web. You can use your microphone or webcam, share documents on a white board, share your screen or record meetings. It is available as hosted service or you download and install a package on your server with no limitations in usage or users.

Make sure the following firewall ports are open
1935 (RTMP), 8088 (RTMP-Over HTTP), 5080 (HTTP), 4445 (Desktop Sharing), 8443 (RTMP over SSL)


Install the rpmforge repo 32 bit repo

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Install the rpmforge repo 64 bit repo

 rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

All of the various dependancies need to be installed

yum install -y mysql mysql-server httpd php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy phpmyadmin freetype freetype-devel fontconfig fontconfig-devel java-1.6.0-openjdk-devel libtiff libtiff-devel libjpeg-devel libjpeg giflib giflib-devel libpaper libpaper-devel xml-commons-apis libpng libpng-devel libxml2 libxml2-devel fftw3 fftw3-devel cairo cairo-devel flac flac-devel wavpack wavpack-devel libsndfile libsndfile-devel libmad libmad-devel yasm-devel yasm gcc gcc-c++  ghostscript lame swftools ImageMagick ffmpeg sox openoffice.org-base openoffice.org-headless openoffice.org-writer openoffice.org-impress openoffice.org-calc openoffice.org-headless

Edit /etc/rc.local
/usr/lib/openoffice.org3/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &
or
/usr/lib64/openoffice.org3/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &

Download OpenMeetings package

cd /usr/src
wget http://code.google.com/p/openmeetings/downloads/detail?name=openmeetings_1_9_1_r4707.zip

unzip openmeetings_1_9_1_r4707.zip -d

cd /usr/src/om/webapps/openmeetings/conf
cp mysql_hibernate.cfg.xml hibernate.cfg.xml

Edit OpenMeetings config file /usr/src/om/webapps/openmeetings/conf/hibernate.cfg.xml,
add your mysql credentials (username and password).

openmeetings is the database address and name (you can create an empty database before the installation)

cd /usr/src/om
nohup ./red5.sh &

Start OpenOffice service

nohup /usr/lib/openoffice.org3/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &

or

nohup /usr/lib64/openoffice.org3/program/soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard &

To start install OpenMeetings, type in the following address
http://www.<yourdomain>.com:5080/openmeetings/install

Saturday, July 28, 2012

Turning off un-wanted services on Redhat/CentOS/Fedora


chkconfig atd  off
chkconfig auditd  off
chkconfig avahi-daemon  off
chkconfig bluetooth  off
chkconfig cgconfig  off
chkconfig cgred  off
chkconfig cups  off
chkconfig dc_client  off
chkconfig dc_server  off
chkconfig dnsmasq  off
chkconfig ebtables  off
chkconfig firstboot  off
chkconfig gpsd  off
chkconfig haldaemon  off
chkconfig ip6tables  off
chkconfig iptables   off
chkconfig irda  off
chkconfig iscsi  off
chkconfig iscsid  off
chkconfig ksm  off
chkconfig ksmtuned  off
chkconfig libvirt-guests  off
chkconfig libvirtd  off
chkconfig lvm2-monitor  off
chkconfig mdmonitor  off
chkconfig NetworkManager  off
chkconfig netconsole  off
chkconfig netfs  off
chkconfig nfs  off
chkconfig nfslock  off
chkconfig nmb  off
chkconfig ntpd  off
chkconfig ntpdate  off
chkconfig openct  off
chkconfig openvpn  off
chkconfig pcscd  off
chkconfig portreserve  off
chkconfig psacct  off
chkconfig rdisc  off
chkconfig restorecond  off
chkconfig rpcbind  off
chkconfig rpcgssd  off
chkconfig rpcidmapd  off
chkconfig rpcsvcgssd  off
chkconfig rsyslog  off
chkconfig saslauthd  off
chkconfig sendmail  off
chkconfig smb  off
chkconfig smolt  off
chkconfig snmpd  off
chkconfig speech-dispatcherd  off
chkconfig snmptrapd  off
chkconfig squid  off
chkconfig svnserve  off
chkconfig vboxdrv  off
chkconfig vboxweb-service  off
chkconfig wicd  off
chkconfig wpa_supplicant  off
chkconfig ypbind off
===========================================================

Following services for Apache and Mysql running on the same server.
chkconfig abrtd  on
chkconfig httpd  on
chkconfig network  on
chkconfig mysqld  on
chkconfig sshd  on
chkconfig udev-post  on
chkconfig xinetd on

Monday, July 16, 2012

How to track down a high server load RedHat/CentOS/Fedora/SuSe


Line 1 - General server information - Current time, uptime (since last restart of server), number of users logged on (other than yourself), and the load average for the last 1, 5, and 15 minutes
Line 2 - Tasks - Number of processes, number of actively running processes, sleeping process, stopped process, and zombie processes
Line 3 - CPU usage info (User, System, Nice, Idle, Waiting, Hardware Interrupts, Software Interrupts).  Just worry about Idle, user, system, and waiting.
Line 4 - Memory usage
Line 5 - Swap usage (used should be almost 0 if not 0)
Table header for process list (Process ID, User, Priority, Nice, Virtual Memory, Resident Size, Shared Size, , State, CPU, Memory, CPU Time used, Command)
The processes themselves



login as: root
Access denied
root@192.168.200.102's password:
Last login: Tue Jul  3 02:47:21 2012 from 192.168.200.1

[root@openstack ~]# top -b -i -n 20 >> ./server-load

[root@openstack ~]# cat server-load
top - 00:55:00 up 4 min,  3 users,  load average: 1.84, 1.09, 0.49
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  7.5%us, 20.0%sy,  0.0%ni, 58.7%id,  7.0%wa,  6.1%hi,  0.7%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23112k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203320k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2908 1020  796 R  3.7  0.1   0:00.06 top


top - 00:55:03 up 4 min,  3 users,  load average: 1.84, 1.09, 0.49
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.0%us,  8.9%sy,  0.0%ni, 86.8%id,  0.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23112k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203336k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.08 top


top - 00:55:06 up 4 min,  3 users,  load average: 1.85, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  8.7%sy,  0.0%ni, 84.7%id,  3.3%wa,  2.7%hi,  0.0%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23120k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203328k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.10 top


top - 00:55:09 up 4 min,  3 users,  load average: 1.85, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  9.6%sy,  0.0%ni, 86.0%id,  0.0%wa,  3.3%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23120k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203336k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.12 top


top - 00:55:12 up 4 min,  3 users,  load average: 1.79, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.3%us,  9.9%sy,  0.0%ni, 80.9%id,  3.3%wa,  3.3%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23128k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203328k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  1.0  0.1   0:00.15 top


top - 00:55:15 up 4 min,  3 users,  load average: 1.72, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  9.3%sy,  0.0%ni, 86.0%id,  0.0%wa,  3.7%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23128k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203336k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.17 top


top - 00:55:18 up 4 min,  3 users,  load average: 1.72, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  9.0%sy,  0.0%ni, 86.0%id,  1.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23136k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203336k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.19 top


top - 00:55:21 up 4 min,  3 users,  load average: 1.66, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.0%us,  8.6%sy,  0.0%ni, 87.1%id,  0.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23136k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203344k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  1.0  0.1   0:00.22 top


top - 00:55:24 up 4 min,  3 users,  load average: 1.66, 1.10, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  9.3%sy,  0.0%ni, 85.7%id,  1.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23144k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203348k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.24 top


top - 00:55:27 up 4 min,  3 users,  load average: 1.61, 1.10, 0.51
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  8.6%sy,  0.0%ni, 87.5%id,  0.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23144k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203348k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.26 top


top - 00:55:30 up 5 min,  3 users,  load average: 1.48, 1.08, 0.50
Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.0%us,  8.9%sy,  0.0%ni, 85.5%id,  1.7%wa,  2.6%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488776k used,   539192k free,    23152k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203348k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  1.0  0.1   0:00.29 top


top - 00:55:33 up 5 min,  3 users,  load average: 1.48, 1.08, 0.50
Tasks: 119 total,   1 running, 118 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  9.6%sy,  0.0%ni, 86.8%id,  0.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488744k used,   539224k free,    23152k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203348k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.31 top


top - 00:55:36 up 5 min,  3 users,  load average: 1.44, 1.08, 0.51
Tasks: 120 total,   1 running, 119 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  8.7%sy,  0.0%ni, 86.0%id,  1.7%wa,  3.0%hi,  0.0%si,  0.0%st
Mem:   1027968k total,   488744k used,   539224k free,    23160k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203340k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  0.7  0.1   0:00.33 top


top - 00:55:40 up 5 min,  3 users,  load average: 1.44, 1.08, 0.51
Tasks: 120 total,   1 running, 119 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7%us,  9.6%sy,  0.0%ni, 86.5%id,  0.0%wa,  3.0%hi,  0.3%si,  0.0%st
Mem:   1027968k total,   488744k used,   539224k free,    23160k buffers
Swap:  2064380k total,        0k used,  2064380k free,   203348k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1337 root      20   0  2884 1040  812 R  1.0  0.1   0:00.36 top

[root@openstack ~]#