Posts Categorized: Linux

Changing hostname on Linux server to FQD

Posted by & filed under Linux.

OK, this is straightforward, just see http://www.cyberciti.biz/faq/linux-change-hostname/ On Unbuntu, simple edit /etc/hostname BUT Don’t forget to restart the hostname script daemon, otherwise the new domain will not show up with you type ‘hostname’… /etc/init.d/hostname restart ALSO You might want update you reverse IP to the new hostname. All done.

Apache SSL – Multiple Certificates on a Single IP

Posted by & filed under Linux, Server.

Setting up multiple SSL Certificates on a single IP address is possible, and acceptable on nearly all browsers, thanks to Server Name Identification (SNI). SNI sends a site visitor the certificate that matches the requested server name – great! No more need to buy extra IP addresses. I set this up on a Ubuntu 12.04… Read more »

Heartbleed bug – Upgrade OpenSSL on Ubuntu 12.04

Posted by & filed under Linux, Server.

The Heartbleed bug found in OpenSSL needs addressing if you are using OpenSSL to generate TLS keys for HTTPS or FTPS in particular. Upgrading OpenSSL on Ubuntu is not just a matter of running ‘apt-get upgrade’ – this does not get the latest patched version. I found the answer was to install the openssl libssl-dev… Read more »

Bash backup script

Posted by & filed under Linux, Server.

Here’s a script for backing up directories and databases. All files are compresses, and files older than 30 days are removed. # # Backup script # # Make compressed backups of directories/files, and old backups # Format: YEAR MONTH DAY – HOUR MINUTE SECOND DATE=$(date +%Y%m%d-%H%M%S) # backup directories and files tar -czf “/backup/target_file-$DATE.tar.gz” /home/username/public_html/home/… Read more »

Removing orphaned virtfs mounts

Posted by & filed under Linux.

Shows who is logged in: # who Anybody running a virtfs, or any orphaned virtfs users? cat /proc/mounts | grep virtfs Unmount them! for i in `cat /proc/mounts |grep virtfs |grep user_name_here |awk ‘{print$2}’`; do umount $i; done

Flash media server and apache

Posted by & filed under Linux.

At work, due to a Flash Media Server running on one of the IP addresses, when we restart Apache using WHM, everything gets disconnected, and this causes Apache to fail. Here are instructions for what to do if someone restarts Apache: Open Putty and login to the server. Insert this line to access the FMS… Read more »

Putty with SSH keys

Posted by & filed under Linux, Odds.

Use Pageant for loading the key, then in Putty make sure you add the username to the Connection -> Data -> auto-login username. Once you’ve done that, make sure that Connection -> SSH -> Auth has “attempt authentication using Pageant ticked, and “attempt keyboard-interactive auth. Here’s a good article.

Linux show directory sizes

Posted by & filed under Linux.

To find the size of directories in the current path: du -h -c –max-depth=1 flag -h = human readable, -c = display total sizes. Remove the –max-depth=1 bit if you want to see subdirectories.

Shell – change permissions recursively

Posted by & filed under Linux.

To change BOTH file and directory perms recursively: chmod -R 777 To change just files: find . -type f -exec chmod 777 {} \; To change just directories: find . -type d -exec chmod 777 {} \; or this should work too: chmod 644 $(find . -type f) chmod 755 $(find . -type d)

Online resources for Bash commands

Posted by & filed under Linux.

Try these: http://www.gregrobert.com/sshputty.php http://www.debianhelp.co.uk/commands.htm And the master of all: http://ss64.com/bash/