DUNTUK

A web and systems development journal (from a–too busy–web developer who does a lot of various IT work.)

Server

FAQs/HOW-TOs related to server administration.

Disable IE "compatibility mode" through .htaccess

Last updated: Sun, 04/14/2013 - 12:32am

Internet Explorer "compatibility mode" is that dreadful page icon, inconveniently placed right next to the refresh button/icon.

What it does is turn IE 8 or higher into an outdated browser, so it can properly display really old school websites that were, likely, built using invalid and/or outdated HTML code. It's a horrible feature, that I see no practical use for whatsoever. Plus it's easy to accidentally click it, because it's located a few pixels away from the refresh button--talk about non-intuitive...

Anyhow...

How to install XCache 3.0 from source

Last updated: Mon, 02/11/2013 - 3:34am

Alright... So APC has been pretty unstable for me on 2 separate servers running PHP 5.3.x and PHP 5.4.x. So I figured I'd give XCache a try after reading about similar problems with APC.

Anyhow...

Here's how to install XCache 3.X from source on CentOS

Get the latest version of XCache from here: http://xcache.lighttpd.net/#Downloads

Latest version at the time of this writing is XCache 3.0.1

How to install APC on CentOS and DirectAdmin

Last updated: Tue, 01/29/2013 - 12:51am

cd /usr/local/src
mount -o remount,exec,suid /tmp
yum install autoconf 
yum install php-pear 
yum install php-devel 
yum install httpd-devel 
yum install pcre-devel 
wget http://pecl.php.net/get/APC
tar xvfz APC-VERSION.tgz
cd APC-VERSION
phpize
whereis php-config 

This will give you the location of php-config, which you will put after --with-php-config=

Categories: 

Flush MySQL log-bin data and disable binary log files

Last updated: Mon, 10/22/2012 - 3:30pm

If your disk is starting to run out of space due to an excess of mysql-bin.XXXXXXXX files here's what to do to fix that.

vi /etc/my.cnf

under 'log-bin=mysql-bin' (the destination could be different in your my.cnf) put:

expire_logs_days = 10

Change 10 to whatever you're comfortable with.

or you can simply disable the binary log files by uncommenting the line:

Categories: 

How to install Apache Solr 3.x for Drupal 7 or Drupal 6

Last updated: Tue, 09/18/2012 - 7:28pm

First we'll need to install Java 1.6 JDK, and be on PHP 5.2 or higher (You can check my PHP installation tutorial here. Also I'm on CentOS.

Install Java 1.6 JDK

yum install java-1.6*

Install Apache Solr

We're going to install Apache Solr into /usr/local/share; however you can install it somewhere else if you'd like (e.g. install it in the root dir / )

How to install safe-rm.

Last updated: Thu, 10/20/2011 - 4:25pm

So, you're worried about accidentally wiping out your entire system or important directory by doing something like  rm -rf / or  rm -rf *

with safe-rm , it won't allow you to do that, you'll get something like:

$ rm -rf /
Skipping /

Here's how to install:

cd /usr/local/src
# get latest version here: http://www.safe-rm.org.nz/
wget http://launchpad.net/safe-rm/trunk/0.8/+download/safe-rm-0.8.tar.gz
tar xvfz safe-rm-0.8.tar.gz
cd safe-rm-0.8
# find out your $PATH; 
echo $PATH # most systems should include /usr/local/bin, if not then select any other listed
cp /bin/rm /usr/local/bin/rm
mv /bin/rm /bin/rm-01
cp safe-rm /bin/rm
vi /etc/safe-rm.conf
Categories: 

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable.

Last updated: Wed, 01/27/2010 - 1:19am

if you try running the following:

phpize

and get this error

$PHP_PREFIX/bin/phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

Then it's because you don't have autoconf installed.

To fix this error, do the following:

yum install autoconf

or you can install from source (if you want to use the latest version)


cd /usr/local/src/

/* find latest version of m4 here: http://ftp.gnu.org/gnu/m4/ */

Categories: 

New Server Checklist for directadmin (2009)

Last updated: Mon, 10/17/2011 - 2:30am

-Add all your ips in directadmin under "IP management"
(and assign 2 ips to admin)
http://xx.xxx.xxx.xxx:2222/CMD_IP_MANAGER

-Register nameserver at registrar
(namecheap.com is my fav; networksolution.com is the worst for this... it's not longer an option you can click on the website, you have to send an email request for this)

-Add nameservers to server:
1. go to user level, and add the new domain you registered (leave default settings, and tweak them after)
2. go back to reseller level, and click "nameserver" and select 2 ips you want to use and click "create" then set the 2 new nameservers for "Set the Nameservers that will be assigned to new users" (it should be added by default)

-Share nameserver ips (so you're able to add other domains to them):

How-to: Secure tmp directories on linux

Last updated: Sun, 08/20/2006 - 4:14pm

source: www.eth0.us: How-To: Secure your temp directories

Every system needs temporary folders that any user is able to read and write BUT these directories should not be able to execute programs or scripts. Though this will only protect you from somebody running the script directly it will help with a large portion of the automated rootkits and trojans that script kiddies use. They will still be able to put the files on the system but they will be unable to execute them and create the back door. One of the biggest problems is php injection via apache in which people will have apache download and then run an exploit. Securing the temp directories is probably the single biggest thing you can do towards securing your server.

Subscribe to RSS - Server