Upgrading MySQL 4 to MySQL 5

September 27th, 2007

Login to WHM as root and go to tweak settings. Under the Myql Section click version 5.0. Login to the server through shell and run

/scripts/mysqlup

Once this is completed, make sure mysql 5 has started, run

mysql

If it fails to connect run

/etc/init.d/mysql start

If it fails to start edit the /etc/my.cnf and commend out the line Basedir=/var/lib/mysql and then start mysql

Once you have mysql 5 fully started you must recompiled php to work with the new mysql errors. You can either do this from source or from easyapache whichever you are more comfortable with. If you choose easyapache make sure you select option #7 from the easy apache menu and you do not need to make any changes.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

PHP Suexec ForceType

September 27th, 2007

If you are trying to use the ForceType directive in your .htaccess files with PHPsuexec, it will fail. To work around this, simply use SetHandler instead of ForceType.
example:

<Files r>
SetHandler application/x-httpd-php
</Files>

or

SetHandler application/x-httpd-php

The first one listed will cause files named “r” to be executed as PHP scripts, same as if it is named r.php basically. The 2nd example will parse every file through php.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

Ruby on Rails installations

September 27th, 2007

Please only use this on dedicated servers

http://wiki.rubyonrails.org/rails/pages/HowtoInstallAndRunRubyOnRailsOnCpanel

Install Ruby:
(You can grab the latest source package from http://ruby-lang.org/en/20020102.html)

$ cd /usr/local/src
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz
$ tar -xvzf ruby-1.8.4.tar.gz
$ cd ruby-1.8.4
$ ./configure && make && make install

Next Ruby Gems:
(Latest version and localized mirrors here http://rubyforge.org/frs/?group_id=126 )

$ cd /usr/local/src
$ wget rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
$ tar -xvzf rubygems-0.9.0.tgz
$ cd rubygems-0.9.0
$ ruby setup.rb

Once Gems are installed its a whirl to install Rails:

$ gem install rails –include-dependencies

Now for FastCGI? and getting it to play nicely with Apache.

Install FastCGI?:
(‘Sourced’ from http://fastcgi.com/dist/)

$ cd /usr/local/src
$ wget fastcgi.com/dist/fcgi-2.4.0.tar.gz
$ tar -xvzf fcgi-2.4.0.tar.gz
$ cd fcgi-2.4.0
$ ./configure && make && make install

And mod_fastcgi for Apache 1.3+
I installed mod_fastcgi as a DSO.
Because cPanel uses EasyApache the location of apxs is different so these instructions deviate somewhat from the INSTALL docs. (ymmv!)

$ cd /usr/local/src
$ wget fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz
$ tar -xvzf mod_fastcgi-2.4.2.tar.gz
$ cd mod_fastcgi-2.4.2
$ /usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c
$ /usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so

Now for Ruby fcgi:
You could gem install fcgi but that currently installs version 0.8.5, so I’d reccomend compiling 0.8.6 from source as below. 0.8.6.1 is now in the gem repository.

$ gem install fcgi

You now need to edit your Apache config file.
By default its (/usr/local/apache/conf/httpd.conf)

Add these lines: (tweak the last line accordingly, comments are welcome)

LoadModule fastcgi_module libexec/mod_fastcgi.so

<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
</IfModule>
FastCgiConfig -maxClassProcesses 20 -maxProcesses 20 -minProcesses 1 -processSlack 1 -initial-env RAILS_ENV=production -idle-timeout 120

Make sure /tmp/fcgi_ipc/ is writable and executable by Apache
(Apache runs as ‘nobody’ on my Machine, this may differ for you)

$ mkdir -p /tmp/fcgi_ipc
$ chown nobody.nobody /tmp/fcgi_ipc -R
$ chmod 755 /tmp/fcgi_ipc -R

Now restart Apache:

$ /etc/rc.d/init.d/httpd restart

Ruby on Rails should now be successfully installed.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

Setting Private Nameservers for reseller account

September 27th, 2007

Go to…

*WHM>Reseller Center
*Highlight reseller username
*Select edit/Privlidges and nameservers
*Scroll to bottom of the page for the Nameserver entry and add the private name servers.
*Make sure that A records are setup for the private name servers in the zone file as well.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt

jailshell virtfs

September 27th, 2007

NEVER DELETE ANY FILES FROM /home/virtfs/

/home/virtfs is used to chroot the user into jailed shell. Cpanel will hard link files into this directory so deleting files in /home/virtfs will also delete the files on the server in the actual location. (example: rm /home/virtfs/user/etc/exim.pl will delete /etc/exim.pl)

If a user is reporting double the quota and it is from /home/virtfs then we need to umount or kill and hanging jailshell process. To do this run

ps aufx |grep user |grep jailshell

If there are no jailshell processes then run

cat /proc/mount

It will show,
/dev/root /home/virtfs/user/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/sbin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/share ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/bin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/man ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/X11R6 ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/kerberos ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/libexec ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/bin ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/share ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/Zend ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/include ext3 rw,data=ordered,usrquota 0 0
/dev/sda2 /home/virtfs/user/usr/local/lib ext3 rw,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/spool ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/lib ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/run ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda3 /home/virtfs/user/var/log ext3 rw,noatime,nodiratime,data=ordered,usrquota 0 0
/dev/sda6 /home/virtfs/user/tmp ext3 rw,nosuid,nodev,noexec,data=ordered 0 0
/dev/root /home/virtfs/userbin ext3 rw,data=ordered,usrquota 0 0

You will need to unmount each of these by running
umount /home/virtfs/user/tmp and so on

You can also run

for i in `cat /proc/mounts |grep virtfs |grep user |awk ‘{print$2}’`; do umount $i; done

Make sure to replace user with the cpanel username in the above command. This will then clear up the files in /home/virtfs and the quota should return to normal.

Share this site! Click on the a link below: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Slashdot
  • De.lirio.us
  • Technorati
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • blogmarks
  • YahooMyWeb
  • BlogMemes
  • Book.mark.hu
  • Bumpzee
  • Fleck
  • Furl
  • IndianPad
  • Netscape
  • Reddit
  • Spurl
  • blogtercimlap
  • Gwar
  • connotea
  • DotNetKicks
  • Fark
  • SphereIt