All posts in Linux / Unix

Updating Packages in an OpenVZ VPS

Sam Mingolelli has posted some useful solutions to common problems when running yum update inside an OpenVZ VE.

Directory Permissions for WordPress under Plesk/Linux

Jason Diehl describes the right way to setup directory permissions on a Linux box running Plesk so that WordPress can automatically create the directories it uses to store uploads. Basically, you need to make sure that PHP’s safe mode is turned off and that wp-content is owned by apache, in the apache group, and chmod’d to 777.

Installing Additional Software on Endian Firewall

Endian doesn’t ship with gcc, apt or yum, so it can be kind of confusing at first if you’re trying to figure out how to install some extra packages. It comes with Smart Package Manager , which you can use to install CentOS binary RPMs from  http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/ (CentOS 4) or  http://mirror.centos.org/centos/5/os/i386/CentOS / (CentOS 5). Try the version 4 first. You… [more]

Backing Up Files and MySQL Databases on Linux Servers

You’d think I’d have this memorized by now, but I always mess up the syntax and have to spend a few minutes digging through man pages or wading through search results to find it. tar -czf [output-file.tar.gz] [input-directory]/ mysqldump -u [username] -p [database name] > [filename]

Updating OpenDNS With a Dynamic IP From an Endian Firewall

The Endian router/firewall appliance comes with a Dynamic DNS client that supports the major DDNS providers, but it doesn’t support updating OpenDNS, which is necessary for any custom settings on your OpenDNS account to be applied to the traffic you pass through their servers. It’s possible to configure this yourself, though. There’s a helpful post… [more]

PHP Error Logs with Virtuozzo

Virtuozzo sets domains up to have PHP’s display_errors flag turned off by default, so that you’ll only see a blank page when there are critical errors. This is a good thing in production environments because it avoids potential security issues, but it can also be annoying when you’re trying to debug something. Instead of displaying… [more]

Firewalling an OpenVZ node and containers

The OpenVZ wiki has a nice script for firewalling an OpenVZ node and it’s containers . It creates a service and configures iptables to block all traffic to the node (except the ports you specify), but allow all traffic through to the containers, so that they can manage their own firewall. It also allows the container’s firewalls to be managed on the… [more]

Relaying Qmail Through a Spam Filter

If you’re running a mail service on a web server so it can send out e-mail from contact forms, etc then you’ll want to make sure it’s relaying outbound mail through a spam filter , or it could be used to send spam if the forms get hijacked. For qmail, you just need to create /var/qmail/control/smtproutes and enter “:yourmailserver.com”, then restart. Make… [more]

Skipping Disk Check When Rebooting Linux Server

If you don’t run a disk check on a Linux server in awhile and you reboot, it may force a disk check, which can take 30+ minutes, and it’ll be offline the entire time. You can reboot and skip the check with shutdown -fr now or force a check with shutdown -Fr now. (via go2linux.org )  

Convert Filenames to Lowercase on Linux

If you transfer files from a Windows server to a Linux one, you may get some broken links because Linux is case-sensative while Windows isn’t. You can rename all the files on the Linux server to their lowercase equivalents with this shell script from Linux Journal.

NTP Service Doesn’t Start Serving Until It Stablizes

I just spent an hour trying to figure out why the NTP service I installed wasn’t working, and then I came across this slightly important little fact: Your internal workstation computers will not be able to use the server as a synchronisation source until the LOCAL(0) clock has stable time. This may take up to 15… [more]

Find largest directories on a Linux box

These commands will return the largest 10 directories on a Linux box. via peterbe.com

Find recently modified files in Linux

This will list all the files on a Linux system that were modified in the past 5 days

Finding a string inside multiple files on Linux

Snipplr has a good article on how to find all of the files on a Linux system that contain a specific string . The search will include subfolders.

Installing the Oracle Library for PHP

Chris Sibert wrote a good tutorial on installing the Oracle library for PHP . If you’re running SELinux, I’d recommend temporarily turning it off to get the module setup so you don’t have to worry about problems during the install, and then turn SELinux back on after you verify the module is working. Then you can update SELinux’s policy to allow Apache and PHP… [more]

Set Linux time using remote time server

You can use the rdate command to set the correct time on a Linux system, instead of having to manually enter it. NIST has a list of time servers . You can then use hwclock to update the hardware clock.

Additional FTP accounts on Plesk for Linux

Before version 9 of Plesk you couldn’t add additional FTP accounts for a domain through the control panel. This KB explains how to manually add extra FTP accounts that are restricted to their home directory .

 
re-abolish slavery