• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Server Stuff

WordPress htaccess Explained

August 14, 2013 by Webhead

A great post explaining each line of WordPress’ htaccess file.

 

http://randomtype.ca/blog/the-wordpress-htaccess-file-explained/

Filed Under: Server Stuff Tagged With: htaccess, wordpress

WordPress Cron

December 20, 2012 by Webhead

A great way to take more control of your wp-cron and also slightly speed up wordpress is to disable cron and scheduled a cron job on your server to run wp-cron.php.  You just need a server that supports cron jobs.

In wp-config.php add:

define(‘DISABLE_WP_CRON’, true);

Be careful though, sometimes this has a negative effect on your website.  For example if you have subscriptions from woocommerce, each user’s subscription is checked on every 12 hours.  If you have a ton of users, each of these users has a cron job waiting to run throughout the hour.  These jobs will slow down your server if you run wp-cron too far apart.

Setting up your cron command can look similar to:

*/30 * * * * wget http://example.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

 

source:  http://bitswapping.com/2010/10/using-cron-to-trigger-wp-cron-php/

Filed Under: Coding, Server Stuff Tagged With: linux, optimize, php, wordpress

Hardening WordPress

December 18, 2012 by Webhead

I’ll be updating this post as I find more and better explanations to hardening wordpress.  The more secure, the better.  Some things to keep in mind when you are trying to secure your wordpress installation.

  • Be careful when saying a security measure is “not worth the time” to do it.  If it takes 5 minutes to do, then it’s almost always worth it to do it.
  • It is always worth doing something that will prevent those rare cases.  Just remember that most default settings will already protect you from the common cases, it’s those rare ones that get you.
  • “Simple folk” not understanding things is not an excuse to not do things.

WordPress codex has many good solutions.  This post is will only repeat those solutions if there is more explanation.

http://codex.wordpress.org/Hardening_WordPress

 

Move your wp-config.php file

  • If your server runs into some trouble (no hackers required) it can get reset and/or display php files in plain text without going through the interpreters.  .htaccess files could also be bypassed by some server problems.  A good example is in the link below where it was a common bug on a certain host.
  • This is your most sensitive file.  Any security measure for this file is worth it if done right.
  • http://wordpress.stackexchange.com/questions/58391/is-moving-wp-config-outside-the-web-root-really-beneficial

 

Filed Under: Coding, Server Stuff Tagged With: linux, php, wordpress

OSCommerce admin pages show 401

November 27, 2012 by Webhead

Problem

The OSCommerce admin pages were working fine a couple months ago.  Now I go to it and it shows a 401 error.

Solution

The problem was that the htaccess file had a rewrite added to it to always include www to the address.  Apparently the SEO guy did this.  The solution is to update the OSCommerce configuration files.  Meaning add “www” to the address variables in

includes/configure.php
includes/admin/configure.php

 

source: http://forums.oscommerce.com/topic/341940-how-to-change-htaccess-to-rewrite-the-url-hard/
http://forums.jaguarpc.com/design-development/24039-just-installed-oscommerce-admin-links-giving-401-authentication-failed.html

keywords: oscommerce 401

Filed Under: Coding, Server Stuff Tagged With: cms, eCommerce

MAMP – MySQL can’t connect after OS X Crash

September 4, 2012 by Webhead

Problem

I had my macbook open, it went to sleep and I couldn’t wake it up.  After holding down the powerbutton for over 10 seconds, it turned on.  Everything was fine until I tried to open the MAMP home page.  MySQL couldn’t start.  the error logs showed:

InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
120904 14:51:31 InnoDB: Unable to open the first data file
InnoDB: Error in opening ./ibdata1

Solution

Solution is to find the mysqlid process and end it.  Then restart MAMP and things should be good to go.  more details on this great post:

http://aralbalkan.com/1931

 

Another Problem

When visiting phpMyAdmin you get the following errors:

“Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.”

Another Solution

Clear your browser cache.

thanks to: http://stackoverflow.com/questions/5013118/cannot-start-session-without-errors-in-phpmyadmin

 

 

keywords: mamp check that you do not already have another mysqlid process

Filed Under: Server Stuff Tagged With: apache, linux, mac os x, mysql

Page Speed SEO

April 4, 2012 by Webhead

One of the metrics for Search Engine Optimization is the time it takes to load a page.  With Google’s PageSpeed tool, you can see if your page is loading optimally.  One of the ways to better your page loading is by leveraging browser cache.  The article below explains it well.  What I did was a little simpler.  I basically just bypassed all the ExpiresByType and just put the ExpiresDefault in my .htaccess.


<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 2 week"
</IfModule>

keywords: leverage browser caching
source: http://thomasgriffinmedia.com/blog/2010/11/how-to-leverage-browser-caching-in-wordpress-via-htaccess/

Filed Under: Coding, Server Stuff Tagged With: apache, google, htaccess, seo

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Go to page 5
  • Go to Next Page »

Primary Sidebar

Topics

apache apple chrome cms css debug eCommerce embed filters firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization macOS mac os x markdown ms sql mysql open source optimize php seo svg tinymce vs code woocommerce wordpress wpengine xss yii youtube

Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized