Archive

Archive for the ‘linux’ Category

Installing Subversion on Debian

January 27th, 2008 rupert Comments off

I was greeted with “No space left on device” on my cron log. Turns out that my svn server obviously ran out of disk space. The old svn server was running on CentOS4.3, Subversion 1.3.2, Trac-0.11.devxxx. I decided to migrate the svn data to a new server, so I installed Debian4.01 on a small server with 72 GB HD, no partitions (just / and swap, so the svn have room to grow…). Here are the steps I took for the migration:

A. A fresh start…
1. Installed Debian. Fixed network and ssh.
2. apt-get install apache2
3. apt-get install subversion
4. apt-get install python python-setuptools python-mysqldb python-subversion
5. apt-get install libapache2-svn libapache2-mod-python

B. Making SVN work…
1. svnadmin create /repos –fs-type fsfs

2. Since I have a fresh apache configuration, I edited it accordingly from /etc/apache2/mods-available/dav_svn.conf:

#SVN dir
<location>
  DAV svn
  SVNPath /repos
  SVNAutoversioning on
  AuthType Basic
  AuthName "SVN - Your Project"
  AuthUserFile /repos/svn-auth-file
  Require valid-user
</location>

3. Restart apache

4. To test if svn is running, import a project inside the repository.
svn import -m "initial import" /tmp/project http://127.0.0.1/repos/project

C. Migrating the data

After I got my fresh debian svn machine, I need to move the svn data and trac to the new server. http://svnbook.red-bean.com/nightly/en/svn.reposadmin.html

1. Transfer /repos/svn-auth-file and /repos/svn-authorization-file to the new server
2. Transferred trac.tar.gz (/var/www/trac) to the new server

To move the svn data from one server to another, I tried the ff choices…
1. svnadmin dump /repos /reposbak. Will work if disk space is not an issue. My /repos is 25 GB, and my other 30 GB partition was wiped out, even though the dump was not finished yet.

2. svnadmin hotcopy --clean-logs /repos /repos2. Accdg to the docs, this is exactly the same repository without the BdB logs. I then transferred the hotcopy from choice 2 above to the new server and works flawlessly to my surprise. So now, I still have all my revisions

http://bealers.com/2008/01/01/installing-trac-on-debian-etch/
http://trac.edgewall.org/wiki/TracOnDebianSarge
http://trac.edgewall.org/wiki/TracUpgrade
http://trac.edgewall.org/wiki/TracInstall
http://trac.edgewall.org/wiki/TracModPython

Categories: subversion Tags: , ,

SquirrelMail SMTP Authentication

January 4th, 2008 rupert Comments off

Just a quick note to myself… A co-worker just notified me that they cannot send email using the web interface–squirrelmail.

squirrelmail Server replied: 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.5.3 - chkuser)

This qmailrocks forum thread gives a quick workaround. Just set “SMTP AUTHENTICATION” to login as noted below.


/usr/share/squirrelmail/config/config.php
$no_list_for_subscribe = false;
$smtp_auth_mech = 'login';
$imap_auth_mech = 'login';
$use_imap_tls = false;

Categories: linux Tags: , ,

Installing R on Windows and Debian

November 16th, 2007 rupert Comments off

‘R’ is a statistical package. For an overview, please go to www.r-project.org
My intention was to remove the point outliers from a given set of point geometries.

I just recently installed R both on my Windows XP and Debian. Regina’s www.bostongis.com is an excellent tutorial in getting involved with R. I do suggest you head first to PLR Part 1: Up and Running with PL/R (PLR) in PostgreSQL: An almost Idiot’s Guide to get you started.

The install instructions for Windows works flawlessly. I have to hold back to R-2.5 though as I plan to use RPy (Python for R), see details below. To install ‘R’ in Debian, there’s a couple of settings that we need to take care of…

1. Install r-base
sudo apt-get install r-base

2. Install plr on postgres
sudo apt-get install postgresql-8.2-plr

3. Using R in a database
psql -d beijing -U lbs -h 127.0.0.1 < /usr/share/postgresql/8.2/plr.sql

4. Set the R_HOME environment variable
/etc/postgresql/8.2/main/environment
R_HOME='/usr/lib/R'

5. Restart Debian.

RPy, R for Python, is another alternative to use R in Python. I installed it both in Windows and Debian. Note that I reverted to R-2.5 on Windows to be compatible with RPy. For Debian, Im currently using R-2.6.

For the Windows Binary Installation,

1. Read the RPy Main Site

2. Install prerequisites:

- NumPy
- Win32 Extensions Download

3. Afterwards, install the main package, RPy Download

In Debian, its a straight forward…sudo apt-get install python-rpy

Categories: debian, postgis, postgres Tags: ,

Serving ASP pages in Linux

November 14th, 2007 rupert Comments off

I never intended to do such a thing as what the title describes. However, since we need it at work temporarily, I have to crack up my linux skills to set this up. Principal reference is http://www.apache-asp.org/config.html.

In Debian,

1. install libapache2-mod-perl2 + libapache-asp-perl


sudo apt-get install libapache2-mod-perl2
sudo apt-get install libapache-asp-perl

2. configuration includes:
sudo vi /etc/apache2/sites-available/default

 76     PerlModule  Apache::ASP
 77      <files>
 78        SetHandler  perl-script
 79        PerlHandler Apache::ASP
 80        PerlSetVar  Global .
 81        PerlSetVar  StateDir /data/asp
 82      </files>

3. Restart apache.

4. Make sure you have the correct permissions to: /data/asp

drwxrwxr-x 4 www-data www-data 4096 2007-11-13 15:33 asp

5. If you encounter the problems:

[Tue Nov 13 15:12:36 2007] [error] [client 127.0.0.1] Can't locate object method "get" via package "APR::Table" at /usr/share/perl5/Apache/ASP.pm line       2016.\n at /usr/share/perl5/Apache/ASP.pm line 2016\n\tApache::ASP::get_dir_config('APR::Table=HASH(0x81d96f8)', 'Global') called at /usr/share/perl5/A      pache/ASP.pm line 275\n\tApache::ASP::new('Apache::ASP', 'Apache2::RequestRec=SCALAR(0x81d9764)', '/data/wwwroot/asp/test.asp') called at /usr/share/pe      rl5/Apache/ASP.pm line 183\n\tApache::ASP::handler('Apache2::RequestRec=SCALAR(0x81d9764)') called at -e line 0\n\teval {...} called at -e line 0\n, re      ferer: http://127.0.0.1/asp/

Read nable-post. which patches /usr/share/perl5/Apache/ASP.pm as follows:

The lines 65-71:
   if($ENV{MOD_PERL}) {
   $ModPerl2 = ($mod_perl::VERSION &gt;= 1.99);
   if($ModPerl2) {
       eval "use Apache::ASP::ApacheCommon ();";
       die($@) if $@;
   }
   }
 
become
   if($ENV{MOD_PERL}) {
   $ModPerl2 = ($mod_perl::VERSION &gt;= 1.99);
   my $ver = $mod_perl::VERSION;
   if ($ver eq "") { $ver = $ENV{MOD_PERL_API_VERSION}; }
   $ModPerl2 = ($ver &gt;= 1.99);
   if($ModPerl2) {
       eval "use Apache::ASP::ApacheCommon ();";
       die($@) if $@;
   }
   }

6. If Step 5 still doesn’t work.

a. And this to /etc/apache2/conf.d/perl.conf:

PerlRequire /etc/apache2/startup.pl

b. startup.pl

#!/usr/bin/perl
use Apache2::compat;
1;

7. To test. Paste the ff in test.asp under your webroot.

  <!-- sample here -->
 
  For loop incrementing font size:
 
  &lt;% for(1..5) { %&gt;
	<!-- iterated html text -->
	<font size="&lt;%=$_%&gt;"> Size = &lt;%=$_%&gt; </font> 
  &lt;% } %&gt;
 
  <!-- end sample here -->
Categories: debian Tags: ,

Too many authentication failures for user

November 11th, 2007 rupert Comments off

Found this finally.. http://netthink.com/archives/191. On a quick note, edit ssh_config not sshd_config.

You could also try debugging ssh while connecting, through “-v” switch. For example:


ssh -v rupert@192.168.1.12

Categories: linux Tags: ,