May 30 2008

Cool things you can do with the openssl command for troubleshooting

Tag:tepezcuintle @ 16:04

Focas

OpenSSL is more than just an open source SSL library implementation. It can be used to create, request, sign, and revoke certificates and can also be used to perform other cryptographic operations such as creating hashes for files, testing SSL connections, and more. This week, we’ll take a look at some of the interesting things that can be done with the openssl command-line program.

To test SSL connections to a mail server, use the openssl command with the s_client parameter:
Continua”Cool things you can do with the openssl command for troubleshooting”


May 23 2008

How to reload fstab changes without a reboot.

Tag:tepezcuintle @ 15:19

If you make a new entry in fstab it will not auto-mount. Therefore you must reload / refresh the entries. A reboot will do this but that is not a friendly way to do it. A quick way to reload new entries in /etc/fstab (fstab) is to use the mount command:

mount -a

For example this morning, my automatically mounted samba shared folder was giving me an error. It seems that the server lost connectivity to the samba server and I didn’t want to reboot the machine or manually mount it.
Continua”How to reload fstab changes without a reboot.”


May 22 2008

Recovering a crashed LVM2 PV hard drive

Tag:tepezcuintle @ 19:43

Plumber
found at: http://blog.eikke.com/index.php/ikke/2007/02/21/recovering_a_crashed_lvm2_pv_harddrive

2 weeks ago, due to a power failure, a harddrive in a (UPS protected) server at VTK crashed. Unable to boot the machine, unrecoverable IDE errors,…
The machine was only used as a database server for now (both MySQL and PostgreSQL), and did not make external backups (yet). Yeah I know, stupid, but managing our network isn’t that easy.

Anyway, the harddrive consisted of 3 partitions:

  • /boot, ext3
  • /, ext3
  • an LVM2 PV

Continua”Recovering a crashed LVM2 PV hard drive”


May 22 2008

Linux Logical Volume Management

Tag:tepezcuintle @ 19:11

Logical Volume
Found at: http://www.ibm.com/developerworks/library/l-lvm2/index.html

Volume management is not new in the -ix world (UNIX®,
AIX, and so forth). And logical volume management (LVM) has been around since
Linux® kernel 2.4v1 and 2.6.9v2. This article reveals the most useful features
of LVM2—a relatively new userspace toolset that provides logical volume
management facilities—and suggests several ways to simplify your system
administration tasks. Based on reader feedback,
the author has updated Listings 10, 14, 15, and 16. -Ed.

Logical volume management (LVM) is a way systems can abstract physical volume
management into a higher-level and usually simpler paradigm. By using LVM, all
physical disks and partitions, no matter what size and how scattered they are, can
be abstracted and viewed as a single storage source. For example, in the
layout of physical-to-logical mapping shown in Figure 1, how could the user create
a filesystem of, say 150GB, since the biggest disk is 80GB large?

Continua”Linux Logical Volume Management”


May 22 2008

How to recover from an LVM disaster

Tag:tepezcuintle @ 19:05

Otis the cat

found at http://codeworks.gnomedia.com/archives/2005/general/lvm_recovery/LVM recovery tale.
Over the weekend I had the worrying experience of losing my LVM settings and potentially all my data… a quick search on the web showed a confusing set of information, much of it for older versions of LVM and therefore rather suspect.

Well, I recovered all my data and it was really quite simple, so I’ve written up what I did in the hope that someone else, in a similar situation, will find it useful. It’s a scary thing, losing the whole hard disk and knowing that, in reality, its all there.
Continua”How to recover from an LVM disaster”


May 21 2008

Recover from a MySQL Crash

Tag:tepezcuintle @ 21:17

Original Article at

http://dev.mysql.com/tech-resources/articles/recovering-from-crashes.html

Server Crashed

Here we discuss how to recover data after a crash in case of:

  1. operating system crash
  2. power failure
  3. filesystem crash
  4. hardware problem (hard drive, motherboard…).

The version of MySQL we will use is MySQL 4.1.8. We’ll consider data is
stored into the InnoDB storage engine of MySQL, which has support for
transactions and automatic crash recovery. We’ll always assume the MySQL
server is under load at the time of crash. If it were not, no recovery would
ever be needed.

Continua”Recover from a MySQL Crash”


May 21 2008

Optimize your MySQL database with OPTIMIZE

Tag:tepezcuintle @ 20:20

Optimized Fly

By Tepezcuintle
An Optimized table structure is different than a well-designed table. Table structure optimization has to do with reclaiming unused space after delitions and basically cleaning up the tables after a structural modifications have been made. The OPTIMIZE SQL command can help you take care of that.

mysql>OPTIMIZE TABLE table_name[,table_name]

Continua”Optimize your MySQL database with OPTIMIZE”


May 19 2008

How-To setup a MySQL replicating cluster

Tag:tepezcuintle @ 21:12

Fish out of the bowl
system administration Advanced Guides Mysql guides MySQL Replication

This guide is designed to help do the initial setup on a MySQL cluster in which multiple MySQL servers all serve the same content through the use of the replication function. We have successfully deployed this solution for multiple clients and it is a very good option for those needing a more powerful mysql solution. Carlos (theuruguayan) actually created this document so please direct any questions to carlos@totalserversolutions.com .

Be sure your mysql servers are running the same version before starting this guide, yes, is possible to have a few combinations of master-slave versions, for more information about this you can check:

Continua”How-To setup a MySQL replicating cluster”


May 19 2008

Quick dirty guide to NFS

Tag:tepezcuintle @ 21:03

Quick and Dirty

NFS Crash course
I wrote up a quick guide to setting up NFS awhile back but never published it. It is not exactly a nice and clean format but it is exactly what you need to be reading if you want a quick way to setup NFS between two servers. For the purpose of the guide I have added directions for the APF firewall, obviously anything else will work fine.

Continua”Quick dirty guide to NFS”


May 19 2008

Web Server Log Rotation and Analysis

Tag:tepezcuintle @ 20:32

Reading owl

Original Article found at: http://www.keithjbrown.co.uk/vworks/unix/logs.php

Workshop Requirements

In order to make the most of this workshop you should have:

  • Access to an Apache Server that you have permission to administer.
  • A good understanding of Apache Configuration.
  • The ability to install software on your system.

Introduction

Unlike many of the other workshops that are aimed at learning within a development environment, this workshop is really
only of use within a production environment where you are interested in logs, hits and web traffics in general.
That is not to say that you should not first use a development environment on which to practice, but you will only see
the benefit when properly deployed.

This Virtual Workshop will cover how to filter information that you don’t want out of your web
server logs
, how to implement
a log rotation strategy and how to automate the creation of log analysis reports using a variety of different software.
As I run my production servers in a Linux environment, there may be a slight bias towards a Linux way of doing things
(and because everything seems much easier to do with Linux). Efforts have been made throughout to ensure that the
majority of methods work with Windows as well.

What Don’t We Want to Keep?

This may seem like a strange question, but it is necessary to think about this as Apache can and will record a hit for
every file that is requested unless you tell it differently. This means that for one view of a web page every file that
is used on that page (images, CSS, external javascript etc) will be recorded as a hit. Most log analysis software will
sort out the actual page views etc when producing the stats, but unless you have specific desire to look at data to do
with images or stylesheets it is better to not even record it. There are also other things you may not wish to record,
such as search engine robots trawling your site or worms checking for files that IIS comes with in an attempt to gain
access to the server (we can adopt an air of superiority due to using Apache ;-). The effect of not recording all this
extra data means that the log files are kept significantly smaller as can be seen looking at two test logs which
record one week’s data.

Unfiltered:

-rw-r--r-- 1 keith keith 8967670 Mar 1 00:00 hits_log

Filtered:

-rw-r--r-- 1 keith keith 2562468 May 1 00:00 access_log

The unfiltered log is over three times as big as the filtered one. So having decided that we don’t want
to record all hits on the server we next need to set up the filters on the httpd.conf file. This is
done by creating a custom environmental variable then the existence of which (or not) acts as a filter when given as
an argument to the the CustomLog directive
(can be preceded by the not operator ‘!’). For example if we have created a filter called ‘mylogs‘:

CustomLog logs/access.log combined env=mylogs

This would
only log things hits that appeared in the filter. Or to ensure that everything EXCEPT the filter was logged:

CustomLog logs/access.log combined env=!mylogs

Obviously before a filter can be applied it must first be defined.

Continua”Web Server Log Rotation and Analysis”


Next Page »