Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Subversion - Compiling from source

I will assume that you know how to perform the standard ‘nix compile steps. And, that you know where to put the compiled files.

Why compile from source? Why not use a package manager, such as Yum or MacPorts?
  • You are hard core old school.
  • Usually, it is because the package maintainers have not put out the latest (or a specific version) of a package that you need NOW!
Some gotchas with compiling SVN (who would have thought):
  • Prerequisite libraries. Since you are not using the awesomeness of a package manager, which will take care of prerequisites for you, you MUST have required libraries pre-installed. Those libraries can be installed from a package manager, or you could have compiled them from source. It does not matter as long as you know where they are.
  • Out of the box, SVN does not support the HTTP or HTTPS protocol. What?! Yeah, I know. This is the main gotcha. If you do not configure SVN for this, you will get the “URL unrecognized” error, which is what we were seeing yesterday.

Here are the steps:

Install the
APR libraries.

These usually come with the Apache installation. If you have Apache installed, and you still don’t have them. You probably need to install the Apache development files too.

The files you need are:
  • apr-config
  • apu-config
Look in:
  • /usr/bin . . . or
  • /usr/local/bin
For some reason on CentOS, with the Apache libraries installed with Yum, the files are called:
  • /usr/bin/apr-1-config
  • /usr/bin/apu-1-config
Install Neon with SSL support

You will need the OpenSSL libraries installed.
  • ./configure—with-ssl
  • make
  • make install
Install Subversion with HTTP and HTTPS support

  • ./configure --with-ssl --with-apr=/usr/bin/apr-1-config --with-apr-util=/usr/bin/apu-1-config --with-neon=/usr/local
  • make
  • make install
Note: Make sure that you have the correct paths for the --with-apr, --with-apu, and --with-neon parameters.

You can make sure that SVN installed correctly with the proper support for HTTP and HTTPS by running the “svn—version” command. You should see this.

svn_compile_result

Posted at on 9/11/08 by | 0 comments | Filed under:

Install Memcached on CentOS 5.1

I can use Yum. But, I am going to install from source in order to get the latest builds.

libevent



Memcached requires libevent. So, get and install libevent first.

wget http://monkey.org/~provos/libevent-1.4.6-stable.tar.gz
tar zxpfv libevent*
cd libevent*
./configure
make
sudo make install


memcached



Next, install memcached.

wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
tar zxpfv memcached*
cd memcached*
./configure
make install


Errors . . . there is always at least one



You may get this error:

error while loading shared libraries: libevent-*: cannot open shared object file: No such file or directory


You need to create a symbolic link. For me, this is the command I needed to run. Yours may differ depending on the release you downloaded.

sudo ln -s /usr/local/lib/libevent-1.4.so.2 /usr/lib


Start memcached



memcached -d -m 64 -p 11211


"-d" runs memcached in daemon mode.

"-m" is the amount of memory memcached will use in MB's.

"-p" is the port # for memcached.

Connect to it from Rails 2.1



Rails 2.1 is awesome because of its new caching features. It can support memcached as a cache server. In order to get this to work, add/edit the following line in your config/environment.rb file. Or, you can add/edit your specific environments file, such as config/environments.development.rb file.

config.cache_store = :mem_cache_store, 'IP_ADDRESS_OF_MEMCACHED_SERVER:11211'

Posted at on 8/6/08 by | 3 comments | Filed under: ,