In order to have a better idea of what is the IO performance on an Internet server here is a small tool that would make relative good IO(disk performance) tests. apt-get install iozone3 iozone -I -T -t 5 -r 64k -s 2G -i 0 -i 1 -i 2 -c -e The results are easy to …
Author: admin
Creating a XEN machine and Installing Group Office in Debian Wheezy
Introduction In this Tutorial I will explain the steps I did to create a Xen Virtual Machine with minimal packages and then install the latest Group Office Web based Collaboration software. You’ll need to be fluent in Linux and Xen because I don’t explain much here. Note: My hypervisor is Xen 4.0 in Debian Squeeze …
vhosts calling themselves behind load balancer
PROBLEM: If a virtualhost configured behind a load balancer originated http/https, requests using the proxy module in destination to the Internet IP of the virtual host, the route of the packet would then have to be: Vhost ==ProxyModule==>> LoadBalancer ==>> Loop to itself ==>> Vhost For technical reasons I needed to avoid this route. This …
Changing the terminal keyboard type and language in Debian Wheezy
dpkg-reconfigure keyboard-configuration
Mounting extVFAT in Linux
If the kernel has not yet the capability of of handling exFAT filesystem here is how to add it as a user space capability in a Debian/Ubuntu system: sudo -s apt-add-repository ppa:relan/exfat apt-get install fuse-exfat
Adding dynamicall a new Virtual Disk in Linux in VMWare
for i in $(ls /sys/class/scsi_host); do echo “- – -” > /sys/class/scsi_host/$i/scan ; done
Some tools for SSL certificates
Checking that a certificate is paired to the key Example: openssl rsa -noout -modulus -in mycert.key |openssl md5 33c63cb62080fdf2bc06c47a59e02917 openssl x509 -noout -modulus -in mycert.crt |openssl md5 33c63cb62080fdf2bc06c47a59e02917 Both results should be the same Generating a certificate for VSFTP openssl req -x509 -nodes -days 3650 -newkey rsa:1024 -keyout /etc/ssl/certs/vsftpd.pem -out /etc/ssl/certs/vsftpd.pem Creating a self signed …
Setting-up Chroot for SSH and for SFTP
There are many ways to create Chroot for SSH here are 2 good links for that. http://www.debian.org/doc/manuals/securing-debian-howto/ap-chroot-ssh-env.en.html http://www.howtoforge.com/chrooted_ssh_howto_debian Note: Here some more info on the subject. The following article is based on an extract of the following site: http://www.howtoforge.com/restricting-users-to-sftp-plus-setting-up-chrooted-ssh-sftp-debian-squeeze Enabling chrooted SSH Enabling chrooted SSH is a bit complicated because we must set up a …
Turning OFF security checks in SSH server
In order to turn OFF security checks in SSH connections set the folwoing configuration in the SSH server in /etc/ssh/sshd_config: UserKnownHostsFile=/dev/null StrictHostKeyChecking=no LogLevel=error This will also work if key forwarding is set as well.
Expanding a VMWare external volume
Description: The task here is simply to raise the zize of a data volume attached to a VMWare virtual machine. Steps: 1. Stop the instance that is attached to the volume to be expanded. 2. Create a snapshot of the volume. 3. Create a new volume from the snapshot. There you have the possibility to …
Limiting connections per Virtual Host with mod_bw
Introduction: In order to limit the number of simultaneous connections to a Web server (for the whole server) the following Core directive is used in our Live web servers, limiting it to 2000 simultaneous connections per web server. MaxClients 2000 In the case of wanting to limit the number of simultaneous connections per VirtualHost we …
Installing extFAT in Linux Mint(Debian/Ubuntu)
This article is based on the following link of which I’m really thanful: https://paraaether.wordpress.com/2012/09/08/mount-exfat-filesystems-under-linux-mint-ubuntu/ Problem: Lately a new file system format meant for external flash-memory cards, Camera ssd cards and Smart phones is been develloped by Microsoft called ‘extFAT’. It allows to overcome the barrier of 4GB for single files and is more efficient for …
snmpd error on subcontainer ‘ia_addr’ insert (-1)
This message is flooding my syslog on each snmp query. snmpd[3916]: error on subcontainer ‘ia_addr’ insert (-1) snmpd[3916]: error on subcontainer ‘ia_addr’ insert (-1) snmpd[3916]: error on subcontainer ‘ia_addr’ insert (-1) To avoid it you have to change the log level of the services. In debian squeeze edit /etc/default/snmpd and change these lines: SNMPDOPTS=’-Lsd -Lf …
Configuring Debian Wheezy Xen 4.1 Hypervisor
Introduction: When I upgraded from Debian Lenny Xen 3.2.1 to Squeeze Xen 4.0, except for the DOMu hard disks names (from /dev/hdax to /dev/xvdax), I had very little changes to do and all went pretty well. Lately I wanted to upgrade from Squeeze Xen 4.0 to Wheezy Xen 4.1 and I had a few very …
Rebuild MySQL replication slave LIVE from master
Problem: You have 2 MySQL servers in the configuration Master ==>> Slave and the slave has gone very badly out of sync with the master. Normally it’s no real problem if you can lock the master tables, make a dump of the databases of the master and import them back into the slave. But the …
Encryp and decrypt files using GnuPG, Mcrypt and OpenSSL
Although there are many tutorials concerning encrypting files sometimes one wants just to encrypt/decrypt files with only a passphrase. This what this article is about. This article is based on the great tutorials found at: http://bitflop.com/document/86. For a fuller Tutorial on GnuPG: http://bitflop.com/document/129 Thanks to the author for the good work. GnuPG Encryption: $ gpg …
Redirect POST requests
Since quite a while it was not possible to use the Apache mod_rewrite to redirect POST resquests. After the browser received a redirect response code 301(permanent) or 302(temporary) from a POST request it redirected the request to the new URL but using a GET method. After research I found out that since some time the …
Converting character sets in text
Following a problem I had when trying to checkout old files from CVS repository I found out how to display the hex value of certain characters and how to convert them as well. Most older filenames have been encoded with the character set ISO-8859-1(latin-1) or ISO-8859-2(European) or ISO-8859-15(European+EURO sign). Mopst new systems are working with …
Installation of GIT, Gitolite and Gitweb in Debian Squeeze
Note: This tutorial is based on this very good site, thanks for the work: http://geroldm.com/2011/10/howto-setup-gitolite-in-debian/ Introduction: This is a simple and step by step tutorial on how to install GIT server and Gitolite in Debian Squeeze.Since GIT has no authentication/authrization methods on its own Gitolite does fill in. Gitolite allows to control new creation of …
Some useful commands for Zimbra
Show the expiry date of the installed certificate: Run as root user: /opt/zimbra/bin/zmcertmgr viewdeployedcrt all |grep notAfter Restart all the Zimbra services Run as zimbra user: zmcontrol stop ; zmcontrol start Check the status of all running Zimbra services: Run as zimbra user: zmcontrol status Display the version of the current Zimbra: Run as zimbra …
Configuring Zimbra to deliver mail using SSL/TLS
Reference: http://wiki.zimbra.com/index.php?title=Outgoing_SMTP_Authentication#Enable_TLS ssh root@server.mydomain.com su – zimbra zmlocalconfig -e postfix_smtp_tls_security_level=may zmcontrol restart Sent an email to normal postfix server: Check the headers of received email: Received: from server.mydomain.com (static.66.240.40.188.clients.your-server.de [188.40.240.66]) by mail.mydomain.com (Postfix) with ESMTPS id E457F3E09E for ; Fri, 19 Apr 2013 23:35:31 +0200 (CEST) Sent to GMAIL server: Received: from server.mydomain.com (static.66.240.40.188.clients.your-server.de. [188.40.240.66]) …
Basics of Linux Logical Volume Manager
Concept: Physical Volume(PV): Real partition which can be assigned to a pool of resource to create/manage logical volumesLogical Volume Group(LG): Pool of resources (partitions) which can be used to create/manage Logical volumesLogical Volumes(LV): Logical Partitions which can be formatted and used just like a normal partition. The difference is that these Logical Partitions can be …
php5-cgi fills up memory, too many processes.
Problem Description: I just solved a strange situation where peu-à-peu the number of php5-cgi processes kept on increasing till all the RAMS were used and the system went to a crawl no more responding to web requests. Cause: After the maximum number of requests got reached for a php5-cgi requests the process gets detached from …
Converting Windows text files to Linux
Here is a small overview of how (in)compatible computer operating systems are. Normal text files end the lines as follows: Windows: CR+LF Linux: LF OS X: CR In order to convert line ends here are few tricks I extracted from this page(many thanks to the author): http://kb.iu.edu/data/acux.html dos2unix and unix2dos The utilities dos2unix and unix2dos …
Deleting files securely
To erase files recursively in a specific directory with best security and make it almost impossible to recover any of the files in that directory, run the following command: cd /dir/where/to/delete/files/ find . -type f | while read file ; do shred –verbose –remove –zero -n 10 $file ; done I say almost because the …
WARN: nodename xxxx uuid changed yyyy
Reference: This a complete ‘copy’ of the very useful info page at this link: http://www.pc-professionals.com/blog/cloning-a-linux-heartbeat-3-node/ Some heartbeat problems when starting: While setting up a Linux Heartbeat failover cluster, you may be tempted to set up one server node and clone the machine to create the other nodes that will make up your cluster. This is …
Install Geotrust certificate in Zimbra 8.x
The best way to install a RapidSSL cert is via the CLI as the root user. Reference: (18-12-2012 @ 23:39 BST) http://elijahpaul.co.uk/2012/12/installing-a-rapidssl-certificate-on-zimbra-8-0/#.UVjDBhlSP5g 1. Start by logging into your Zimbra servers CLI via SSH. 2. As root begin by generating a Certificate Signing Request (CSR). Below replace ‘mail.yourdomain.com’ with the FQDN of your Zimbra server. /opt/zimbra/bin/zmcertmgr …
Configuring DKIM Authentication in Zimbra
Configuring Zimbra 8.x to use DKIM Authentication Example for ‘mydomain.com’ ssh root@zimbra.mydomain.com su – zimbra Creating the DKIM keys for a domain: /opt/zimbra/libexec/zmdkimkeyutil -a -d mydomain.com Example of result: 50F0EEFE-AB8C-11E2-B7AE-FC2CE654A0ED._domainkey IN TXT ( “v=DKIM1; k=rsa; ” “p=MIGfMA0GCSqGSIb3DQEBAQUCA4GNADCBiQKBgQDodIcoFWJsfsSzsdINY/ZiOKn3qKLt+qmEl1cDYApi0PCHwQmqTl9mhRKs3obfgN8O9nT227CDg9NI7MMu8r0fOatQRQ1YHesDmHIo1lELioDNd5QZPg1AUum0CPsDuR+YI5AG5wZhZ4c3ei0Uv3cu4aTIhGrRgnD081sysJ5vZwIDAQAB” ) ; —– DKIM key 50F0EEFE-AB8C-11E2-B7AE-FC2CE654A0ED for mydomain.com IMPORTANT: Enter the above result as TXT field in the …
Verifying Web Server certificates
In the world of so many types and variations of available certificates it is sometimes difficult to be sure that the components of a certificate are fitting together. For this purposes here are some commands that will help. Verifying the a certificate chain Whether the certificates are WEB certificates or CA(Certificate of Authority) all the …
Install Geotrust/RapidSSL certificate in Zimbra 8.0.x
This How-to is based on the following page and after failing to install myself my commercial certificate I feel very grateful for his contribution: http://elijahpaul.co.uk/2012/12/installing-a-rapidssl-certificate-on-zimbra-8-0/#.UVjDBhlSP5g The best way to install a RapidSSL cert is via the CLI as the root user. 1. Start by logging as root superuser into your Zimbra servers CLI via SSH. …
Display UUID of a partition in Debian Squeeze
To display the UUID of all the found partitions in system and their /dev/… equivalent issue the command: ls -l /dev/disk/by-uuid/
resolving addresses starting with /etc/hosts
Introduction: as most Linux administrators know if you type the command, for example: host my.domain.com You get the resolving of the address ONLY through DNS resolving and NOT using the local /etc/hosts file first. Of course if you use the command: ping my.domain.com You get to see the IP which with be tried to be …
Installing an Ubuntu 12.0.4 LTS as Xen DOMu in Debian Squeeze hypervisor
Lately I needed to install Zimbra 8.0.3 which only installs easily in an Ubuntu 10.0.4 or 12.0.4 LTS system. So I decided for that to install an Ubuntu 12.0.4 LTS as Xen DOMu in a Debian Squeeze Xen Hypervisor and here is how I did it. The following commands can be put into a runnable …
Installing OpenDKIM in Debian Squeeze/Wheezy
Introduction Lately my mail server started to get refusals of emails from large mailing systems like AOL, Yahoo etc. I can’t blame them for trying to minimize the SPAMS to their clients. Although using an approved relay service is a good solution, if you want to take care of it yourself here is OpenDKIM at …
Using pyGRUB on Squeeze/Wheezy to boot a domU kernel
This adapded article is based on the following Debian Wiki article: http://wiki.debian.org/PyGrub In this article I assume: – The reader is familiar with Linux and Xen Hypervisor – The DOMu system partition is using a file image instead of a physical partition. Introduction: This method offers the advantage of loading the kernel which is installed …
Synchronization of directories with GlusterFS between 2 Debian/Ubuntu hosts
There are many methods existing on the market to synchronize content of directories between hosts. eg. rsync, lsyncd, duplicity etc. The most difficult part though is bidirectionally synchronize them so that no conflicts occur. One method is using the program Unison which works well but if a file gets modified differently on both servers between …
Compiling an Apache module after Apache is been compiled
Sometimes one discovers a module which would be lovely to include in an already compiled Apache. I’m using here an example of a vanilla Apache I compiled. Constants: Source path of Apache: /www/src/ Path of compiled Apache: /www/apache/ Module to compile: proxy_http Compiling the module: cd /www/src/modules/proxy /www/apache/bin/apxs -i -a -c mod_proxy_http.c This will: – …
Installing Linux Remote Terminal using VNC on a Debian Server
Here are the instructions on how to install an efficient Linux remote desktop (XCFE) using VNC. apt-get install xorg xfce4 xfce4-goodies vnc4server Note: If you want to change the initial VNC port edit the file: /usr/bin/vnc4server and change the port as follows: eg. to change the vnc ports to start at 8081 ‘$vncPort = 8080 …
‘blocked by Verizon Online’s anti-spam system…’ OR ‘AOL: refused to talk to me: 554- (RTR:BL)’ OR ‘AT&T: blocked by ldap:ou=rblmx,dc=att,dc=net’
Lately I’ve been confronted with the following error messages from my Postfix server form AOL, Verizon or AT&T: VERIZON: ‘blocked by Verizon Online’s anti-spam system… AOL: refused to talk to me: 554- (RTR:BL)…. AT&T: blocked by ldap:ou=rblmx,dc=att,dc=net…. Moreover after trying to get my server on the whitelist it seemed almost impossible or quite a long …
Scan linux system for viruses with Clamav
Command: /usr/bin/clamscan -r -i /start/directory
Load Balancing with Apache
Introduction: I’ve been confronted with the task of installing 2 web servers and a load balancer all made of Apache2. Requirements: – 1 Load balancer made of apache2 configured for 2 Web sites – The load balancer should implement Cookies based stikyness for clients to land all their requests on the same web server initially …
Changing the URL of WordPress
Lately after a friend had develloped a new web site under (eg.)new.mywebsite.com when it needed to go live to www.mywebsite.com although the admin settings were changed and the Apache configuration as well, many links still were pointing to new.mywebsite.com. Now what to do? I searched the Net and found this great beb site which explains …
Combining Apache PHP module and fcgi in Debian Squeeze/Wheezy
Many help sites that show you how to install and configure the Apache module mod_fcgid ask you to uninstall the Generic Apache PHP module(mod_php5). Although mod_fcgid offers some advantages to the mod_php5, uninstalling the mod_php5 need not be, especially if you are running applications that don’t need to run under mod_fcgid and it uses simple …
Warning: curl_exec() has been disabled for security reasons
In Powerpress plugin of WordPress I’ve been confronted with this error: Warning: curl_exec() has been disabled for security reasons Many people suggested a hack into the functions.php of WordPress. I find this solution not very good, since it’s most likely all gone after an update of WordPress. After looking for a better solution in Google …
intermitent dovecot imap login problem
I set-up dovecot as mail pic-up server for IMAP and POP3. If I left my webmail(roundcube) interface running on my browser, I experienced very often that as soon as I started an Apple mail product (iPad,iPhone or Mail on OSX the IMAP complained that my login failed and asked for typing my password. Normally the …
logrotate /usr/bin/mysqladmin: refresh failed; error: ‘Unknown error’
Problem: After a fresh install of Debian Squeeze and mysql server, started to appear the following error as email from cron: /etc/cron.daily/logrotate: /usr/bin/mysqladmin: refresh failed; error: ‘Unknown error’ error: error running shared postrotate script for ‘/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log ‘ run-parts: /etc/cron.daily/logrotate exited with return code 1 Cause: After the installation of mysql-server package, the first …
Mysql Loop replicating in Debian Squeeze
I have been doing replicating from master to Slave for quite a while and sometimes found it a bit limited especially when the master in down and ‘writes’ need to be done to the databases. Here is a method where no matter which server is down you can always write to it and the changes …
Configuring vacation response on incoming emails
This configuration is made to respond to each incoming email by an automated message. It is inspired from the site: http://www.akadia.com/services/automatic_email_answering.html In Debian: Install the package vacation apt-get install vacation Assumptions: System User: marie Email address: marie.larue@myserver.com Configuration: Initialize the database file ~/.vacation.db sudo -u marie vacation -I Create the following 2 files in the …
PHP problem of ‘basedir-open’
After having upgraded Apache, PHP and other PHP modules I found out that we had problems with errors regarding restrictions of opening files within the set htdocs directory. I found that out by enabling error messages to be shown in the php.ini file. After researches on Internet I found those sites where they also had …
Installing ISTATD on Debian Squeeze/Wheezy
This HOW-TO is almost completely based on the README.txt file included in ISTATD package I included some adaptation notes. istatd is a daemon serving statistics to your iStat iPhone application from Linux, Solaris & FreeBSD. istatd collects data such as CPU, memory, network and disk usage and keeps the history. Once connecting from the iPhone …
Unlocking dpkg in Debian Squeeze
Problem Description: Although it can happen very rarely sometimes the dpkg, run by apt-get or aptitude, gets confused and leaves the lock on the mounting of its database open after being terminated. This prevents any further operations on installing, updating or configuring packages. The error would look like this: debconf: DbDriver “config”: /var/cache/debconf/config.dat is locked …
Securely transfering a key or a private file via email
Often when seeting-up a VPN or other similar mechanism we need to transfer securely a private key or a list of passwords or anything very private to another party via email without running the risks of the man-in-the-middle snoopin on it. Here is a method using OpenSSL which is available in Linux. Sending a one …
Detecting Browser User Agent in Mod_Rewrite
Apache mod_rewrite can be used to detect whether a browser has a WAP or Smartphone device versus a normal size browser and act accordingly. Here is a method: Creating variables for different sorts of portable devices: # Wap devices BrowserMatch “MIDP” WAP_DEVICE BrowserMatch “CLDC” WAP_DEVICE BrowserMatch “UP\.” WAP_DEVICE BrowserMatch “HTC” WAP_DEVICE BrowserMatch “LG” WAP_DEVICE BrowserMatch …
Installing Google’s Apache mod_pagespeed module.
Google has recently published an Apache module which should optimize web sites delivery daynamically. I was quite suspicious about such tool and though that this could only work at the costs of page outlook quality, meaning web pages not being displayed quite the same as the original. After experimenting with it I was quite please …
Compiling and Installing Darwin Streaming Server on Debian Squeeze
I used to run Darwin Streaming Server Version 5.5.5 and ran quite well. In order to be able to take advantage of the new features and stability of the 6.0.3 I tried to compile it in Debian Squeeze Linux and it didn’t work at all. I got many compiling warnings and errors which at the …
Configuring Apache2 mod_deflate
Here are some recommended settings of the mod_deflate in Apache2. The main principle is to define which type of files are and which ones are not to be compressed. These settings DON’T override the fact that if a device/browser doesn’t have the following header in its request the requested file/component will NOT be compressed at …
Troubleshooting nameservers(DNS) using dig
In order to find out where the domain resolving fails here are some tricks using the command dig to trace the recursion step by step till the DNS that fails to deliver the IP of the requested [sub]domain. Reference site: https://nsrc.org/workshops/2005/pre-SANOG-VI/bc/dns/dns2-02-dig-debug.html Tracing a well resolving domain: So first we start by asking one of the …
Synchronizing mirror directories in Linux
Task: Keep multiple web server’s htdocs files in sync. One way to do it is to write a script as cronjob which synchronizes the main server’s configuration directories to all other servers. But there are more elegant ways to do it: GlusterFS and lsyncd. This article relates to the later: lsyncd This deamon process uses …
Using Environment variables in Apache rewrite rules
Problem: Setting multiple variables(%1-%9) in rewrite rules with RewriteCond will get rewritten by the subsequent RewriteCond for the same rewrite rule pack. eg. RewriteCond %{REQUEST_URI} ID([^/]+) RewriteCond %{REQUEST_URI} ID2([^/]+) RewriteRule ^/login.php /newlogin.php?NewID=%1&NewID2=%2 The above rule is not practical in real world, there are better ways to do this. But just as an example, we can …
Setting a Cookie from Query String
In some very special task we needed (don’t ask me why) to use the value of the Query string to set a response cookie. Meaning we grab the query string in a format of Name=value to set a cookie in the response header. eg. http://www.myserver.com/myimage.gif?mycookie=myvalue sets the cookie in the client’s browser as: Name of …
HowTo Flush Linux dns cache
This article is bee extracted from the URL: http://www.inetdaemon.com/tutorials/internet/dns/servers/caching.shtml of which many thanks for posting the article. I extracted what I needed and posted it again here mostly for me as a reminder. HowTo: Flush nscd dns cache Nscd caches libc-issued requests to the Name Service. If retrieving NSS data is fairly expensive, nscd is …
Authentifying with Active Directory-LDAP users via Linux LDAP tools.
I’ve got a project where we needed to make sure the user had to be authenticated against Windows Active Directory. This is what helped me. Install the LDAP tools: (Example in Debian) apt-get install ldap-utils Command to authenticate Note: the user(Username) registered in Active Directory DN(DC=ad,DC=domain,DC=net). (Return code of command should be 0 if successful) …
Flushing mySQL Binary logs
In order to keep the disk usage of the binlogs down while having replication, it is necessary to periodically perform a PURGE BINARY LOGS command. Please keep in mind that it is important to ensure that you don’t remove any binlogs that are still needed by the replicas. For example: PURGE BINARY LOGS BEFORE ‘2008-04-02 …
Activating TRIM for SSDs on MAC OSX Lion
Did you just buy an SSD for your MAC running Lion and would like to get the best of it? A short explanation: In normal hard disks when a file or directory is been erased, in fact the space used by the file or directory is simply put back on the unused space list. Nothing …
Creating a new Xen DOMU Debian Squeeze image file(bootstrapping)
Here is a short example with many options given which creates a new Debian Squeeze Xen 4.0x image file. The command will create a 25GB Debian Squeeze Image file in the LVM:’vservers’ which will run the 32 bit kernel 2.6.26-2-xen-686 with 2GB of RAM and 1GB of SWAP file with root password ‘changeme’. Note: remember …
Installing eAccelerator for PHP in Debian Squeeze
This great application really speeds-up the processing and therefore delivery of complex web sites based on PHP, for example from CMS like Typo3. Here is how to install it. Credits FROM: http://www.debiantutorials.com/installing-eaccelerator/ and https://github.com/eaccelerator/eaccelerator/wiki/InstallFromSource Instructions in German: http://www.sysadminslife.com/linux/eaccelerator-php-beschleuniger-installation-unter-debian-5-lenny-und-ubuntu/ Download it cd /tmp wget http://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-0.9.6.1.tar.bz2 Unpack it tar -xvjf eaccelerator-0.9.6.1.tar.bz2 Prepare for compiling it apt-get install …
Find and kill processes that prevent unmounting
Sometimes I try to unmount a storage device and it says that it cannot unmount because a process is using it. Now how to find this/these processes and kill them so I can unmount the device? Here is one way to do it. Long and careful way, step by step: # Find out the mount …
Change MAC address in Linux
In some situations if one needs to change the MAC address of an ethernet card here is the way: ifconfig eth0 down ifconfig eth0 hw ether [new mac address] ifconfig eht0 up ifconfig eth0 And see you brand new ethernet address. have fun hacking 🙂
ERROR: Connection dropped by IMAP server
Problem: Lately I had the problem that some users could not log-in into their webmail(Squirrelmail). Squirrelmail answered: “ERROR: Connection dropped by IMAP server”. Looking into the logs I found the following lines: Jul 5 10:39:43 ms41 dovecot: imap-login: Login: user=user1>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured Jul 5 10:39:43 ms41 dovecot: IMAP(user1): mail_location not set and autodetection …
Running Postfix on multiple ports
Reference: The following Tip is been taken from the following forum: http://www.howtoforge.com/forums/archive/index.php/t-4788.html Description: Some ISPs, for some strange reasons, are blocking the port 25, therefore preventing many normal email clients software from picking-up their emails from other mail servers than their own ISP’s server. Solution: Making sure Postfix on your mail server listens on both …
Protect specific email clients
In my mailing list system (Mailman) I needed to make sure that no one else than a certain list of senders would be able to send commands via email to the xxxx-request@mylist.com. Since I could not find this feature in Mailman I decided to go the Postfix way. So here is the configuration I made …
Solving the problem of MaxRequestLen in mod_fcgid
Sometimes we get the following message in error.log and sometimes not. The reason is that the size of MaxRequestLen is not high enough: mod_fcgid: HTTP request length 135714 (so far) exceeds MaxRequestLen (131072) Solution: Add the following entry in the file: /etc/apache2/mods-available/fcgid.conf raise the value from the default 131072 to 15728640 (15MB) or higher if …
Compiling and install the missing dotdeb php5-fileinfo package
Dotdeb has done a terrific job at precompiling some PHP 5 packages and environment for us. Unfortunately in Dotdeb version of Debian Squeeze PHP5 packages I found the package php5-fileinfo to be missing. So here are the blind steps (without explanations) on how to compile and install this package. This is just an example unig …
Configuring heartbeat
Introduction: This HOW-TO will describe with very few explanations how to minimally configure Heartbeat software for the purpose of automatically switching a virtual IP from one server to another when the default server fails. Here a ‘Virtual IP’ will be switched from one server to another depending on which one is available. Install heartbeat: apt-get …
Using TLS for mail delivery from postfix to another TLS activated mail server
Introduction: The default encryption method for delivering email from Postfix to another mail server is ‘NONE’ In certain cases for enhanced security reasons emails for certain destinations should be encrypted all the way: Meaning: Client 1 ==(TLS)==> Postfix Server ==TLS==> Other email Server ==SSL/TLS==> Client 2 In this case we cannot influence the way the …
VPN Server and clients HOW-TO
Hi Folks, there are a lot of VPN howtos out there and here I am making one more. Well if the format I’m putting it in helps for some of you to install your VPN, great. That is all I’m wishing for, and besides because I have a very short memory every time I discover …
Upgrade Debian using an .iso file
Here are simple steps on how to dist-upgrade a Debian system using an ISO file. Normally the process would be quite simple by replacing the entries in the repository list and call a command apt-get update; apt-get disp-upgrade. BUT what if your system doesn’t have Internet acccess while you want to do the upgrade? Here …
Forcing a keep-alive in ssh sessions
The following configuration will prevent an SSH session to terminate automatically upon long time of inactivity: File: ~/.ssh/config Content: Host * Protocol 2 TCPKeepAlive yes ServerAliveInterval 60 StrictHostKeyChecking = no
REF: Installing packages in different Linux Distributions
Distro URL Command ====== ======================== ============================ Debian (http://www.debian.org) apt-get install packagename Ubuntu (http://ubuntulinux.org) apt-get install packagename Suse (http://www.opensuse.org) yast -i packagename Fedora Core (http://fedoraproject.org) yum install packagename FreeBSD (http://www.freebsd.org) pkg_add -r packagename Gentoo (http://www.gentoo.org) emerge packagename OpenBSD (http://www.openbsd.org) pkg_add -r packagename
Remotely Install Debian using bootstrapping
Introduction: Imagine you have rented a system at a provider where you want to install remotely a totally new Debian Squeeze from scratch. You will need the following components: – A Remote KVM Switch where you can view and control the system via a console remotely. – A knoppix or any relatively recent bootable live …
Change the bash session timeout
Sometimes we need to have a longer bash session timeout value to be able to stay logged-in while nothing is happening on the terminal. Here is the setting you can include in your .bashrc or .profile files: export TMOUT=0 This will set the shell session to have no timeout duration. export TMOUT=345600 This will set …
Using cache control with Apache
This article has no structure really. It is a gathering of important information and own findings concerning caching of web elements. Caching controls of web elements General rules: – The header ‘Expires:’ is an implementation of the HTTP/1.0 – The header ‘Cache-Control: max-age=xxxx’ is an implementation of the HTTP/1.1 and OVERRIDES ‘Expires:’ Extract from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html: …
Install a load balanced SVN system
Until I create my own docs here, I suggest you have a look at the following page from which I’m going to base my own version here anyway. http://www.devx.com/opensource/Article/39525/1954
Rebuild a mirror SVN from a master repository
There are a few ways to create a mirror SVN repository from a master repository. Some are slower than others but all of the ones mentioned below are reliable. The standard way: (All operations below are done on the mirror server) – Delete the old mirror repository – svnadmin create {path of repo} – svnsync …
Force aptitude/apt-get ingoring broken dependencies
In the case we absolutely need to install a special Debian package, from backports for example, and force it to ignore dependencies using aptitude download and dpkg –force-depends, your apt-get and aptitude will always complain later on about it and not resume its given commands until we resolve this dependency. So when you know what …
bash – how to find a variable string length
This short how-to shows how to find out a string length in bash: Copied from the very useful web site: http://unstableme.blogspot.com/2008/03/find-string-length-bash.html Suppose: $ VAR=”Bash Scripting” Now to find the length of the above string, I have found 3 different ways: $ echo “${#VAR}” 14 $ expr length “$VAR” 14 $ echo $VAR | awk ‘{print …
Compiling and Installing the latest SVN system.
Here is an example of how to compile and install the latest SVN system in Debian. At the time of writing the latest stable version was 1.6.17. Because this method contains all the dependencies of SVN compiling, it can probably be used in many types of Linux distributions. Here are only commands to run as …
Resetting the default screen resolution in MAC OS X 10.6.x (Snow Leopard)
Just as I thought that Mac was having it perfect in the area of screen resolution and detection, suddenly my MacBook Pro started to display a slightly zoommed-up screeen where I needed to bring the mouse to the edges of the screen to move it a bit and see the rest of the display. Tried …
Installing CACTI and Templates on Debian Lenny/Squeeze
In the area of monitoring systems using GPL software Nagios is a big player but the organization of displaying the history graphs is not so ideal. Zabbix is wonderful as well, it produces also good graphs but it creates them dynamically, resulting in a long wait time when we need to display a large amount …
Getting wireless Broadcom BCM4313 to work in Linux Mint 11
Unfortunately as of today June 19, the repository drivers of Wireless Broadcom BCM4313(wl.ko) don’t work well at all in Linux Mint 11. After making some research on Google I found out that there are new Linux drivers provided by the manufacturer Broadcom that simply need to be downloaded and installed. I did it and it …
Create a mixed (routed & bridged) private VLAN for Xen Virtual Machines
The most common way of configuring the networking in Xen environment is by using bridges. In the case of servers rented at Hetzner provider (Germany) this would not work because the infrastructure is allowing only one MAC address per server. It allows for multiple IPs but only one MAC address. To circumvent this situation we …
Use IPTables to load-balance web trafic
Although the Linux Kernel has already a load-balancing feature, it doesn’t come without the price of having to learn how to use it. Some tools like ‘LVS-KISS’ can help to do that job but still a bit too much sometimes when one want just crude load-balancing without any fall-back features. Here is a simple solution …
Installing Xen 4.x in Debian Squeeze (6.0)
Here are the minimum steps necessary to install Xen Hypervisor 4.x on Debian Squeeze. Installing the hypervisor and tools related aptitude install xen-linux-system-2.6-xen-amd64 xen-hypervisor-4.0-amd64 linux-image-xen-amd64 xen-qemu-dm-4.0 Change some system configuration Edit /etc/modules and add the following entry. To make sure the module ‘loop’ can create 64 loop connections. The entry ‘loop’ might already be there, …
Installing Debian ‘testing’ packages in ‘stable’ system.
Sometimes we want to install a package that is in testing state into a stable system. To do so, just follow the instructions below. NOTE: The following tips have been copied from the link: http://forums.spry.com/debian/620-how-install-testing-packages-debian-stable-apt-get.html The solution for keeping stable and installing the package is to modify apt-get configuration to setup what is called a …
Recover files from a deleted ext3 partition
What a disaster to find that your File Allocation Table is been destroyed. Well there is a possible light at the end of the tunnel. Scenario: Partition to recover: /dev/sdb2 HOW-TO – Find out where the SuperBlock got backed-up with the command mke2fs -n This gives you all the locations where the SuperBlock is back-up …
Installing SAR monitoring tools
NOTE: This article is a copy of the Geek Stuff Article at: 10 Useful Sar (Sysstat) Examples for UNIX / Linux Performance Monitoring Tanks for the tips. I have copied it to make sure this important article stays part of this tips collection. Intro: Using sar you can monitor performance of various Linux subsystems (CPU, …
Assigning CPUs to Xen virtual Machines
Introduction: I’m renting a 8 CPU machine at Hetzner and I wanted to improve the performance. At the beginning I was distributing many CPUs to the virtual machines which needed it and less cpus to others. This included that some cpus would be shared by more than one Xen virtual machine. I noticed that the …
Installing Bacula Backup system on Debian Lenny
These following instructions will download, compile and install Bacula and a couple of the best Web GUIs for it. Inspired from the following German link. Thank you: http://www.asconix.com/howtos/debian/bacula-backup-debian-lenny-howto Install needed packages for Bacula server aptitude install build-essential libpq-dev libncurses5-dev libssl-dev psmisc mysql-server libmysql++-dev Download compile and install Bacuda and its web GUI wget http://downloads.sourceforge.net/project/bacula/bacula/5.0.3/bacula-5.0.3.tar.gz tar …
Web client authentication using SSL/PKI and PHP
To authenticate web clients using a browser is no difficulty when one has imported the PKI certificate in the browser. But how can we do that with a php driven process and use it as client. Here is some short PHP code that will do exactly that. Note: the CA, PKI certificate(CRT) and private key(KEY) …
Installing and configuring Apache2 mod_secutity on Debian Squeeze
Install the Debian version of mod_security packages from Debian reposirory apt-get install libapache-mod-security Create an Apache config directory for mod_security mkdir /etc/apache2/modsecurity-core-rules chmod 600 /etc/apache2/modsecurity-core-rules Download and install the mod_security core rules wget http://www.modsecurity.org/download/modsecurity-core-rules_2.5-1.6.1.tar.gz tar vfx modsecurity-core-rules_2.5-1.6.1.tar.gz -C /etc/apache2/modsecurity-core-rules/ Create a symlink to adapt to all mod_security core rules(or change all the rules 🙂 ln …