JasonDaly.name

PHP, Ruby, Symfony, Rails, Doctrine, MooTools. Web Development.

Posts tagged with "centos"

April 12, 2009

Fixing Crontab Permissions for Jailshell cPanel Users on CentOS 5 & cPanel/WHM 11.24 RELEASE

Using CentOS 5 on my VPS, I recently found that newly created cPanel accounts running cPanel/WHM 11.24 RELEASE seemed to have some trouble properly setting permissions to allow the jailshell cPanel users to access/manage their crontab.

Setting up cron jobs via cPanel’s web interface itself worked just fine, but when trying to manage a jailshell users crontab via shell, the permissions were not set up properly to allow for this.

As d4ly you can see I don’t have permission to view/edit the crontab for d4ly

d4ly@d4ly.com [~]# crontab -e
cron/d4ly: Permission denied

So as root I did the following

root@server [~]# chmod 4775 /usr/bin/crontab
root@server [~]# cd /var/spool/cron
root@server [/var/spool/cron]# chmod 0755 .
root@server [/var/spool/cron]# chown d4ly.d4ly. d4ly

root@server [/var/spool/cron]# ls -l
total 24
drwxr-xr-x 2 root root 4096 Feb 4 17:03 ./
drwxr-xr-x 13 root root 4096 Sep 9 09:51 ../
-rw------- 1 d4ly d4ly 37 Feb 4 14:54 d4ly
-rw------- 1 root root 1555 Jan 19 20:52 mailman
-rw------- 1 root root 32 Jan 11 16:42 munin
-rw------- 1 root root 485 Jan 26 13:17 root

Then I tested things out once more as d4ly

d4ly@d4ly.com [~]# crontab -e
MAILTO="d4ly"
0 0 * * * ping d4ly.com # This cron is for testing jailshell crontab editing

Tags: cron centos5 centos whm cpanel 11.24 RELEASE crontab bash linux

March 26, 2009

Trac - SubversionException: Can’t set position pointer in file…

When recompiling SVN 1.5.5 from source, making sure to include the swig-py bindings to allow Trac to read from local SVN repositories, I used the following ./configure command

./configure --prefix=/usr/local/svn-1.5.5/ --with-apr=/usr/local/apr/bin --with-apr-util=/usr/local/apr/bin --with-neon=/usr/bin --with-apxs=/usr/local/apache/bin/apxs 

When trying to view my repository I was presented with the following error in my trac.log file

SubversionException: ("Can't set position pointer in file '/var/svn/db/revs/135': Invalid argument", 22)

After some research1 I found the most common cause of this error is that Subversion was compiled against a different version of apr and apr-util than apache was. I found apache compiled with cPanel’s EA3 uses

/usr/local/apache/bin

as it’s path for apr and apr-util. Changing the flags to reflect this when compiling Subversion I was left with

./configure --prefix=/usr/local/svn-1.5.5 --with-apr=/usr/local/apache/bin --with-apr-util=/usr/local/apache/bin --with-neon=/usr/bin --with-apxs=/usr/local/apache/bin/apxs

make swig-py
make install
make install-swig-py
cd /usr/local/svn-1.5.5/lib/svn-python/
cp -r libsvn/* /usr/lib/python2.4/site-packages/libsvn
cp -r svn/* /usr/lib/python2.4/site-packages/svn
service httpd restart

I also ran the following out of habit after recompiling SVN before restarting httpd.

trac-admin TRAC_ENV_PATH resync

Tags: python trac svn subversion httpd centos linux