Hello. My name's Kate. I love Linux, WordPress - owned a WordPress dedicated design studio, a beginner entrepreneur who co-founded Asia software company. This is where i blog about Linux, WordPress, daily life and other interesting stuff
Status: -

You are on the Nineteen Labs weblog archives for June, 2007.

OUR ARCHIVES : June 2007

Setup IP in CentOS

Here is a way to setup IP in CentOS without Plesk

Let’s assume the network interface is eth0. Then there is a file /etc/sysconfig/network-scripts/ifcfg-eth0. This is an eth0 file configuration.

Use vi or other text editor

# vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
HWADDR=00:0C:29:C8:AA:7C
IPADDR=192.168.0.19
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet

Create Virtual Interface
Create the virtual interface eth0:0 with the IP address 192.168.0.20. Just create the file /etc/sysconfig/network-scripts/ifcfg-eth0:0 (leave out the HWADDR line as it is the same physical network card):

Use vi or other text editor

# vi /etc/sysconfig/network-scripts/ifcfg-eth0:0DEVICE=eth0:0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.20
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet

Restart the network
/etc/init.d/network restart

1 way to setup IP, 2 ways to change IP in Plesk

Setup/Add IP in Plesk is quite simple :
1. Sign On to Plesk Administration Site
2. Choose Server in System Menu (reside in left bar)
3. Choose IP Addresses in System
4. Choose New IP Addresses in IP Adresses management, plesk will show ‘IP Address form’ :
- leave out interface to eth0 (eth0 is a default. If there’s another interface/ethernet card in the system, choose other using a drop down menu)
- fill in an ip address and a subnet mask with to-be ip address and subnet mask
- choose an ip type, shared ip type means that one ip address can be used by one or more domain, exclusive means that one ip address can only be used by one domain
- leave out SSL certificate to a default certificate
- choose OK

Note : Plesk has a based IP already, which is set up in the installation process, do not change this, unless you need to change it. This additional IP can be use as a name server, or an alternative IP for a domain hosted in server

Change IP address :
Using Reconfigurator utility.

This utility allows you to change IPs in Plesk based and reconfigure domain settings with new IPs.

Plesk root directory usually in /usr/local/psa
$Plesk_ROOT_D/bin/reconfigurator.pl

The new IP addresses must NOT exist in Server > IP Addresses list in Plesk control panel before replacement, they may be added on system level only. If IP addresses do not exist in the system, the utility will add new IPs to the system as well.

Instruction :
1 Run the command to create a template file.
2. Edit the file to set an appropriate IP mapping
3. Run the command (number 1) once again.

Map File
The map file will contain the list of your current IP addresses of the
following format, e.g:

eth0:192.168.15.01 255.255.255.0 -> eth0:192.168.15.01 255.255.255.0

Edit the file with to-be IP addresses (please, note that to-be ones come on the right of an arrow sign),e g

eth0:192.168.15.01 255.255.255.0 -> eth0:your_ip_address_to_be 255.255.255.0

For example:

1. $PLESK_ROOT_D/bin/reconfigurator.pl ip_map.txt
2. Modify ip_map.txt file
3. $PLESK_ROOT_D/bin/reconfigurator.pl ip_map.txt

Manual IP Change
IP Setting is saved in /etc/sysconfig/network-scripts directory with ifcfg-eth0 as a configuration file for eth0 interface. This eth0 interface configuration has been set up at centos installation

Open using vi or other text editor
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

If ip address is setup using Plesk Administration site and using same eth0 as a interface (virtual interface), the configuration file will be saved in ifcfg-eth0:1. If base ip in ifcfg-eth0, second ip with same interface will be in ifcfg-eth0:1, and third or fourth, so on will be in ifcfg-eth0:x.

Open using vi or other text editor
# vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
# vi /etc/sysconfig/network-scripts/ifcfg-eth0:2

Change ip address and subnet mask with to-be ip address

Restart the Network
# /etc/init.d/network restart

Log On to Plesk Administration Site
1. Choose Server in System Menu (reside in left bar)
2. Choose IP Addresses in System
3. Choose Re-read IP in IP Addresses Management

Pownce, Twitter in Wordpress

I am using pownce and twitter as nanoblogs. I installed Twitter Plugin yesterday, in one of my page.
I read that pownce can be bridge in to Twitter using twitterfeed from one of pownce public notes. So i give it a try, by feeding a blog url, then bridge pownce into twitter using twitterfeed. I look into page where I put twitter plugin, we can see posts from pownce, twitter and the blog.

Twitter Plugin for Wordpress

I want Twitter in this site.I look for twitter plugin, i stumble upon Alex King’s Twitter Tools Plugin. It’s a great plugin, but Alex’s plugin required Wordpress 2.1 or higher, and my Wordpress isn’t in this requirement. Try it anyway, shows up an error.

Then I stumble upon David Wood’s Simple Twitter Plugin. Download, extract, upload, activate and manage plugin. I do what Read Me says, put a php code in Celophon Colophon Page, no Twitter posts, because plugin code, which is in php, doesn’t allowed inside WORDPRESS POST

Put php code in a sidebar, guess what? Twitter shows.
I want Twitter in a Celophon Page, not in a sidebar.

I guess somehow php code should be allowed inside WordPress post. James Van Lommel RunPHP Pluginis a plugin to put PHP code into a post and have it eval()’d.
Download, extract, upload, activate and manage plugin. Choose to run PHP code ? in Write Page, paste Simple Twitter php code, and save.

Step 3 (Last Step): Plesk 7.5 Reloaded Installation on CentOS 4.x

We’re running AutoInstaller from Plesk Site.
But before going through that phase, we should change redhat-release content in etc directory

[root@ ~] vi /etc/redhat-release

You’ll see in a redhat-release file, CentOS release 4.4 (Final). Change it to RedHat Enterprise Linux 4

RedHat Enterprise Linux 4
~
~
~
"/etc/redhat-release" 1L, 26C

Run AutoInstaller

Go to where Plesk AutoInstaller reside, e.g root (~) directory, then

# ./psa_redhat

Follow Plesk AutoInstaller instructions

  • Set plesk directory,for example /root/psa or /tmp/psa. Plesk directory is a place for keeping software packages, needed by installation.
  • Set plesk source to Plesk Site. I suggest Plesk Site as a source, since AutoInstaller need to download software packages. Except if you’re already download all of software packages, and if you get some problem in the end of installation, you can set to Local Source
  • Huge download around 100 MB. I suggest reliable Internet Connection
  • Choose whatever packages you need for your Plesk Administration in Package Selection. If you want base PSA/Centos Installation, you can desellect all. By Default, Plesk sellect all packages. I have problem with tomcat package, they need a gpg key, which i can’t find anywhere. So i don’t include tomcat package in my selections. Tomcat package isn’t essential, you can deselect them
  • Plesk will download software packages and install them for you. If you have a problem, look at installation logs
  • Try open Plesk Administrator Site in your browser. You will be asking for license agreement, then domain name, default ip, e-mail, and finally…Finished

Look more (almost) like Apple : Dock in Windows XP

One thing that Apple OS have, and Windows XP doesn’t have is Apple Dock
This is add ons. Use one of this as your dock :

I prefer Y’z Dock, although ObjectDock more stylish than Y’z Dock. I found Y’z Dock more ‘light’ for Windows XP (Y’z Dock uses low system resources). Y’z Dock has been banned by Apple few years a go(because Y’z Dock very much like Dock in Mac OSX), and development of Y’z Dock discontinued.

How to use it :

  • Install, drag and drop application in to the Dock

MyTop, mysql monitoring tools

MySQL, is one of important databases today. Most web server has it.
And you will want to monitor MySQL activity, to see what queries a server is currently processing as well as which user is executing them

MyTop is ‘top’ clone for mysql, a console-based (non-gui) tool for monitoring the threads and overall performance of a MySQL.

Installation (centOS/RHEL)
1. Look for gcc and gcc-c++ software packages in your system, this is essential for mytop.

# rpm -qa gcc
# rpm -qa gcc-c++

If�the packages found, go to step number 2. If the packages not found, please run this

# yum install gcc
# yum install gcc-c++

2. Install TermReadKey
go to usr/local/src directory

# cd /usr/local/src
# wget http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz
# tar -zxvf TermReadKey-2.30.tar.gz
# cd TermReadKey-2.30
# perl Makefile.PL
# make test
# make
# make install

3. Install MyTop
After TermReadKey installation, you can go back to usr/local/src directory

# wget http://freshmeat.net/redir/mytop/6933/url_tgz/mytop-1.6.tar.gz
# tar -zxvf mytop-1.6.tar.gz
# cd mytop-1.6
# perl Makefile.PL
# make test
# make
# make install

4 Configure MyTop
go to root (~) directory

# cd /root

make file .mytop, this is where MyTop Configuration saved

# vi .mytop

user=
pass=
host=
db=
delay=5
port=3306
socket=
batchmode=0
header=1
color=1
idle=1

Fill user, pass, host, db with your setting

5. Run MyTop

# mytop

More about MyTop
This explanation taken from MyTop Documentation.
You can read more there

The mytop display screen is really broken into two parts. The top 4 lines (header) contain summary information about your MySQL server.

MySQL on localhost (3.22.32) up 3+23:14:20 [23:54:52]
Queries Total: 617 Avg/Sec: 0.00 Now/Sec: 0.05 Slow: 0
Threads Total: 1 Active: 1 Cached: 0
Key Efficiency: 88.38% Bytes in: 0 Bytes out: 0

The first line identified the hostname of the server (localhost) and the version of MySQL it is running. The right had side shows the uptime of the MySQL server process in days+hours:minutes:seconds format (much like FreeBSD’s top) as well as the current time.

The second line displays the total number of queries the server has processed, the average number of queries per second, the real-time number of queries per second, and the number of slow queries.

The third line deals with threads. And the fourth line displays key buffer efficiency (how often keys are read from the buffer rather than disk) and the number of bytes that MySQL has sent and received.

The second part of the display lists as many threads as can fit on screen. By default they are sorted according to their idle time (least idle first). The display looks like:

Id User Host Dbase Time Cmd Query or State
– —- —- —– —- — ————–
61 jzawodn localhost music 0 Query show processlist

The thread id, username, host from which the user is connecting, database to which the user is connected, number of seconds of idle time, the command the thread is executing, and the query info are all displayed.

YUM Installation

UPDATE

I don’t have YUM in one of my server, and unfortunately that server in data center a few miles away. I can’t install from CD source, no yum rpm available in this server.

So I use this :
Atomic Rocket TurtleYUM

[root@ ~]wget http://3es.atomicrocketturtle.com/atomic/art/3ES/RPMS/yum-2.0.7-1.rhel3.art.noarch.rpm
[root@ ~]rpm -Uvh yum-2.0.7-1.rhel3.art.noarch.rpm

Or
Duke University Linux Project YUM

[root@ ~]wget http://linux.duke.edu/projects/yum/download/2.3/yum-2.3.2-1.noarch.rpm
[root@ ~]rpm �i yum-2.3.2-1.noarch.rpm

They are both having the same function, you can choose one of them to be installed on your system

This site powered : WordPress. Made with PC (sorry, MAC), Coffee and Tofu