Archive for the ‘Joomla’ category

How to enable SEO on Joomla (Windows and Linux)

August 7th, 2008

Joomla has built-in SEO functionality.(SEO stands for Search Engine Optimization). The SEO tab in Global Configuration (in Administration backend)takes care of global SEO settings for your Joomla site.

The tricky part is enabling search engine friendly URLs. If you are wondering what are those good for, here’s an example:
A non-sef URL:
www.site.org/index.php?option=com_weblinks&task=view&Itemid=22

The Joomla SEF version of the previous URL:

http://www.teachmejoomla.com/component/option,com_weblinks/Itemid,22/

3rd party SEF extensions may display “friendlier” URLs, such as

http://www.teachmejoomla.com/useful-links/link-list.html

These URLs look like static sites for SE crawlers(which is good), and may be easier to memorize and more relevant to your human visitors(especially the ones like the last example). Aditionally, keywords in urls get you a higher search engine positioning in results.

Step 1: check SEF URLs requirements:

There are a few requirements for SEF URLs to work properly(the other SEO configuration options work regardless you have SEF URLs enabled or disabled):
You need to run the Apache Web server.
You need mod_rewrite module on apache. Most hosting companies have that module installed.
Furthermore, you need Apache configuration to allow .htaccess files.

You can easily check your Apache configuration (among other system settings) by going to System->System information and selecting the php info tab in your Joomla administration backend.
There’s an “Apache” section and a “loaded modules” subsection there. mod_rewrite should be listed among those modules.

If all went well, you’re ready for the next step.

 

Step 2: Configure SEF URLs and rename the htaccess.txt

 

This step requires a FTP client or a web filemanager. (such as cPanel’s Filemanager). That will allow you to rename your htaccess.txt and/or revert to non-SEf URL’s if something goes wrong.
All you have to do is:
open your Joomla Administration and enter global configuration, select the SEO tab
open your FTP client or the online filemanager for your website, and rename the htaccess.txt file in your Joomla root folder to .htaccess (note that you MUST include the leading dot)

A note to Windows users: Explorer does not allow leading dot filenames.

To rename the file under Win32, you need to click Start->Run, then type cmd (this opens a command line when you hit OK)

then change dir to your local joomla folder (e.g. cd “c:\easyphp\www\joomla” <ENTER>), and issue the following command:

ren htaccess.txt .htaccess
Switch back to your Joomla andministration web browser window, click on “Yes” on the “Search Engine friendly URLs” line, and push the “Save button”.
Click on Site->Preview site in new window to check the results and you’re done.

If unsuccesful, go to step 3. 

Step 3: I screwed up

Don’t worry! It happens all the time.
There is a great chance that you get 500 (Internal server) errors, if something does not work.

Make sure you have the .htaccess file (with the leading dot) in your Joomla root folder. You can also check file’s content with your ftp client or filemanager and see if the mambo header comments and the apache directives are there (RewriteRule lines, etc)

If this is ok, your hosting provider could have the .htaccess overrides disabled, so you need to contact them. They may also have the override filename changed in apache config.

Meantime, you need to get your site back online and working until those problems are solved.

Reverting.

Here’s how it’s done:
open you filemanager or FTP client, and use it to rename your .htaccess back to htaccess.txt
Next, open your configuration.php file (wich is also located in your Joomla root folder) and change the
$mosConfig_sef = ‘1′;
line to:
$mosConfig_sef = ‘0′;

Save the configuration.php and you’re back to non-sef, but working URLs.

Resources 

  • Alledia’s Joomla SEO book offers an extensive insight on SEO and SEM(Search engine marketing)  for JOOMLA CMS

Running The Joomla Installer

March 18th, 2008

Finally comes the part where we put it all together. For the most part, Joomla installs itself and the only thing which needs to be done is to supply the installer with what we just set up above.

  1. In the folder location of where your Joomla files are kept (i.e. your Joomla site’s root), open the file “globals.php” in Notepad. Keep this folder open, we will come back to it later.
  2. Locate the line reading (~line 24):
    define( 'RG_EMULATION', 1 );

    and change it to read

    define( 'RG_EMULATION', 0 );
  3. Save and close the “globals.php” file.
  4. Open a browser to your Joomla site’s URL. The Joomla Web Installer should automatically come up.
  5. Every value under all three sections of the Preinstallation Check should come up in green. If not you need to address these accordingly. If you follow the guides on this site, you should not have any issues here. If everything is green, click Next.
  6. Read the License and click Next.
  7. In Step 1 of the installer, fill out the values accordingly:
    • Host Name: This is the name of your MySQL Server. If MySQL is installed on the same machine as IIS which hosts this Joomla site, enter “localhost”, otherwise enter the domain name or IP address of your MySQL Server which hosts your Joomla database.
    • MySQL User Name: MySQL user name set up earlier.
    • MySQL Password: Password for the respective user name.
    • MySQL Database Name: Name of the MySQL database set up earlier.
    • MySQL Table Prefix: This is appended to the front of all the Joomla database table names. The default value is recommended.
    • Drop Existing Tables: This option will completely destroy any existing Joomla database tables using the MySQL Table Prefix defined above.
    • Backup Old Tables: Use this option if you already have a Joomla site which uses the same MySQL Table Prefix defined above.
    • Install Sample Data: This will include sample menu’s and content in your Joomla database. For a production site, this should not be checked.

    Click Next once you have completed all these fields.
    Setting Up a Joomla Database Using phpMyAdmin

  8. On Step 2, enter your site’s name and click Next. For example, this site is titled “Joomla On IIS”.
  9. In Step 3, set up your site for the web:
    • URL: The web address used to access your site. This should have been filled in automatically based on the URL used to access the installer. You can change this as needed.
    • Path: The physical location on the web server where your Joomla files are located. This should have been filled in automatically.
    • Your E-mail: The Joomla site admin’s email address.
    • Admin password: This is the password which we be used to access the administration panel.
    • File Permissions: Select the “Don’t CHMOD files” option.
    • Directory Permissions: Select the “Don’t CHMOD directories” option.

    Click Next once you have completed all these fields.
    Setting Up a Joomla Database Using phpMyAdmin

  10. In Step 4, you should get a confirmation message. Minimize this window and go back to the root folder of your Joomla site from the beginning step.
  11. Rename or delete the “installation” folder. I typically rename it to “_installation”.
  12. Back on the browser window, click the Administrator link in the upper right corner.
  13. Log in to your new Joomla site using the user name “admin” and the password you set up earlier.

There you have it. Joomla is set up and ready to go. You can log into your site’s administration section and start to build your site.

Setting Up A Joomla MySQL Database Using phpMyAdmin

March 18th, 2008
  1. Log into phpMyAdmin as “root”
  2. Select the Privledges option.
  3. Select the option to add another user.
  4. Set the following values:
    • For user name, enter a value consistent with the site. I always make the user name the same at the site, for example “myjoomlasite_com”.
    • Leave the Host option set to Any Host.
    • Assign a password; again I use something with the site name.
    • Under the Database for User section, select “Create database with same name and grant all privileges”. In my example, this would create a database called “myjoomlasite_com” and assign the user “myjoomlasite_com” admin rights to it.
  5. Click Go to execute the query.
    Setting Up a Joomla Database Using phpMyAdmin
  6. Close out of phpMyAdmin.

Keep in mind, the above settings are strictly what I go by in order to maintain consistency. If you have a scheme which works for you already, you can easily adapt your preferences to the way you set up a MySQL database for Joomla.

Setting Up A New Joomla Site On IIS

March 18th, 2008
  1. Download the latest release of Joomla 1.0.x full package.
  2. Extract the downloaded zip file to a folder inside the root of your website directories. I always title the folder the same as the site name (i.e. I would extract to: \websites\joomlaoniis.com\).
  3. In IIS, create a new site (again I would call it the same as the site name) using the folder in the previous step as the root.
  4. Right click on the new site entry in IIS and select Properties.
  5. On the Home Directory tab, make sure the following options are set:
    • Read permission is checked.
    • Write permission is checked.
    • Execute permission is set to at least “Scripts only”.

    Setting Up a Joomla Site on IIS

  6. Click on the browse dialog to open the folder selection box.
  7. Right click on the Joomla source folder and select Sharing and Security.
    Setting Up a Joomla Site on IIS
  8. Set the Users group account (MachineName\Users) to have full control over the folder. If you prefer you can set the IUSR account to have full control instead.
    Setting Up a Joomla Site on IIS
  9. Click Ok to apply the folder permissions.
  10. Cancel to close the folder browse dialog.
  11. If you are using Host Headers on your server (if not, you can skip this step):
    1. Go to the Web Site tab and click Advanced next to the IP Address.
    2. Select the entry which contains the IP address of your site and then click Edit.
    3. In the dialog, enter the URL used to host your Joomla site. Do not include http:// in front of the URL.
    4. Optionally add additional bindings by clicking the Add button and enter the appropriate URL.
      Note: If you are using host headers, you should at least make entries for “myjoomlasite.com” and “www.myjoomlasite.com”.
      Setting Up a Joomla Site on IIS
  12. Click Ok to close the IIS Joomla site settings.

Now we are done with IIS, the rest of the work involves setting up the database and then running the Joomla site installer.

Installing PHP On IIS With MySQL Support

March 18th, 2008
  1. Download PHP (do not get the installer, just the zip package). I would recommend the latest version 5 release.
  2. Extract the downloaded zip file to a folder on your root drive, i.e C:\PHP.
  3. Copy the file “C:\PHP\php.ini-dist” to your Windows directory.
  4. Rename the copied file to “php.ini”.
  5. Open the php.ini file and make the following changes:
    • Locate the line reading: [mail function] (~line 672). Edit the line below this section for “SMTP” accordingly. For the most part your SMTP server will remain the default value of “localhost”.
    • Locate the line starting with: extension_dir (~line 475). Change the directory to “C:\PHP\ext”
    • Locate the line starting with: session.save_path (~line 966). Uncomment this line and change the directory to your system’s temp directory, most likely “C:\Windows\Temp” (you will need to allow full control for the “Everyone” group to this folder).
    • Locate the line reading: ; Windows Extensions (~line 580). Remove the semicolon in front of the following lines:
      • extension=php_mbstring.dll
      • extension=php_mysql.dll
      • extension=php_mysqli.dll
  6. Save and change the php.ini file.
  7. Open IIS.
  8. Go to the Web Service Extensions section and click “Add a new Web service extension” with the following settings:
    1. Extension name set to “PHP”
    2. Add the file: “C:\PHP\php5isapi.dll”
    3. Check the box to set the extension.

    Installing PHP on IIS

  9. Click Ok and now PHP should be listed in the extension list.
    Installing PHP on IIS
  10. Right click on the Web Sites section and select Properties.
  11. On the Home Directory tab, click the Configuration button.
    Installing PHP on IIS
  12. In the Application Configuration dialog under the Mappings tab, click Add.
    Installing PHP on IIS
  13. Set the application mapping settings as follows:
    1. Executable: “C:\PHP\php5isapi.dll”
    2. Extension: “.php”
    3. Uncheck the box for “Verify that file exists”. This is not needed (since we aren’t going to be moving the PHP files) and adds overhead to the execution time of PHP scripts if checked.

    Installing PHP on IIS

  14. Click Ok until all IIS dialogs are closed.
  15. Restart IIS by going to Start > Run and entering: “iisreset”
    Installing PHP on IIS

PHP is now installed on your IIS Server. To test it, you can make a file called “info.php” and adding this as the text:

<?php phpinfo(); ?>

If everything was installed correctly, you should see an informational page with all the details of your PHP version and configuration settings. Once you see this, PHP is up and running on your server.