Archive for the Category » Random Techie Stuff «

Wednesday, May 26th, 2010 | Author: darvil

So I started using my l33t server to do some seedings as I needed some nice ratio. But running rtorrent, I wasn’t able to seed any torrents. Frustration set and I was about to go murder some puppies but lucky for the furry things I ran into this post that resolved the problem.

http://libtorrent.rakshasa.no/ticket/1546

works wonderfully!

Thanks to FUSiON

ok after recompiling rtorrent / libtorrent after the libcurl install .. it works fine
 
ok conclusion:
 
if you have a fresh debian installation you need to install the actual libcurl (  http://curl.haxx.se/download.html ) with the actual c-ares (  http://c-ares.haxx.se/ )
 
first install c-ares then libcurl (libcurl: ./configure --enable-ares)
 
After that .. compile libtorrent and rtorrent.
 
greetz
 
FUSiON
Sunday, September 27th, 2009 | Author: darvil

I have wanting to install nginx to run sarnworld forum for a very long time now. Previously, there were other sites that were on the same machine so finally the past summer I moved sarnworld to its own machine. Now I finally have done it although with a few bumps along the way which I know alot of members probably were irritated by ;) . I say that because really I don’t need to install anything. The default setting is fine (with apache) because I have alot of resources to throw at the site but as a geek you want to just try to milk more out of your system so I went ahead and did this. Some of the roadblocks that I ran into were because SW was now running on invision forum version 3 which was a bit more picky and had some things which took some work to get it to work on nginx.

These are the road blocks I ran into in order

1.) forum wouldn’t work due to me not including the reflection option in the php compile
2.) nginx had permission problem with the graphics on the forum and the base domain couldn’t load up.
3.) nginx had an issue with the new FURL which uses htaccess so nginx config had to be modified
4.) The wiki also needed a bit of modification on nginx config to work
5.) Ran into a problem in compiling the modules
6.) nginx had 502 errors after loading up the caching modules

First I referenced an old post I made before (SW video site link)

I did the php-fpm install. Edit the php-fpm.conf file and make sure to change the user and group.

Of course on the php compile you should do it your way just make sure you include –enable-fpm and –enable-reflection

./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --disable-pdo --disable-debug --enable-pic --enable-inline-optimization --with-xml --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-xslt --enable-memcache --enable-zip --with-pcre-regex --with-mysql --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --enable-reflection

I then compile nginx in the default folder and modules

Along the way I referenced This Site

But when I ran the pecl command I got this error

ran into the "pecl.php.net is using a unsupported protocal - This should never happen." error

To fix this error I found this link

Found the 2 channels and deleted them

/usr/local/lib/php/.channels/
/usr/share/pear/.channels/

Then I ran

pear update-channels

Now I go onto to install the 3 modules on the other link.

/usr/local/bin/pecl install memcache
 
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/memcache.so'
install ok: channel://pecl.php.net/memcache-2.2.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=memcache.so" to php.ini
/usr/local/bin/pecl install apc
 
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/apc.so'
install ok: channel://pecl.php.net/APC-3.0.19
configuration option "php_ini" is not set to php.ini location
You should add "extension=apc.so" to php.ini

I ran into an error on the 3rd module.

/usr/local/bin/pecl install syck-beta
 
checking for syck files in default path... not found
configure: error: Please reinstall the syck distribution
ERROR: `/tmp/pear/temp/syck/configure' failed

Found the solution on this link.

I followed the instructions.

http://rubyforge.org/frs/?group_id=224&release_id=2202

wget http://rubyforge.org/frs/download.php/4492/syck-0.55.tar.gz

untar, ./configure, make, make install.

ran the command again

/usr/local/bin/pecl install syck-beta 
 
configuration option "php_ini" is not set to php.ini location
You should add "extension=syck.so" to php.ini

I then edited php.ini and added all the modules

Now I discovered Nginx had permission issue (403 error) with loading up the graphics on the forum. I posted here and here.

I wished I saw the latter post which gave me the correct because it took me a bit of time to figure it out. It was basically a counter intutitive solution. Initially I thought it was php-fpm which was the issue but it was actually nginx. Basically it was the user line that I had to add.

I also had to add extra stuff to get mediawiki to work with nginx. I used this link as a reference.

Here is my nginx config

Make sure you include

user usertim usergroup;

if the files in the domains are owned by the user and group.

On the top of the nginx.conf file

domains part of the config. Note that I had to include both /discuzz and discuzz/ just in case some people include a / at the end. This setting is with FURL enabled with .htaccess in IPB3.

$INFO['use_friendly_urls'] = '1';
 
server {
  listen 80;
  server_name  www.sarnworld.com;
  root /blah/blah;
  location / {
    index index.php index.html index.htm;
    }
 
# This is your php-fpm section.  Replace it accordingly (For example if you decide to run it on a different port).
  location ~ \.php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;
 
 }
 
  location /discuzz/ {
    index index.php index.htm index.html;
    try_files $uri $uri/ /discuzz/index.php?q=$uri;
   }
 
location /discuzz {
    index index.php index.htm index.html;
    try_files $uri $uri/ /discuzz/index.php?q=$uri;
   }
 
# This is for nginx to deny access to .htaccess file.
  location ~ /\.ht {
            deny  all;
          }
     }
 
server {
  listen 80;
  server_name wiki.sarnworld.com;
  root /blah/blah/blah;
  location / {
    index index.php index.html index.htm;
  }
 
# This is your php-fpm section.  Replace it accordingly (For example if you decide to run it on a different port).
  location ~ \.php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
   include        fastcgi_params;
  }
 
#without this mediawiki wouldn't work
 location ~  ^/index.php/(.+) {
           rewrite ^/index.php/(.+) /index.php?title=$1 last;
       }
 
# This is for nginx to deny access to .htaccess file.
  location ~ /\.ht {
            deny  all;
          }
 
     }

I ran into another issue where if i load the APC extension in php.ini, nginx gives a 502 error and everything dies.

I found this thread but it didn’t give me any clues.

Finally I found this thread which let me know that Zend optimizer was conflicting with APC.  Great clue.  I needed ioncube loaded for some encrypted mod I was using on the forum but I didn’t need zend optimizer so I edited php.ini and commented all lines with zend_extension_ except for the one that loads ioncube.  Restarted php-fpm with apc extension loaded and the site wasn’t throwing the 502 errors anymore.

WOOHOO

Now to install memcache and get it to work you need a dependency (libevent). Found link for a reference.

installed memcache according to that and ran using this command. 

/usr/local/bin/memcached -u root -d -l 127.0.0.1 -p 11000 -m 128

It runs on port 11000 and uses up to 128 megs of ram and localhost

Now I activate APC and Memcache on sarnworld

edited conf_global.php file in IPB to enable the 2 caching softwares. I had to send a ticket in IPB customer service to ask how to do it. It turned out to be pretty simple as the support is built in.

For APC add in.

$INFO['use_apc'] = '1';

for Memcache

$INFO['use_memcache'] = '1';
$INFO['memcache_server_1'] = 'localhost';
$INFO['memcache_port_1'] = '11000';

According to the IPB tech if you have more the 1 memcache server, just duplicate the last 2 lines, increasing the server and port numbers.. server_2, server_3, etc…

Now to get into APC settings in detail I found this link for a reference.

edit php.ini and I added these entries.

[apc]
 
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 30
apc.optimization = 0
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 2000
apc.mmap_file_mask = /tmp/apc.XXXXXX

Then make a symlink to the apc.php to a web accessible location to see the statistics.

ln -s /usr/local/lib/php/apc.php /blahblah/apc.php

It seems that I don’t really need memcache so I may just close it off in the future. Most recommendations seem to be just to enable APC and it would be good enough but for now why the heck not. Just run it all since I have all the resources. I want to improve the speed of the forum ;)

On a side note I found this memcache link for mediawiki but I will work on that later ;)

Tuesday, September 08th, 2009 | Author: darvil

So I’ve been attempting to upgrade the forum (currently 2.3.5) to 3.0.2 but I keep running into problems.

It all started off when I see this error “ALTER TABLE ibf_members CHANGE id member_id MEDIUMINT(8) NOT NULL auto_increment;
Duplicate entry ‘1′ for key 1″

After this my member_id table get deleted and it causes a chain reaction of errors that made it impossible for me to upgrade the forum.

After spending a few hours, I finally found the solution.  First I found an IPB thread that talked about something “funky” on the members table.

Well my brain finally noticed something strange on the members table.  Basically THE FIRST RECORD I had was a 0 with no username (just a blank), this was what was the problem.  I deleted that first record and everything started working.  Incredible that I didn’t see this from the beginning.

DOH!

Monday, April 06th, 2009 | Author: darvil

So I decided to finally run windows VMs on my server.  When I tried to add it, I found out that I had not enabled VT on the CPU (I’m running dual Intel Xeon E5310 Clovertown 1.6GHz).  So I shut off the machine and turned on the VT in bios.  After I rebooted the machine and when CentOS 5 was loading up with the Xen kernel, it panicked.

What I saw was basically this.

Xen bug at vmcs.c:175

Panic on CPU 4

then it reboots repeatedly in this cycle.

Since this was on a live server with linux VMs, one which was hosting sarNworld, I decided to migrate them to fully play with this issue.  In theory I don’t need to play with windows on it but this was one of those “issues” that bugged me and one that I would *have* to resolve or else it would drive me crazy.

So I started to “google” the errors.  Found alot of interesting things.  What I found out was mostly to do with VMX support in the CPU.  There were also other errors but nothing that really hit home.  I decided to reformat the server and start fresh.

So I reinstalled CentOS 5 and did updates.

While Installing HyperVM on the server I ran into this issue.

Error: kernel-xen conflicts with ecryptfs-utils < 44
error reading information on service xendomains: No such file or directory
error reading information on service libvirtd: No such file or directory

Basically I wasn’t able to install the xen-kernel.  Looked up ecryptfs and it looks like it was not something I need.

wasn’t able to remove the traditional way.

rpm -e ecryptfs-utils-41-1.el5
error: “ecryptfs-utils-41-1.el5″ specifies multiple packages

I found the right command in a thread on centos forum after googling.

rpm -e –allmatches ecryptfs-utils

I switched to the Xen-kernel and rebooted the machine and

still NO LOVE.  Same kernel panic.

I looked up a bit more on VMX, but my cpu was already supporting it.  I started to think that it might be Xen’s fault although I have had zero problem with the latest Xen 3.3.x version.  So whats going on?

Well I found a gem of a thread on the google result page.

http://webui.sourcelabs.com/rhel/issues/427788

Basically the thread had a similar issue as mine and they found out it was a steppings issue on the CPUs.  I realized that I bought the 2nd CPU long after the first as I needed more power.  For clarity I looked up the definition of steppings and found some good threads.  One such one was a tom hardware thread. http://www.tomshardware.com/forum/235792-28-what-stepping

I ran a command to see my steppings.

cat /proc/cpuinfo | grep stepping

What shows up was steppings 7s and 13s.

Well the problem definately could be this and I had a gut feeling this was the issue.  I pulled the server and removed one of the CPU.  After that the machine was booted into the xen-kernel with ZERO issues.

Obviously I won’t be able to fix this issue so my best chance was to upgrade the bios version.

Worse case scenario, I would have to find a cpu with the same stepping which I have no idea how to accomplish it so I was really hoping for the bios to rescue me.

I checked the bios of the motherboard ( supermicro X7DVL-E) and found it was 1.3a.

Went on the mobo site and found out the new bios was 2.1a

Brought in my usb floppy drive and updated the bios.

Crossed my fingers and rebooted it into the xen-kernel.

Lo and behold, it booted in without any problems.

I was overjoyed.  I ran the command again.

cat /proc/cpuinfo | grep stepping

and now all I see is 7s.  It looks like the bios set all the steppings to be the same which was probably the reason why it was working in the xen kernel.

I am loving the supermicro bios today.

Wednesday, February 11th, 2009 | Author: darvil

For some stupid reason I wasn’t able to connect to my VPS with the ftp account.  I am running openVZ. Checking the log I discovered this entry.

Feb 11 17:23:15 sarnworld xinetd[21875]: START: ftp pid=22305 from=thisismyiphere
Feb 11 17:23:15 sarnworld pure-ftpd: (?@?) [ERROR] Unable to switch capabilities : Operation not permitted
Feb 11 17:23:15 sarnworld xinetd[21875]: EXIT: ftp status=252 pid=22305 duration=0(sec)

Well googling for operation not permitted sent me to this link.

http://forum.openvz.org/index.php?&t=msg&goto=4203

Stopping the VM and then running the following command fixed the issue for me.

damn you pure-ftp and openvz for being weaksauce.

 
VPSID=110
for CAP in CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE CHOWN DAC_READ_SEARCH SETGID SETUID NET_BIND_SERVICE NET_ADMIN SYS_CHROOT SYS_NICE
do
vzctl set $VPSID --capability ${CAP}:on --save
done
Wednesday, December 24th, 2008 | Author: darvil

I tried to install rtorrent but ran into some slight problems. It took me a few mins to figure it out but thought I’d post it just in case someone might need the help.

I’m installing it on a minimal CentOS 5 install.

First some basics.

First make sure python is installed which I had. Also make sure there’s a compiler (gcc) is installed. Next download the 2 files rtorrent and libtorrent.

I install it in /usr rather then leave it default because redhat binaries are put in /usr/bin rather then /usr/local/bin and I just want to keep it all in the same place.

cd libtorrent-0.12.2
./configure --prefix=/usr

First I run into an error with openssl being missing. I do have openssl installed but this is a typical problem. What is needed is the devel package.

yum install openssl-devel

Next was the ’sigc++-2.0′ error.

Resolved that by installing the DAG repo.

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum install libsigc*

Next was this error

checking signedness of mincore parameter... configure: error: failed, do *not* attempt fix this with --disable-mincore unless you are running Win32.

This one was tricky for me. Looking at the config.log located in the libtorrent-0.12.2 folder gave me a hint. I see

configure:23341: g++ -c -O2 -Wall -g -DDEBUG -I/usr/kerberos/include   -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include    conftest.cpp &gt;&amp;5
./configure: line 23342: g++: command not found

Solution was to install

yum install gcc-c++

The rest of the errors I ran into was ncurses and curl which just basically required the devel packages installed.

yum install ncurses-devel
yum install curl-devel

Now lets see how really good rtorrent is on commandline.