List partitions by UUID
Thu, 12/03/2009 - 09:52 — sandipUUID mounts in fstab is very useful if you have external usb hdd that is often connected and disconnected.
To find out the UUID of a disk drive, you can use the simple `ls` command as below:
ls -l /dev/disk/by-uuid
Additionally below commands can also be used:
# blkid
# vol_id /dev/sda1
# tune2fs -l /dev/sda1
- sandip's blog
- Login or register to post comments
cannot create temporary file - (13) Permission denied
Tue, 12/01/2009 - 10:48 — sandipThis is dues to bug in the default installation of qmail in handling local mails... such as mails to root@localhost where the qmail-local binary is not set with the right owner and permissions, as such mails are not able to be written to the spool located at "/usr/local/psa/handlers/spool
The error in "/usr/local/psa/var/log/maillo
qmail-local-handlers[......]: cannot create temporary file - (13) Permission denied
To resolve, change the owner and permission of /var/qmail/bin/qmail-local to reflect the same as qmail-remote.
cd /var/qmail/bin
chown mhandlers-user:popuser qmail-local
chmod g+s,g-r,o-r qmail-local
Restart qmail:
/etc/init.d/qmail restart
Bulk update DNS TTL for all Plesk domains
Sat, 11/14/2009 - 14:54 — sandipThis is useful when migrating servers and you want to reduce the DNS time to live for all domains.
Change the TTL on all domains to 5 mins (300 seconds) in the psa database.
# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
mysql> UPDATE `dns_zone` SET `ttl` = '300', `ttl_unit` = '60' WHERE `id` >1;
mysql> quit
Then update the zone files via:
# mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/admin/sbi n/dnsmng update " $1 }' | sh
Verify with:
$ dig @nameserver domain.tld soa
- sandip's blog
- Login or register to post comments
- Read more
Upgrade CentOS 5.3 to 5.4
Mon, 11/09/2009 - 00:36 — sandipBelow is a clean method of updating, instead of doing a straight `yum update` which I have often done in the past and broken OS.
yum clean all
yum update glibc\*
yum update yum\* rpm\* python\*
yum clean all
yum update
shutdown -r now
Unable to open pty: No such file or directory
Sat, 09/26/2009 - 01:09 — sandipUdev is a dependency of xorg and other development packages that breaks OpenVZ containers if installed or upgraded.
Re-create the missing devices after an upgrade via:
vzctl exec {VEID} /sbin/MAKEDEV tty
vzctl exec {VEID} /sbin/MAKEDEV pty
For a permanent fix, edit /etc/rc.sysinit to disable udev and auto-repair the devices:
#/sbin/start_udev
/sbin/MAKEDEV tty
/sbin/MAKEDEV pty
- sandip's blog
- Login or register to post comments
My.Cnf File Issue on Linux Dedicated Server Running CentOS
Fri, 09/25/2009 - 08:10 — NewMusicPromoteDear Anyone.
Hello i came across this website doing a search for My.Cnf tweeks or configurations for the SQL_Max_Connections and i was wondering some things. I have a Linux CentOS system with 2.5 gigs of Ram, Running Apache. and PHP. what would be the "proper" My.cnf file settings for a Music Website i keep getting a max connection overload on the network.
Matthew Nalett
New Music Promote
http://www.newmusicpromote.co
Here is my current My.Cnf settings.
Any Suggestions on how to optimize this for a Music Network?
[mysqld]
set-variable=local-infile=0
- NewMusicPromote's blog
- Login or register to post comments
- Read more
Munin stats for apache and lighttpd
Wed, 09/02/2009 - 16:49 — sandipGet status of apache (80) and lighttpd (81) on different ports:
This is done at the nodes.
-
Enable apache server-status in httpd.conf :
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
$HTTP["remoteip"] == "127.0.0.1" {
status.status-url   ;   ; = "/server-status"
}
[apache*]
env ports="80 81"
* Test with:
ports="80 83" /etc/munin/plugins/apache_proc esses
lighttpd idle process will be a straight line as total of busy and idle process is always the same when drawn as STACK, . To change this to LINE1:
At the host, edit "/etc/munin/munin.conf" and add the below line to the corresponding host:
apache_processes.idle81.draw LINE1
- sandip's blog
- Login or register to post comments
- Read more
Lighttpd client side optimization
Wed, 09/02/2009 - 12:06 — sandip-
Edit conf file: /etc/lighttpd/lighttpd.conf
Enable mod_expire and mod_compress.
Expire static files set for 3 days:
$HTTP["url"] =~ "\.(js|css|gif|jpg|png|ic o|txt|swf|html|htm)$" { expire.url = ( "" => "access 3 days" ) }
compress.cache-dir = "/var/cache/lighttpd/comp ress/"
compress.filetype   ;   ; = ("text/plain", "text/html", "text/css", "text/xml", "text/javascript")
#!/bin/bash
# lighttpd_cache_clean
# Clean cache stored at /var/cache/lighttpd/compressr /># Place in /etc/cron.daily
# Cache dir path
CROOT="/var/cache/light tpd/compress"
#Deleting files older than 3 days
HOURS=72
# Lighttpd user and group
LUSER="lighttpd"r />LGROUP="lighttpd"< br />
# start cleaning
/usr/sbin/tmpwatch --mtime ${HOURS} ${CROOT}
# if directory missing just recreate it
if [ ! -d $CROOT ]
then
&nbs p; mkdir -p $CROOT
&nbs p; chown ${LUSER}:${LGROUP} ${CROOT}
fi
exit 0
mkdir -p /var/cache/lighttpd/compressr />chown lighttpd:lighttpd /var/cache/lighttpd/compress
Create pdf of manual pages
Tue, 08/25/2009 - 10:20 — sandipBelow command will convert and create a pdf of a manual page.
man -t man | ps2pdf - > man.pdf
- sandip's blog
- Login or register to post comments
unable to include potential exec
Wed, 07/29/2009 - 00:47 — sandipRecent upgrade to Apache-2.2.3 secured down on executables not able to be included within a SSI include call and was getting "unable to include potential exec" in the apache error log file.
Apparently .shtml files were being used as includes via SSI. Changing the included files to .html resolved the issue.
Below was the command issued from the document root to quickly rename all the embedded leftmenu.shtml to leftmenu.html:
cp -a leftmenu.shtml leftmenu.html
find -L -name "*.shtml" -type f -printf "\"%p\"\n" | xargs perl -pi -e 's/leftmenu\.shtml/leftme nu\.html/g'
- sandip's blog
- Login or register to post comments