Showing posts with label RHEL. Show all posts
Showing posts with label RHEL. Show all posts

Wednesday, March 14, 2007

RHEL 5 is released today

Tonight, I read a review by Linux Format , the best-selling Linux magazine in the UK. The review is done for the latest RHEL 5 (Redhat Enterprise 5) which is released today. Technology enhancements are welcomed, such as those in SELinux administration and full integration of Xen virtualization as expected from Fedora Core 6.  The review also included an Q/A interview with Nick Carr, general manager, RHEL.

More noteworthy is that, Redhat Inc., as a company, has revamped its support, marketing, customer relation plan, and its relationship with the open source community. As stated in the review, the company has realigned the whole company to work better with the open source community as well as their enterprise customers. 
  • The one page SLA
  • server/client flavor versus the traditional WS/ES/AS flavors for RHEL3 and RHEL4.

Tuesday, November 07, 2006

debugfs :: handy utility to debug an ext2 or ext3 file system

Today I am learning a useful utility program named 'debugfs'. It is part of e2fsprogs package, an essential package containing axillary programs for ext2 and ext3 file system under Linux.

For a regular file, 'debugfs' can help you find an inode by any data block the file or dir entry is using. Then you can turn around and ask for the name of the inode. This could be handy when some mysterious files causing df and du to disagree whether the filie system is full, or the file system is corrupted or can't mounted to be accessed as usual. More advanced file system features are available too.

# to find what inode is claiming a given data block
# debugfs -R "icheck 12345" /dev/hda1
debugfs 1.35 (28-Feb-2004) Block Inode number 12345 340

# to find the file name given the inode number
# debugfs -R "ncheck 49153" /dev/hda1 debugfs 1.35 (28-Feb-2004) Inode Pathname
49153 /usr/share/locale/ar/LC_MESSAGES/libbonobo-2.0.mo


# Print the location of the inode data structure
# debugfs -R "imap /boot/vmlinuz-2.6.9-42.0.2.EL" /dev/hda1 debugfs 1.35 (28-Feb-2004)
Inode 557516 is part of block group 34
located at block 1114128, offset 0x0580


# to dump the direntry (filespec, per man page)
debugfs -R "dump -p /boot/vmlinuz- 2.6.9-42.0.2.EL /tmp/vmlinuz_dumped" /dev/hda1
# md5sum /boot/vmlinuz-2.6.9-42.0.2.EL /tmp/vmlinuz_dumped
e5c536b539b5ffcaa03b22bd7fcc164a /boot/vmlinuz-2.6.9-42.0.2.EL e5c536b539b5ffcaa03b22bd7fcc164a /tmp/vmlinuz_dumped

# to get the contents of a file, assume the fs can't be mounted and accessed the usually way.
# debugfs -R "cat /etc/redhat-release" /dev/hda1
debugfs 1.35 (28-Feb-2004)
CentOS release 4.4 (Final)

Noteworthy is, for files under /selinux ( a pseudo fs), it can find inode number associated with a data block. However, it couldn't find the file name for the very inode number.
# debugfs -R "ncheck 8" /dev/hda1 debugfs 1.35 (28-Feb-2004)
Inode Pathname
8
# find / -inum 8
/selinux/relabel
# ls -id /selinux/relabel

8 /selinux/relabel
# debugfs -R "icheck 4567" /dev/hda1
debugfs 1.35 (28-Feb-2004) Block Inode number
4567 8

# / is on /dev/hda1
/dev/hda1 8127400 6738524 1306308 84% /

There are a lot of powerful (and dangerous) features such as
  • feature you can set or clear various file system features in the superblock
  • freeb to mark data blocks as unallocated vs. setb
  • freei to free the inode specified
  • clri to clear the contents of the inode
  • chroot to chroot to the directory
  • find_free_block
  • find_free_inode
  • init_filesys to create an ext2 file system
  • kill_file deallocate the file and its blocks. It doesn't remove any direntry to this inode. not ' rm' or 'unlink'.
  • logdump to dump the ext3 journal
  • modify_inode modify the contents of the inode structure
  • ls/mkdir/mknod/rm/rmdir
'debugfs' starts interactively by default, unless you have '-R' to request one-time use only. A session would be like below:
# debugfs
debugfs 1.35 (28-Feb-2004)

debugfs: open /dev/hda1
debugfs: icheck 12345
Block Inode number
12345 340

debugfs: ncheck 340
Inode Pathname
340 /usr/X11R6/lib/xscreensaver/mountain

debugfs: close

debugfs: quit

Saturday, October 21, 2006

step-by-step: how to host WordPress under Linux (FC5/RHEL4)

Why:
  • on Blogger: missing certain nice features ( static page support, import/export). Or,
  • on WordPress.com: don't like your own html get stripped off. Your little piggy-bank gets left empty since Google Adsense code get stripped or disabled. Or,
  • want your own professional domain name and such. Or,
  • simply love the experience of DIY and the freedom of customization
Assumptions & Prerequisites:
  • Fedora Core 5 stock installation (All should be applicable to CentOS 4 or RHEL 4 as well, unless the FC5 SELinux changes get in your way.)
    • apache (httpd package) installed.
    • php package installed.
    • mysql-server package installed.
  • The stable release (latest.tar.gz) has been downloaded from wordpress.org and extracted under /var/www/html
  • comfortable with MySQL and SQL commands.
  • starter's knowledge of how a blog works.
Steps to follow:
# set up MySQL access
This is to set up a MySQL database dedicated for WordPress and a user to access this database from the Apache/PHP combo. The schema and data for the database itself will be populated by install.php later. The names used below assume you want user 'wp_master' to have all access to a local database named 'wordpressDB'.
  • /etc/init.d/mysqld start
  • /usr/bin/mysqladmin -u root password 'mysqlAdminpassword'
  • /usr/bin/mysqladmin -u root -p create wordpressDB
  • mysql -Uroot -p mysql
    • insert into user (host, user, password) values ('localhost', 'wp_master', password('mastersecret'));
    • insert into db (host, db, user) values ('localhost', 'wordpressDB', 'wp_master');
      • the 'db' table entry should also grant the 'wp_master' user with most of the privileges to the 'wordpressDB' . So, I simply replaced the 'test' database entry therein, since I am lazy, plus I consider a wild-open test db a security risk.
      • update db set host='localhost',db='wordpressDB',user='wp_master' where host='%' and db='test';
    • commit;
    • restart mysqld by '/etc/init.d/mysqld restart'
# set up MySQL PHP extension support (Otherwise you may get this error, "Your PHP installation appears to be missing the MySQL which is required for WordPress. ")
  • yum -y install php-mysql
  • /etc/init.d/httpd restart
# to set up wp-config.php with your own set of credentials for WP to use to access MySQL
cd /var/www/html/wordpress && cp wp-config-sample.php wp-config.php && vi wp-config.php
# RTFM using your favorite browser

point to your browser to http://localhost/wordpress/readme.html

# initialize/populate your new WP database. Do record the 'admin' account information generated.
point to your browser to follow http://localhost/wordpress/wp-admin/install.php

# Now, time to verify. If it worked, you'd see the default 'hello world' post using the 'default' theme.
point to your browser to http://localhost/wordpress/index.php

# to customize the blog right away, click on 'edit' link inside the blog and log on with the 'admin' account

# about them themes:
Only two themes are bundled (classic/default). To add a theme, find ones you like and download from a trustworthy source.
  • wget http://downloads.wordpress.org/theme/pool.zip
  • cd /var/www/html/wordpress/wp-content/themes && unzip pool.zip
  • Now the new theme(s) would just show up if you go back to edit/presentation/themes
# Get them roamers home
  • import existing blogs and comments from Blogger and other top blog sites.
  • if new, register this new blog with technorati.com, weblogs.com
  • new or updated, brief your readers of the changes [advance notice would be appreciated too]

Sunday, August 20, 2006

fedora core 5 -- better SELinux policy

Tonight I created a virtual machine inside my vmware player, with 256M ram and 10G hard disk, to install Fedora Core 5 from the DVD Andy@redhat handed out at the Intel/Redhat breakfast seminar series. The installation wizard has some good selection menus for SELinux set-up.

This reminds me of what I read in FC5's release notes that the targeted policy in RHEL4 (or CentOS 4 or FC4) is now deprecated. Plus the integration of Zen and JBoss, FC5 now began to look like a larger bite. Ken @ worldspan is certified for RHL 8 and he said he will take RHCE once RHEL 5 is out. wonder if I should pair up with him to get my heart-thorn over with.

Saturday, August 19, 2006

Redhat/Intel breakfast : Linux para-virtualization on Intel dual core processor

This past Tuesday, I attended the breakfast seminar series of Linux Virtualization and Dual Core processors at Westin near I-285 and peachtree-dunwoody interaction. Once the Westin waitress followed me into the breakfast area and lifted several party tray covers, I instantly understood why the invitation email said 'hot breakfast'. The breakfast consists of hot scrambled eggs, steamed sausages, fried bacon, oven-warm bread, pancakes, and ice-chilled fresh orange juice. "Nice", many said.

Ken from WorldSpan sat next to me. He's a programmer turned systems administrator. He told me that the WorldSpan building at I-75 and I-285 I drive by everyday is the headquarters. Its data center is down at the airport and it used to be part of Delta. They have mostly mainframes with code written in the '60s, a few Solaris servers, and a few Linux servers.

The Intel speaker is OK. A few points I take home are:

* AMD has a very very small footprint in terms of market share. Based on the noise it generates in the media, I thought it is making strides.

* Intel's dual Core processors will come hard and heavy to the market in the coming
years.

* Intel led AMD in 20 of the 22 industry benchmark results.

Andy from Redhat presents the Xen in Fedora Core 5 (and the coming
RHEL 5, beta1 at the end of August). A charming Brit. Xen basically
allows Para-Virtualization, with which the guest OS is aware of the
fact that it is a guest and its kernel is also modified to expedite
its access to raw hardware, esp. CPU/memory. One thing it doesn't do
is the bandwidth allocation for guests.
Two cool features I like about Zen (or enhanced feature available via
RHN, Redhat Network, subscriptions) are:
* snapshot of a guest. such a snapshot can then be used to restore or replicate
* a guest can be migrated, alive, to another physical host, with
minimal downtime appreciable to the end users.

I got a FC5 DVD (good thing I didn't start my download a few days ago)
from a pile Andy put out. Ken and I recalled the fact that we used the
3.5" floppy diskettes to install Debian 0.92 in '96 onto a 486dx.