Archives

All posts for the month May, 2011

I know this have been written about a billion times, now it’s 1 billion + 1.  This is more for a ref for me…

Grab latest apache/php.

1).  Compile apache

./configure –prefix=/usr/local/apache2 –enable-so –with-ssl –with-zlib

make; make install

Start apache and then stop apache.  Make sure its’ all golden..

2) php time

‘./configure’ ‘–prefix=/usr/local/php5’ ‘–with-apxs2=/usr/local/apache2/bin/apxs’ ‘–with-mysql’ ‘–with-pear’ ‘–with-openssl’ ‘–with-xml’ ‘–enable-bcmath’ ‘–enable-calendar’ ‘–with-curl’ ‘–enable-ftp’ ‘–with-gd’ ‘–enable-sockets’ ‘–enable-track-vars’ ‘–enable-versioning’ ‘–with-zlib’ ‘–enable-magic-quotes’ ‘–with-freetype’ ‘–enable-mbstring’ ‘–with-db4=/usr’ ‘–with-ldap=/usr’ ‘–with-libxml-dir=/usr’ ‘–with-snmp=/usr’ ‘–enable-soap’ ‘–enable-zip’ ‘–with-imap-ssl=/usr’ ‘–with-imap’ ‘–with-kerberos''--with-gettext=shared

Adding gettext, it’s needed for phpldapadmin.

Linux users that compile PHP --with-gettext=shared should include
extension=gettext.so

in your /etc/php.ini

Was interesting with imap and kerberos, as the linkers were getting confused between the 32bit and x64 libs which was causing issues with the libc-client.a lib.  Ended up installing the libc-client.a x64 version then just symlinking to the /usr/lib

ln -s /usr/lib64/libc-client.a /usr/lib/

After that it may error out one more time on the ./configure, just install pam-devel with that it will also install a bunch of more *devel stuff, do it.  Configure should finally finish..

make; make test

(takes a while…make test not necessary)

make install

 

3).. If you forget something in PHP and need to re-compile.   You re-run ;   make clean; re-run ./configure with all w/ options; make; make install.    Then just restart apache that should enable whatever you just compile in.

4).  cp php.ini-development  /usr/local/lib/php.ini

5).  vi httpd.conf  add

6). restart apache. that’s it. test via phpinfo.php

phpinfo.php
<?php
phpinfo();
?>

 

 

Our standard build = 30GB.  How do you expand the file system without losing data and/or the VM.

Our test

30GB standard VM

Need to increase /motr to 100GB

Before you start, verify that the new space can be seen.  Here is the un-modified fdisk.

Either reboot, or just enter this in.  This will rescan the disk to find the new space.

echo 1 > /sys/block/sda/device/rescan

 

 

#1  Start by creating a new primary with your new disk space, this also can be an extended

p = print

n = create new partition

w = write

t = type (8e = LVM)

Here’s the original without the new partition.

 

Add a new partition with the new space, we will create this on /dev/sda3.  n = create new partition, p = print, t = disk type

Now that it’s created we need to specify the partition type and switch that to Linux LVM.  Type = 8e for Linux LVM

 

Looks good.   Now we need to write this partition to disk using the w

 

 

run partprobe -s

which will re-scan the new partition table.  A reboot will do the samething, but why reboot?

 

Increase the physical layer

 

Increase the “system” volume. System = the volume name

 

Increase the Logical Volume

 

Finally increase the file system.

Note:  I had issues trying to use resize2fs on a physical host, as I was attempting to expand file system by adding a new disk to the system.  So try this as last step if that fails..

resize_reiserfs: On-line resizing finished successfully.

 

That’s it.

 

My co-worker Preston came up with this one.   Works pretty slick and probably will replace our old method of using the expect script.  Make sure you put an extra space between the 2nd $i and echo  so it doesn't show up in history.

 

for i in cat passtest`; do echo $i; ssh $i  ‘echo ‘newpasswd’ | passwd –stdin root’;done

 

where passtest is your list of hosts.

 

If you need to clear out the pagecache due to inactive memory not being released you can flush out the cache in RedHat5 manually.

The /proc/sys/vm/drop_caches, allows the pagecache and slabcache to be cleared on demand.

To free the pagecache:

To free dentries and inodes:

To free pagecache, dentries and inodes:

It is recommended that sync be run prior to passing the values to /proc/sys/vm/drop_caches. Enabling drop_caches can cause deadlock if the system is under heavy memory and I/O load. It is not recommended to use this feature on system experiencing heavy load.