Klovera.comBlog
Follow Us:

Turn off IPv6 CentOS and CSF

Dustin  |  Server Administration  |  September 5th 2010

If you are running csf on your CentOS server and run the server security check you may have seen the following message:

Check for IPv6: IPv6 appears to be enabled [ifconfig: ]. If ip6tables is installed, you should enable the csf IPv6 firewall (IPV6 in csf.conf). To disable IPv6 on RHEL/CentOS you should follow this link.

Upon following the link you end up at the login screen for access.redhat.com. Even after creating an account viewing the link requires a subscription. Seems a little odd that a subscription is required to find out how to disable IPv6…

So, here is how you do it:

  1. Log into the server as root
  2. Type in the following:
    # touch /etc/modprobe.d/disable-ipv6
    # echo "options ipv6 disable=1" >> /etc/modprobe.d/disable-ipv6
    

    Note: Slightly different prior to the 5.4 update. For more information on the above see this link on the centos wiki. Its a bit more helpful than the link provided in the csf notes.

  3. Restart the server

Changing back to default permissions

Dustin  |  Server Administration  |  November 7th 2008

When modifying file permissions it is sometimes necessary to go back to the drawing board and set back to the default permissions. The following command can be used via ssh and takes a couple seconds vs trying to do this via ftp file by file (which can take a very long time depending on the size of your website)

Change to the directory you want changed, then run these;

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

Will set permission for all files to 644 and all directories to 755.

This works for pretty much any Linux server.

Finally, how to set SpamAssasin!

Dustin  |  Server Administration  |  October 16th 2008

I proudly battle against spam on behalf of my clients! Running PLESK and SpamAssassin, it takes a lot of tweaks to make sure the mystery meat doesn’t get through. I recently came across the following and am currently testing it out. So far, its looking good!

Originally posted at www.jaguarpc.com by thisisit3

Read more

Transfer Horde emails to a new server

Dustin  |  Server Administration  |  October 5th 2008

We use Horde as one of the webmail solutions on our servers ( also using RoundCube and SquirrelMail ). Occasionally it becomes necessary to move the emails saved on the server to a new server or email account. This can easily be done with the Linux/Unix scp (secure copy) command.
Read more

Changing the name of Horde

Dustin  |  Server Administration  |  October 4th 2008

If you use Horde 3 as the webmail client for your clients you may want to customize the name of the login page to something more friendly to your business. You can do so by editing the ‘registry.php’ file in your configuration directory (on most my servers located at /etc/psa-horde/horde/). Toward the bottom you will find:

$this->applications['horde'] = array(
    'fileroot' => '/usr/share/psa-horde',
    'webroot' => $webroot,
    'initial_page' => 'login.php',
    'name' => _("Horde"),
    'status' => 'active',
    'templates' => '/usr/share/psa-horde/templates',
    'provides' => 'horde'
);

Change (“Horde”) to (“WhateverYouWant”). For me I changed it to (“DynamicMail”) seen below.

(Note: as of January 2010 Horde is no longer called DynamicMail on our servers)

Default Horde Theme

Dustin  |  Server Administration  |  October 4th 2008

If you would like have a different default theme other than the ‘Blue and White’ theme that ships with Horde 3 you can easily do so by editing the prefs.php located in the Horde conf-directory (on most my servers it is located at /etc/psa-horde/horde/). About 2/3rds of the way down in the file you will find:

// UI theme
$_prefs['theme'] = array(
    'value' => 'bluewhite',
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Select your color scheme.")
);

Change ‘bluewhite’ to the directory name of the theme you would like to use as the default. A great theme I use that does not ship with Horde is WPS Sober found here (read the README.txt in the download for installation directions). If you go with the WPS Sober you would change ‘bluewhite’ to ‘wps_sober’ after installing the theme.

Enjoy!

Removing news feeds from Horde

Dustin  |  Server Administration  |  May 7th 2008

If you’ve used newer versions of Horde with Plesk, you have probably seen the news feed that runs down the left side of the screen. This newsbar is irritating at best. Here is how to get rid of it.

Open the following file in your text editor:

/usr/share/psa-horde/templates/portal/sidebar.inc

Around line 102 comment out the entire if() statement (lines 102-117).

If you upgrade Plesk, you will most likely have to repeat this process.

.htaccess redirect based on requested domain

Dustin  |  Server Administration  |  May 7th 2008

I often use the following .htaccess / mod_rewrite solution to redirect domain names based on the requested domain. The reasons for this are many. Most recent example for me is I had a single site with 5 alias domains but software licensed for only one. Even though I had the alias domains set up on the server it still did not satisfy the license. Add the line below to htaccess and now no matter which of the 5 domains are written in they are re-written to the one with the licence (need to duplicate for each domain). The license is valid since its all the same physical website and everyone is happy. Brilliant!

I am sure there is a more eloquent way of accomplishing this with mod_rewrite – but this gets the job done!

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?yourdomain\.com [NC]
RewriteRule ^(.*)$ http://otherdomain.com/$1 [R=301,L]

Can also be used to redirect to a landing page based on the requested domain:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.domain.com
Rewriterule ^(.*)$ http://www.any-domain.com/landing-page.html [L]

Have a better solution? I’m no mod_rewrite guru so comments are always welcome!

Klovera is a forward thinking, full service digital agency whose purpose is to bring value to our client's businesses through creativity, strategy, metrics, user experience and technology.