July 29th, 2009
Please see https://www.isc.org/node/474 for details!
Before you start!
Redhat users will find that bind is already updated via running up2date
These versions are big fixed - see http://rhn.redhat.com/errata/RHSA-2009-1180.html :
bind-utils-9.2.4-30.el4_8.4
bind-libs-9.2.4-30.el4_8.4
bind-devel-9.2.4-30.el4_8.4
ypbind-1.17.2-13
bind-9.2.4-30.el4_8.4
# rpm -qa | grep ‘bind’
will show you what versions you are running.
If you are running any other package management then running apt-get update or yum update should sort you out as these fixes have been push. Always make sure you have a backup of your named working directory though!
Step 1: Find out what version of bind you are running
# named -v
If you are running anything that isn’t one of these versions : 9.4.3-P3, 9.5.1-P3 or 9.6.1-P1 then you need to upgrade. I found all my cpanel/WHM boxes were running BIND 9.2.4
Step 2: Make a backup of your working directories
# mkdir /backup/bind/
# cd /backup/bind
# cp -R /var/named zones
# cp /etc/named.conf named.conf
If all goes to plan then you won’t need this backup - but you can never be too careful!
Step3 : Download a new version of bind
# mkdir /backup/bind/bind-9.4.3-P3
# cd /backup/bind/bind-9.4.3-P3
# wget http://ftp.isc.org/isc/bind9/9.4.3-P3/bind-9.4.3-P3.tar.gz
# tar zxvf bind-9.4.3-P3.tar.gz
Step 4: Compile and install new Bind
# cd bind-9.4.3-P3
# ./configure
# make
# make install
Step5: Make sure your version is now updated
# named -v
Tags: bind, centos, cPanel, CVE-2009-0696, redhat, VU#725188, whm
Posted in Uncategorized | 4 Comments »
May 27th, 2009
We primarily use SFTP for file transfers, and we encourage our customers to do the same.
One problem we’ve been having is that the default file permissions when files are uploaded in SFTP don’t match the umask set for that user, or the umask set on the server. This causes many php scripts to Internal Server Error. Files uploaded via normal FTP are fine, because the FTP service sets the permissions on the files with a umask configuration in the config file.
My basic solution to this, is to create a script that sits between SSH and SFTP and changes the umask as the user logs in:
> nano /opt/sftp-server.sh
#!/bin/bash
umask 022
/usr/libexec/openssh/sftp-server
Then edit the ssh_d config file (/etc/ssh/sshd_config) and edit the sftp SubSystem line to point to your script:
Subsystem sftp /opt/sftp-server.sh
Make sure you’ve set the permissions correctly on your new script:
> chmod 755 /opt/sftp-server.sh
Now files uploaded via SFTP should have the permissions 755!
Tags: cPanel, Linux, sftp, umask
Posted in Linux | No Comments »
May 26th, 2009
Today I was updating a rails application, and editing some databases to convert them to mysql.
After changing my rails config file I started getting this error :
> db:test:prepare
(in /Users/tom/workspace/solitaire)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
Strange, everything was working correctly on the other mysql databases and projects on my system. Anyway, I did as instructed :
> sudo gem install mysql
Password:
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… no
checking for mysql_query() in -lmysqlclient… no
Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
I did some searching and found a few older articles on the problem :
http://blog.wearesakuzaku.com/installing-the-mysql-ruby-gem-on-os-x/
I tried all of the suggested solutions on this page, and none of them seemed to make any difference, so I did some more searching, and I found that I had a 64bit version of mysql installed, and the rails gem didn’t seem to like this. So I downloaded and installed the latest 32bit version of mysql :
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.81-osx10.5-x86.dmg/from/http://mirrors.dedipower.com/www.mysql.com/
and then ran:
sudo gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
That seemed to fix the problem.
Tags: mac, mysql, osx, rails, ruby
Posted in Ruby on Rails | 2 Comments »
May 21st, 2009
Mytop has started to break recently on our cPanel Redhat and CentOS machines.
When you run mytop:
#mytop
Error in option spec: “long|!”
The fix for this is to edit the mytop script and comment out the line containing long|!
nano /usr/bin/mytop
Run a search (control+w) for “long|!” and change:
“prompt!” => \$config{prompt},
“long|!” => \$config{long_nums},
);
to:
“prompt!” => \$config{prompt},
# “long|!” => \$config{long_nums},
);
Now run Mytop again, and away you go!
Tags: Linux, mytop
Posted in Linux | 4 Comments »
November 13th, 2008
Fantastico allows you to install scripts using cPanel very easily, however it occasionally glitches after you’ve installed/uninstalled scripts not using Fantastico.
This leads to a common error when you try to install another script in the root directory:
You cannot install more than one script in the root directory of a domain
This is usually an easy fix:
Find the folder : .fantasticodata in your folder, and edit the file installed_in_root.php
It should look like this :
<?
$installed_in_root["domain1.com"] = 1;$installed_in_root["domain2.com"] = 1;
?>
So you just need to delete “$installed_in_root["domain1.com"] = 1;” for the domain you want to install the new Fantastico script from.
You can then go back into Fantastico and install the new script!
Warning!
Fantastico is only designed to run 1 script from any folder, so it’s not advisable to use this to install multiple scripts in a root directory!
Tags: cPanel, Fantastico
Posted in cPanel | 1 Comment »