SPF Records for Google Apps Email

If you’re using Google Apps for email–and it’s a solid choice with lots of storage space, spam management tools and integration with other free services–after creating the appropriate DNS records to route your email, you’ll want to add an SPF Record. This ensures better email delivery and prevents vile spammers from forging their spam as having come from you!

Some domain registrars give you adequate tools to add an SPF record directly, but if not, it’s simple enough to add it directly in WHM. ((Thanks to this helpful article on Tech Talk Point.))

You’re using the “Edit Zone” command; select the zone for the domain in question, and add a new text record.

Google Apps Mail SPF

Use domain.com. (keeping period at the end intact) as the entry, and the code below for the text part of the record (keeping quotes intact).

"v=spf1 include:_spf.google.com ~all"

See? That didn’t hurt much.

Share Button

Changing Directory Ownership via Command Line

Trying to replace, delete or change files via FTP, you may notice you get insufficient permissions errors. If you haven’t seen this a lot, your first instinct is to try to change the permissions on the directories in question, in which case you will continue to get mooned. This issue is less about permissions per se than about directory ownership. If you’re running on a server that has some directories owned by nobody/99, that means the server itself is considered “owner” and individual users won’t be able to change or delete these. ((If your server requires 777 permissions for certain functions, then you most likely will have some directories “owned” by the server/nobody.))

chown -Rv username:groupname *

The username/groupname should be replaced with your info–but you don’t know this already, best to get out of there and get tech support to help you–and these two will normally be the same. The R makes it recursive, changing the files inside the directory as well as the directory you run the command on, and the v gives you verbose output so you can see what got changed.

Share Button

Releasing Items from Mailscanner Que

The easiest is to have your mailscanner configured to quarantine Whole Message as Queue files; from Chirpy with instructions for this and more, here.

Quarantine Whole Message = yes
Quarantine Whole Messages As Queue Files = yes

then to requeue the email to be delivered, you need to go to the indicated directory within:
/var/spool/MailScanner/quarantine/<date>/<message-id>/

Then you need to:
cp -av *-H /var/spool/exim/input/ ; cp -av *-D /var/spool/exim/input/
one done you’ll have to wait for the next exim mail queue run, or run it yourself from WHM > Manage Queue > <message-id> > Deliver Now

Share Button

Hosting Subdomain on a Different Server than Main Domain

There may be times where you want to host a subdomain on a different server than the main domain. To accomplish this, you need an A record, added either at the domain registrar if possible, or the server that hosts mydomain.com.

sub.mydomain.com. 14400 IN  A  XXX.XXX.XXX

The X’s should be replaced by the target server’s IP address. I prefer changing this info at the domain record level, since that doesn’t require cooperation of the main domain’s host, and thus can be changed by the domain owner in the event the target server’s IP changes.

For this to work, the subdomain MUST be added to the target server. A very simple way to do this is to add the main domain as an Addon in cPanel, and then set up the subdomain which will add all the relevant DNS entries (even though the main domain is not actually hosted on the target server). ((Caveat – I’ve found you may see occasional weirdness, though, with the approach described, such as a WordPress installation that requires uploads to go straight to the upload folder to work, instead of month and year-based folder settings. Would probably be better to add the subdomain to your server configuration directly for long-term robustness.))

Share Button

SQL: Closing Comments on WordPress Installation

During domain propagation when changing hosts for a WordPress blog, you may want to close comments to keep from losing anything. While you can certainly use the WP comment template technique, this is an especially convenient way of turning off comments en masse on a WP installation.

After transferring the blog databases to the new host, access PHPmyAdmin on the old host with this bit of SQL; if you have a different prefix to your table that “wp_” you’ll need to adjust the command accordingly.

UPDATE wp_posts p SET comment_status = 'closed', ping_status = 'closed' WHERE comment_status = 'open'

This approach also makes it very easy for a client to check domain propagation. If the comments are closed, the site is being served from the old host. If comments are open, it’s being  served from the new host. Easy!

Share Button

Addon Vs. Parked Domains in cPanel

Where is the info for Addon Domains stored in Apached? Parked domains? cPanel Docs gives us an answer:

Addon Domains Parked Domains
Main domain appears in the address bar Yes No
Apache directive used VirtualHost ServerAlias
Separate logs Yes No
Separate stats Yes No
Treated as a subdomain (other than URL) Yes No
Ideal for multiple domains sharing the same address No Yes

Deleting an addon domain won’t delete the files or databases associated with that domain. A parked domain, of course, won’t have files or databases associated with it.

Share Button

Default New Account Address of Server IP/~username Not Working?

If you cannot access your sites via http://ipaddress/~username (usually used as a temporary address pending domain propagation for new hosting clients), check that the Apache module mod_userdir, if enabled, has an exception configured for the default virtual host.

End transmission.

Share Button

cPanel /WHM Server Default Parking Page

To set up a default parking page for cPanel/WHM server, you need to place your default files in the proper place.

Check /usr/local/apache/htdocs for when a domain resolves to your server but does not actually exist in the Apache configuration file. If you just need a park page set up you can place it in that directory and name it index.php, index.html, etc.

As always, your configuration may vary.

Share Button

Quickie – Disable WordPress Comments Temporarily

Very handy if you’re moving a WordPress blog during DNS  propagation time. This is best suited to remove the ability to comment on their blog without changing the comment status of posts in their database. See the alternative SQL method to turn off comments and pingbacks on a WP blog in hosting transition here.

From http://www.theblog.ca/wordpress-temporarily-disable-comments:

1) Turn off the display of the comment form in your Comments file in your template. To do this, go to “Presentation… Theme Editor…” then edit the Comments file.

You’ll see something like this.

<?php if ('open' == $post->comment_status) : ?>
 <h3 id="respond">Leave a Reply</h3>

Replace it with something like this:

<?php // if ('open' == $post->comment_status) : ?>
 <p>Comments are temporarily disabled</p>

Note: I see no need for the author’s suggestion of renaming the wp-comments-post.php file because we don’t need to worry about the spam comments accumulating during a hosting move.

Share Button

Moving WordPress With No Downtime: Resources

Helpful Technical Guides to Moving WordPress installations, and particularly Command Line/SSH instructions.

Step-by-Step SSH Guide
http://uncorrupted.net/technical-articles/move-wordpress-with-no-down-time/

WP Codex on Moving WordPress
http://codex.wordpress.org/Moving_WordPress

Moving WordPress via SSH
http://technosailor.com/2007/04/06/wordpress-faq-how-do-i-move-my-blog-to-a-new-host/

WordPress Installation via Command Line
http://guvnr.com/web/web-dev/wordpress-subversion/

Share Button