Synergy Codeworks

Tips, Tricks, and articles related to open source technology
Jan 25
2010

Joomla! Plugin for SynergyStats is Available!

Posted by John Hobart in Joomla!

We created a customized Joomla plugin for SynergyStats.com.  

Unlike typical plugins, this one is pre-configured for your site and ready for download.  

All you have to do is login, download the plugin, and install it on your Joomla site.

At present you have the ability to enable or disable:

 

  • SSL between your client and the SynergyStats server (to encrypt user data); 
  • Sending the user's email address, Joomla! username, and/or full name

 

Jan 17
2010

Synergy Stats Analytics Service is Live!

Posted by John Hobart in web analytics

Our real-time web analytics package is now live and available at SynergyStats.com.  A short list of the features include:

Growth
  • An Addictive Spy Map
  • Dashboard Views of Traffic Trends
  • Tracking for Goals & Campaigns
  • Bounce Rate Analysis
  • Visual Heat Maps
  • Dynamic Site Improvement Tips
  • Direct integration with Joomla

And lots more!  Give it a test drive with a free trial and watch your visitors in real-time.  

 Check out the Animated Demo too, it's pretty cool.

Jan 16
2010

Changing the Default Document Directory in Plesk for a Domain or Subdomain

Posted by John Hobart in linux

Sometimes it's tricky to get a package installation to install exactly how you want it.  Plesk uses:

/var/www/vhosts/(yourdomain.com)/httpdocs

as the default document directory from which to serve up pages.   If it's a subdomain you'll find it in:

/var/www/vhosts/(yourdomain.com)/subdomains/(subdomain name)/httpdocs

This might not work for you for any number of reasons and you might need to set the default document directory to something different.  All you need to do is create a vhost.conf file that tells Apache where to look.  (Plesk is the control panel, Apache is the web server software bundled with it.)

The procedure is really simple but it's a little different for subdomains than for the main domain.  We'll start with the main domain.

Use whatever text editor you like best.  (I'm a huge fan of Notepad++ when stuck working on a Windows box but Notepad will work just as well.)  Create a file called vhost.conf with a single line:

DocumentRoot /var/www/vhosts/httpdocs/(yourdomain.com)/httpdocs/(path-to-new-document-root)

Replace (yourdomain.com) with your domain and (path-to-new-document-root) with wherever you want Apache to read the files from.

FTP this file to:

/var/www/vhosts/(yourdomain.com)/conf

Now we need to tell Plesk to reload the configuration files.  You'll need console access to your server to do this.  This is available from your Plesk control panel or if you have permission to SSH into the server you can use a program like Putty to logon to the server.  Either way you need to execute the following command:

/usr/local/psa/admin/bin/websrvmng -a

Now if you type http://www.(yourdomain).com into your browser Apache will serve up files from your new directory.

 If you're setting a new document root for a subdomain you do pretty much the same thing.  Create the vhost.conf file - again with a single line:

DocumentRoot /var/www/vhosts/(yourdomain.com)/subdomains/(subdomain name)/httpdocs/(path-to-new-document-root)

Again replacing (yourdomain.com) with your domain name, (subdomain name) with the subdomain you're changing, and (path-to-new-document-root) with the path of the new document root directory.

FTP this file to:

/var/www/vhosts/(yourdomain.com)/subdomains/(subdomain name)/conf

Per the instructions listed above execute:

/usr/local/psa/admin/bin/websrvmng -a

to get Plesk to reload the configuration files.  Finally - and this is important - for subdomains you also have to restart Apache.  You do this by executing:

service httpd restart

from the command line or use your Plesk control panel to restart Apache under the System menu.

Now documents located at http://(subdomain name).(yourdomain).com will be served up from the new directory.

Questions?  Feel free to drop a note in my community box or leave a comment below.

 

Jan 13
2010

How to Restart Plesk from the Command Line

Posted by John Hobart in restart

From time to time Plesk will stop responding.  While this is a sledgehammer approach, sometimes the only thing you can do is restart the service.

 You'll need root access to your host.  Use the following command to restart Plesk:

 /etc/init.d/psa restart

 That should do it!

Jan 11
2010

Cloning a MySQL Database from the Command Line

Posted by John Hobart in cloning database

Sometimes it's handy to make a quick copy of a database locally or on a remote machine from the command line.  This is a lot simpler and more reliable than exporting it from phpMyAdmin and then importing the data into a new database, though it does require command line access.

For a simple case where you're executing the command from an SSH session on the same machine on which your database resides and have the ability to run mysqldump and mysql:

mysqldump -uUSERNAME -pPASSWORD --no-create-db DB_NAME | mysql -uCLONE_USERNAME -pCLONE_PASSWORD CLONE_DB_NAME

There's a lot more information available on the MySQL website, but it's worth mentioning that you can use the -h option to run this remotely or make a copy of a remote database.

Keep in mind this might not be a suitable solution for your environment.  For databases with high transaction volumes your cloned copy might have some data left in an inconsistent state.  Your only option at that point would be to take the database down for maintenance during the export portion of the clone (which might not be acceptable) or setup replication.

Check out the blog post about Using lftp to Recursively Clone Your Website File Tree, it beats doing it the old fashioned way!

Hope this helps!

 

Jan 07
2010

Using lftp to Recursively Clone Your Website File Tree

Posted by John Hobart in mirror

The built-in functionality of your plain ol' FTP client doesn't extend to recursively parsing directories and uploading them to a remote machine.   We use lftp to clone our production environment periodically to refresh our development environment.  It's also really useful for migrating your site from host to host.

lftp works similarly to ftp so you shouldn't feel too lost when you fire it up.

$ lftp username@hostname

And here's where lftp really shines - you can use the mirror command to recursively parse a remote site and download it locally, or use mirror -R to reverse the action and upload all your local content to a remote machine.  Just be careful - it doesn't ask for confirmation, so it's really easy to launch it in the wrong direction and blow away all your hard work.

To download a remote file tree just lcd and cd your way to the correct working directories and execute:

> mirror

To do the same thing in reverse, uploading your local content to a remote server:

> mirror -R

As usual there's lots more information in the man pages.  Enjoy!

Also see my blog post on using mysqldump and mysql to replicate your MySQL database from host-to-host.

Jan 05
2010

Running a Script or Importing Data Using the Command Line mysql Tool

Posted by John Hobart in MySQL

Sometimes all you want to do is run a big script or import a database using the MySQL command line tool without echoing out tons of output.  Luckily it's dead easy.  If the script you want to run is called script.sql just ssh into your machine and type:

mysql -uUSERNAME -pPASSWORD DB_SCHEMA < script.sql

Substituting your username and password and the database you want to run the script against.

 

 

Jan 03
2010

John Hobart is Back

Posted by Administrator in Untagged 

After a brief foray into the Oracle world in higher education, we're glad to announce John's return.  In addition to returning to his position as our Tech Director he will also be spearheading development on the Synergy Stats project.

 We're glad to have him back. 

Dec 15
2009

View the Available Positions on Any Joomla! Page

Posted by Anne Saulnier in Joomla!

If you're using a new template in Joomla and aren't familiar with all of the various positions that are available, simply add a ?tp=1 to the end of your URL string (i.e., http://j.synergycode.com/index.php?tp=1).

 Module Positions in Joomla

 

Nov 24
2009

Load a Joomla Module inside an Article in Joomla! 1.5

Posted by Anne Saulnier in Joomla!

There is a very neat plug-in that comes with Joomla 1.5 that enables you to embed any module inside any article.  

First, ensure that the "Content - Load Module" plugin is enabled by navigating to Extensions --> Plugin Manager from your Joomla! Administration site:

 Load Module Plugin for Articles in Joomla

 Once this is enabled, you need to switch over to the Module Manager (Extensions --> Module Manager) and find the Module that you'd like to embed within the article.

From the edit mode of the Module, highlight the text that is in the Position field.  It looks like it's a dropdown menu only, but you can actually manually type in any entry you want here!

 Before:

Edit Module Position in Joomla

 

After:

Custom Position in Joomla

 

Now, you can manually choose the pages that you're going to have your module appear by highlighting the correct page on the Menu Assignment select box, or you can just choose to have it appear on all pages and it will still only show up in the articles where you embed the code (shown in the next step).

Menu Assignment in Joomla for Custom Position

Save your changes and navigate over to the Content --> Article Manager page.

Edit or create the article that you'd like to place your Module in and switch to the HTML edit mode (not the What You See Is What You Get - WYSIWYG editing mode).

 Type in {loadposition CustomPosition} where CustomPosition is the text that you entered in the Module's Position field in the step above.

Load Module into Article in Joomla

 Save your changes and navigate to the appropriate page on your site to view your handiwork in action.

Example Custom Load Position in Joomla

 

 

Client Login