Categories
CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials

CentOS LVM Resize

Since the release of CentOS 5.5 we noticed that the default CentOS install assigns a considerable amount of its available storage space to Swap. If you don’t catch this during the installation don’t worry, Logical Volume Manager or LVM will rectify this post install.

LVM is a logical volume manager for the Linux kernel; it manages disk drives and similar mass-storage devices, in particular large ones. The term “volume” refers to a disk drive or partition thereof.

Categories
CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials

Installing Cherokee on CentOS 5.8

This tutorial is intended for system administrators wanting to install Cherokee web server on a CentOS 5.8 x86_64

Cherokee is a very fast, flexible and easy to configure web server. It supports the widespread technologies nowadays: FastCGI, SCGI, PHP, CGI, TLS and SSL encrypted connections, virtual hosts, authentication, on the fly encoding, load balancing, Apache compatible log files, and much more.

Install the RPMForge x86_64 YUM Repository

# rpm -Uvh http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

Install the EPEL x86_64 YUM Repository

# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# yum install yum-priorities
# yum update

Install MySQL and MySQL server

# yum install mysql mysql-server

Install RRDTool

# yum install rrdtool

Install Cherokee web server

# yum install cherokee
# chkconfig cherokee on
# service cherokee start

Now direct your browser to http://10.0.0.3

You should see the Cherokee placeholder page.

Cherokee can be configured through a web-based control panel which we can start as follows:

cherokee-admin -b

(By default cherokee-admin binds only to 127.0.0.1 (localhost), with the -b parameter you can specify the network address to listen to. If no IP is provided, it will bind to all interfaces.)

Output should be similar to this one:

# cherokee-admin -b

Login:
  User:              admin
  One-time Password: gtVzmvy6Rqy9idKy

Web Interface:
  URL:               http://localhost:9090/

Cherokee Web Server 1.0.6 (Aug  6 2010): Listening on port ALL:9090, TLS
disabled, IPv6 enabled, using epoll, 4096 fds system limit, max. 2041
connections, caching I/O, single thread

The admin web interface can be found on http://10.0.0.3:9090/ (make sure to enter your one-time password)

To stop cherokee-admin, type CTRL+C on the shell.

Managing Varnish with Puppet

If you’re running Puppet we have included the manifest for installing Cherokee on CentOS 5. If you’re not running Puppet then you can install it by following the instructions outlined in our CentOS 5 Puppet Install.

This is only the manifest and doesn’t include any of the files (i.e. cherokee.conf).

class cherokee::repo {
 
	Package {
		provider => rpm,
		ensure => installed
	}
 
	package {"epel-release": source => "http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm";
		"rpmforge-release": source => "http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm"
	}
}

class cherokee::install {

	$packagelist = [
		"cherokee",
		"rrdtool",
		"mysql",
		"mysql-server",
	]

	package { $packagelist:
		ensure => latest,
		require => Class ["cherokee::repo"],
	}
}

class cherokee::conf {

	File {
		owner => "root",
		group => "root",
		mode => 0644,
		require => Class ["cherokee::install"],
		notify => Class ["cherokee::service"]
	}

	file { "/var/www/cherokee/phpinfo.php":
		source => "puppet:///modules/cherokee/phpinfo.php"
	}

	file { "/etc/cherokee/cherokee.conf":
		source => "puppet:///modules/cherokee/cherokee.conf"
	}
}

class cherokee::service {

	$servicelist = [ 
		"cherokee",
		"mysqld",
	]

	service { $servicelist:
		require => Class ["cherokee::install"],
		ensure => true,
		enable => true,
		hasrestart => false,
		hasstatus => true
	}
}

class cherokee {
		include cherokee::repo, cherokee::install, cherokee::conf, cherokee::service
}

Links

Cherokee: http://www.cherokee-project.com/
MySQL: http://www.mysql.com/
CentOS: http://centos.org/

+George Rushby

Categories
CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials

CentOS 5 Change Hostname

In this CentOS tutorial we will be showing you how to find and change the hostname of your system.

The assumption is that you are running as root and have a basic understanding of the software required but if you follow this tutorial you should be able to complete the task successfully.

Let us begin by finding the CentOS systems fully qualified domain name (FQDN) by seeing how it identifies itself.

Print the network node hostname

# uname -n
centos01.how2centos.com

Show the systems DNS domain name

# dnsdomainname 
how2centos.com
Categories
CentOS 5.3 Tutorials CentOS 5.4 Tutorials CentOS 5.5 Tutorials CentOS 5.6 Tutorials CentOS 5.7 Tutorials CentOS 5.8 Tutorials

Subversion: Failed to get lock on destination repository

In the event that your Subversion server was powered down incorrectly or just crashed during one of its subversion mirror synchronizations you might end up with a lock on the destination repository.

This basic tutorial will help you to remove the lock and continue with your synchronizations.

Below is the output from the svnsync showed this:

# /usr/bin/svnsync --non-interactive synchronize svn://{destination repository}/opt/svn/{repo}

Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
Failed to get lock on destination repos, currently held by 'svn.how2centos.com:fbc2c0c8-957f-0410-8a06-87f31314868b'
svnsync: Couldn't get lock on destination repos after 10 attempts

To remove the lock you’ll need to do the following:

# svn propdel svn:sync-lock --revprop -r 0 svn://{destination repository}/opt/svn/{repo}
# /usr/bin/svnsync --non-interactive synchronize svn://{destination repository}/opt/svn/{repo}

Committed revision 1694.
Copied properties for revision 1694.
Committed revision 1695.
Copied properties for revision 1695.