Category Archives: web admin

WordPress Theme – The Loop explained

I’ve been wanting to learn WordPress theme design for a long time now,
but every time I started reading about it I heard the words “The Loop”,
and never understood what are they talking about.

Well finaly I joust found this great intro to wordpress theme writing,
it’s simple, written for beginners, and explains the basics of what blog template writing is all about.

Matt’s post explains what the loop is – which from what i gather – a simple query that collects all the relevant posts to show,after first calling it with the first line:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

now you start dropping the other wp blocks into place just like lego:

the title,
the date,
the content

and thats it – now the loop will just drop these 3 again for the next post, until it runs out of posts.

From matt’s post:

There have many concerns and question about the template system used in WordPress. Mostly the concerns are with n00bs and the complications of PHP. “I want to change this and that, but don’t know PHP”. I hear this a lot. But the thing is, you don’t need to know PHP to change the Templates in WordPress.

so thanks Matt for helping me to finally understand what its all about :)

Google and SEO: Matt Cutts videos

google_IO_2009

Anybody writing a blog or editing a web site knows the importance of SEO for its search engine ranking, search engine optimization is second in importance to a good page content alone.
The words are arranged in the site, the headlines, the page title, meta tags and other on page elements can affect the site’s search engine ranking and basically – count for how many people will see the page at all.
Like the old saying – Its not just what you say, its how you say it.

And that’s where Matt Cutts comes into the picture,Matt works for Google search engine group for a long while now and has many insights into how Google ranking works and what to do if you want to be part of the top 10.
These are a couple of great videos featuring Matt, where he explains and shows many examples as he reviews specific sites for the good and bad elements in the sites SEO wise.

Another great lecture from Matt, although a little old – and yet still very relevant is the SEO for wordpress lecture which is really worth the time spent listening to,
In his Blog Matt gives many links to those who don’t want to listen the full hour it takes,
starting with the power point from the lecture, through a full transcribe of the talk, and even a shorter summery for the full lecture.

Basically since I have started to follow these guidelines,
my web site traffic has doubled itself and that’s the best incentive I can offer to sit and watch the 2 videos as long as they are, so go on and watch them, you’ll thank me later…

Technorati Tags: , ,

Apache Active Directory Authentication

Apache server is a strong web server that can serve great open source application like Mediawiki which is a great solution for information sharing,
but what if you want to use Mediawiki to share information only for the local office active directory domain members?
Or even only to members of a specific group in the active directory?

In Apache you have a specific module called mod_ldap which allows you to use the Active Directory as an authentication server for your users,
so you can create a secure wiki branch for each department users.

To setup the apache server to use Active Directory as access manager you will need to make sure the mod_ldap was compiled with the apache server and that these lines are in the httpd.conf file:

LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule ldap_module modules/mod_ldap.so

If you have a Windows server installed with the xampp install of apache and mysql, you will have the module pre-compiled into the apache server,
however testing that it’s loaded can be done with:

C:\xampp\apache\bin\httpd.exe -t -D DUMP_MODULES
the output should have these lines:
authnz_ldap_module (shared)
ldap_module (shared)

Once you have the mod_ldap modules loaded you can add to the apache configuration file the user authentication support:

Any Authenticated user from the Domain:

<Location /Finance_Wiki>
Require valid-user
AuthType Basic
AuthName “Finance Wiki Access”
AuthBasicProvider “ldap”
AuthLDAPBindDN “CN=proxy_user,OU=sub_group,OU=main_group,DC=some,DC=domain,DC=com”
AuthLDAPBindPassword “proxy_user_pass”
AuthLDAPURL “ldap://pdc.some.domain.com:389/OU=main_group,DC=some,DC=domain,DC=com?sAMAccountName?sub?(objectClass=*)”
</Location>

The AuthLDAPBindDN and AuthLDAPBindPassword settings are for setting a user that will allow the apache server to browse the Active Directory structure,
the user created for this should have the minimum rights possible in the domain.

This specific apache configuration will allow any user from the domain to share the /Finance_Wiki folder, but if you want to allow access for a specific group you need to add this configuration line:

require ldap-group CN=groupname,OU=group.container,OU=main_group,DC=some,DC=domain,DC=com

This is the part that will require the active directory authentication for a specific group.

This way you can prepare a wiki branch for each group in your company to securely share internal files.

Technorati Tags: , , , , ,

Get Better Google Adsense Ads!

For site depending on Google AdSense commercials for income,
it is important to have better targeted ads to your content, n order to get better results from the ads,
an easy way to get better targeted ads on your site is by telling google what are the important parts on the page and what they should take special notice of.

adsense-google_b

You can take a look at the adsense targeting page or read the short version below:

Target area for adsense:

<!– google_ad_section_start –>

<!– google_ad_section_end –>

I think its best to have the whole post between these tags, and I also include the comments section between them,
and you can use more then one section like this on your page.

Make Google ignore a part of your page:

<!– google_ad_section_start(weight=ignore) –>

<!– google_ad_section_end –>

For wordpress you need to edit the single.php and add the tags before and after the post data.

Hopefully this will bring better targeted ads for each page, and higher click rate. good luck!

Technorati Tags: , ,

Test http server from windows command line

curl for windows

So you went ahead and did a little change to your web site, or web server redirect,
and you want to test it out without a sniffer,
the fastest way to test the http server headers and output is from the command line so you can see exactly what the servers is sending.

Now from Linux you have built in tools like GET, and wget ad curl,
wget and curl you can also install on windows to work from the command line.

Curl For Windows

Go ahead and download curl from their main website, you should get the Win32 – General version,
or the Win64 binary.
Better take the SSL enabled version if you will ever need to test SSL.
Take the curl.exe file from the zip file and place it somewhere in your windows PATH.

To find which directories are already in the windows path open the command line and write:

C:\>echo %PATH%

You will get the listing for such directories, just place the curl.exe in one of them.

Now for the tests:
To get only the headers and not the file contents itself use “curl -I http://address”

C:\>curl -I http://some.site.com/blocked_folder/blocked.php
HTTP/1.0 403 Forbidden
Server: Apache
Accept-Ranges: bytes
Content-Type: text/html
Expires: Tue, 27 Oct 2009 19:32:38 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Tue, 27 Oct 2009 19:32:38 GMT
Connection: keep-alive

From this test you can see the file is forbidden, what are the caching setings for the server, and other headers information.

If you would like to see the full page contents just remove the “-I”.

another sample:

C:\>curl -I http://www.cisco.com/
HTTP/1.1 200 OK
Date: Tue, 27 Oct 2009 19:36:28 GMT
Server: Apache/2.2
Set-Cookie: CP_GUTC=62.214.121.218.123463458258569; path=/; expires=Sat, 21-Oct-34 19:36:28 GMT; domain=.cisco.com
Last-Modified: Tue, 27 Oct 2009 16:34:14 GMT
ETag: “5985”
Accept-Ranges: bytes
Content-Length: 22917
CDCHOST: cdcxweb-prod1-02
Content-Type: text/html

this time we got a 200 reply which means the apache sent us the page,
we can see the page’s size from the “Content-Length” header,
and the other info the apache wants to send us.

Testing for Virtual hosts

Virtual hosting on apache can mean having more domain names on the same IP,
and you can test each of these domains by adding a “Host” header to the curl test line:

curl -H “Host: sub1.host.com” http://www.hosting.com/
curl -H “Host: sub2.host.com” http://www.hosting.com/

These 2 lines will bring back the html code for each of the different virtual hosts on the same server.

Here are some more ideas of using curl -for example:
Sending POST data through curl

Technorati Tags: , , ,

How to start learning Linux

If you want to start learning Linux the best advice I can give you is:

Start out as a user first

The simplest way is to download some live CD from the Internet,
for a sample this one:
Centos live CD
or: 
Fedora liveCD
Either of which will boot into a full working Linux distro,
without installing anything on your windows box.
when your done playing with the Linux server, just remove the CD from your computer, and reboot – your windows will come right back.
both the distros I’ve linked to here are very similar – they use the same redhat code, but the fedora is more cutting edge development version of everything and the centos is a stable server environment.
The fedora LiveCD will also allow you to install it to the machine your using from the LiveCD itself – after the boot you will see an install Icon on the Linux desktop.
Start playing with the servers, while reading some linux tutorials,
start as a Linux user and then work your way up to power user and to admin in the end.

Hands On Training Tasks for Linux Sysadmin

After your feel you know your way around as a user:

  • reading and writing files
  • working your way around the file system
  • installing some rpm packages

You can start working your way through some serious hands on training – try to do either of these:

  • Setup A stand alone DNS server
  • Setup Apache server with php and SSL
  • Install MySQL server from sources
  • Setup sendmail
  • Install WordPress or Joomla on your Apache/MySQL and happily see it all working together

Each of these tasks will take a long time to figure out for the first time, and on the way learning to do the task, you will learn a lot more things that you wouldn’t have just by playing with the server.

Technorati Tags: , , , , , , ,

WordPress 2.8 and a new Theme

I have upgraded the site to wprdpress 2.8,
and it does feel faster for the admin part,
also I have installed the free Typebased theme from  http://www.woothemes.com/

From my first impression i can see SEO mistakes that need to be fixed, like H2 tags on widget titles like Categories,
ill finish the last updates soon.

Check the site out and tell me what you think !!!

Technorati Tags:

SEO guides – the best i found on the net

best seo guides

SEO – the art of search engine optimization, is a subject worth learning, and im reading and searching for information and tutorials about it all the time. many sites are talking about SEO and give a lot examples and full guides, but this week i found two really great guides worth reading and applying.

SEO Tutorial

The first guide is from The Dough Blogger which is in interesting site,
it has only 3 pages at all, and yet it has a Google Page rank of 4, which is impressive for such a small site.
The tutorial itself is The Ultimate Guide to Starting a Money Making WordPress Blog,
and you can grab at it here.
Although some of the recommendations in it i didn’t apply to my site, there were other that i did the first thing after going over the tutorial, a great example would be the theme <h2> tags.
In the theme im using here, the right sidebar has widgets in it, and their titles from the wordpress default are <h2>, which makes Google think the important words on my site are pages and categories.
Another point i found interesting is the update Services: when you publish a new post the wordpress software can push that post to different update services, but for that you need to add them to the wordpress config.

Make money online case study

Now this guide left me awake until 4 AM, i couldn’t stop reading it, it was so inspiring and moving.
On the googlelady site i found this guide, with the weekly steps she did to generate revenue from her new from scratch web site.
she started a new fresh site, with no page rank, and on a niche she doesn’t know anything about, and with only 100$ in her budget, and a 3 months time limit.
after 3 months she created 11,000$ from that site.
Its an amazing guide and im still reading it over and over and applying the lessons.

Free SEO Tools

Another good link is for the good guys at gscripts with their Free SEO Tools page,
they have backlink checker – which will also show you the page rank for each link,
keyword density tool for you to count the most appearing words on your site,
and search engine position tool – which helps you find your location on the list for a specific search keyword.

I’m starting to apply these guides now, and ill update when i see results!!

Technorati Tags: