Archive for November 2015
I wanted to write some quick notes regarding the feedback that we got from our developers about how to export and import databases using WP-CLI. What a wonderful tool it is! WP-CLI stands for “WordPress Command Line Interface”. There are a bunch of commands you can use to manage WordPress . . . Read more
This is needed when Grunt and SASS plus all dependencies are not installed on a Shared host. This is pretty typical for LiquidWeb shared hosting. Start by using SSH to log-in to the server as the relevant account. Example: ssh account@server.com Install RubyGems + SASS Issue these commands to download . . . Read more
This is needed when you need GIT and the server you are using is a shared host that does not already have GIT installed globally (eg. in /etc/bin or /usr/local/bin) Step-by-step guide First run gcc –version to make sure the compiler is installed and supports the installation. Edit the .bashrc . . . Read more
Rsync is an amazing tool for direct server-to-server data transfers. Very speedy, and very smart! You can use rsync to do synchronizations between source and destination, comparing them, and copying only what’s changed. What’s especially amazing is that rsync only transfers the “parts” of files that are different. This works . . . Read more
We sure would love it if git were installed on our server. So let’s do that! [root@sunshine /var/cpanel/easy/apache/profile]# yum install git Loaded plugins: fastestmirror, priorities, security Loading mirror speeds from cached hostfile stable-arch | 951 B 00:00 stable-generic | 951 B 00:00 stable-noarch | 951 B 00:00 system-base | . . . Read more
Sometimes we have the need to recursively change the permissions, but only for either files or directories. Here’s a handy way to do this, from the command line. *Note: Being recursive, these are powerful commands, and can change a whole bunch of things, in a very short amount of time. Please do . . . Read more
The purposes of this how-to is to give detailed instruction on how to setup a client code project so that it can be used with source control via BitBucket. The same procedure can be used whether the codebase already exists or not. By the end of this how-to you will have . . . Read more
Import an Existing Repo, Hosted on a Remote, eg: BitBucket or GitHub: cd /your/local/directory git clone git@github.com:reponame/domainname.git Create a Brand New (Local) Repo, & Add a (Bare) Remote: cd /your/local/directory git init git add . git commit -m “Begin! Import all existing web files” Then we add the remote (bare) . . . Read more
The SpamAssassin server-side spam email filter employs Bayesian statistical algorithms to tell the difference between spam and ham. As such, these filters do their best when they’re “learned”. Here are some examples from a sample account. Let’s assume we’re working with a cpanel account called “oicom”, and we want to . . . Read more
On a WHM/Cpanel server, the main php.ini file is located thusly: /usr/local/lib/php.ini See also: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/PhpIni Related articles Page: Install Git on Centos Page: EasyApache & Recompiling Apache / PHP (Easy Apache) Page: How to Recursively Change Permissions, Only Files / Directories, Chmod Page: How To Restart Various Server Services . . . Read more
Note: These notes pertain to PM servers. Other servers may vary… Loadwatch Logs Located In: /root/loadwatch To Summarize a Particular Logfile: (when in the “/root/loadwatch” directory, as root) /scripts/loadparse <filename_of_logfile> Cumulative Log of Loads: /root/loadwatch/checklog See also: http://linux.about.com/cs/linux101/g/loadwatch.htm http://www.xaprb.com/blog/2006/06/08/how-to-monitor-server-load-on-gnulinux/ Related articles Page: Install GIT on shared hosting . . . Read more
The first tool to reach for when analyzing and/or diagnosing a server is likely: top Top will give you a real-time, interactive view of the top processes consuming memory, cpu, etc… Which is probably why it’s called “top”. There’s a lot of rather cryptic keystrokes that you can use while . . . Read more
Let’s say you’ve got root privileges, and you’re working along, and you want to quickly backup a database for USERNAME on the PM servers… cd /home/USERNAME/_back mysqldump -uroot DATABASENAME > DATABASENAME_YYYYMMDD_shortDescription.sql (Check the size of the backup file, always a good idea) ls -lah DATABASENAME_YYYYMMDD_shortDescription.sql (Change the owner and group . . . Read more
Running as root, this command will repair all mysql databases on the server. Yes, this will take some time! Note, on PM servers, if you’re logged in as root, then you do not need to specify the password. Other servers may vary. mysqlcheck -Aao –auto-repair -u root where: “A” == . . . Read more
Note: If you’re working in a WHM / Cpanel environment, do NOT do it this way, instead, use the Cpanel tools… (oh, and yea, anything enclosed in “<” and “>” below, are not intended literally, but rather as a placeholder for more reasonable inputs) Login to the mysql command line as . . . Read more
Disk Free, human readable df -h Disk Usage, summary, human readable (I think this include DOES include hidden files / directories) du -sh Disk Usage, per directory, human readable (does NOT include hidden files / directories) du -sh * Disk Usage, per directory, human readable (INCLUDES hidden files & directories) du -sh . . . Read more
For non-programmers or other knowledge workers like designers or copy writers – here are some resources for understanding what the hell “git” is and how and why we should use it. I’m still learning… but these resources really helped me reach a new understanding and eased some of my intimidation… . . . Read more
Make a Copy of an Entire Codebase: Very useful for preparing for a major version update. Let’s say you’ve got a codebase, living at: /home/USERNAME/public_html/ You can make a copy of the whole gosh dern thing, while watching the files stream before your eyes with: cp -Rv /home/USERNAME/public_html/ /home/USERNAME/public_html_YYYYMMDD_bak/ . . . Read more
Firewall blocks can be a rather common issue, especially if a user is trying to setup their email for the first time, or is wrestling with ftp or such. o For first time clients, just setting up their email, it’s a very good practice to whitelist their ip, before they . . . Read more
As root, you can use EasyApache to rebuild apache and php, enabling and disabling modules and extensions, changing php versions, changing apache versions, and configurating all kinds of things. At the end of the selection process, the build is run, and you get to watch a whole lots of beautiful . . . Read more