DUNTUK

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

Linux

FAQs/HOW-TO's related to Linux and/or BSD server administration.

How to set date and time automatically in CentOS

Last updated: Thu, 04/18/2013 - 12:36pm

tzselect

Answer the 3 locations questions. Then create a symlink to your local time.

rm -rf /etc/localtime
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

The symlink will be according to your time zone--above is just an example.

Now, we check the date and time

date

Time and date should now be properly set.

Categories: 

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

Drupal .htaccess rewrite with 'www' but not for sub-domains

Last updated: Wed, 01/23/2013 - 12:57am

Say you have your Drupal's .htaccess set "To redirect all users to access the site WITH the 'www.' prefix", and you added a sub-domain, and it came out looking something like http://www.sub.domain.com. So, most people will NOT want the "www" added to the url in this case. So what do you do? Easy.

Use this instead:

Categories: 

Add memcached Support to Magento

Last updated: Tue, 09/18/2012 - 5:20pm

After you successfully install memcached and pecl/memcached (memcached PHP support), you will next want take full advantage of it by enabling native support for memcached in magento.

NOTE: you must have memcached and pecl/memcached already installed. Otherwise your Magento installation will break if you try following this guide.

Ok... now that the warning is out the way. Here's how we do it...

Edit your local.xml

vi ./app/etc/local.xml

Add the following between

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: 

phpMyAdmin database export "Save as file" template

Last updated: Sat, 08/18/2012 - 9:18pm

Whenever you do a database backup using phpMyAdmin, you are presented with a default file name structure for saves, usually like so:

__DB__

which basically gives you the name of the database you just backed up. Which is ok, however, most people would also like the date and time stamp included as well...

So...

This is how it's done... replace the above with :

__DB__-%F-%T

or for newer version of phpMyAdmin

@DATABASE@-%F-%T

__DB__ = name of database Example: my_database
%F = Same as "%Y-%m-%d" (year-month-day) Example: 2009-11-25
%T = time stamp . (24 hour format, hour_minute_second) Example: 11_07_31

which will save a file with the naming structure similar to:

my_database-2009-11-25-11_07_31.sql

You can easily use other date/time structure, to suit your personal preference.

Categories: 

DirectAdmin Checklist (incase something doesn't work)

Last updated: Sun, 09/17/2006 - 1:45am

If email is not being received, but you're able to log in, it may be a permission's problem
(This may occur when restoring backup accounts)

# /usr/local/directadmin/scripts/set_permissions.sh email 

If you're unable to su to root, even if inputing the correct password

Categories: 

Pages

Subscribe to RSS - Linux