Tag Archives: php

Improving Your WebSite Performance

Why is my site slow?
Why is my Bounce Rate so high?
How to improve my site’s performance?

These are some of the questions bothering web masters and site owners all the time,
here are some tools and readme’s that will:

  • test your site
  • find bottle necks
  • measure performance from the outside
  • get tips for fixing the problem areas in your site
  • and knows list of issues every site is suffering from

so lets start with online freeware tools and external web site test tools.

Check if your Google Analytics is working well in your site

Who is watching the watchman?

first thing to check – are you getting the accurate statistics from your site?
is your Analytics account configured well?
are you even really using one?

SiteScan™ is a diagnostic tool from EpikOne that verifies if your Google Analytics (GA)
Tracking Code is installed properly on your website.

sitescan google analytics

This scan will go over each page and verify that the Google Analytics code is embedded correctly to each of your page, this can help you diagnose if your bounce rate is high because the Analytics cant see their next click,
or maybe you should really work on your site design.

How does my code looks like from the browser?

firebug

From the firebug download page:

Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page..

This is the basic tool to verify your code as it seen from the browser side,
you can click a specific element on your page, and get a list on the right pane window of firebug,
of all the css code that is effecting this element, even if the code span multiple css files.

Why is my page so slow?

the yslow tool from yahoo will go through the elements of your page,
and by using a preset list of rules, it will tell you which parts of the website you should fix,
and what to fix.
yslow

The yslow firefox plugin needs the firefox firebug installed first.

If you want to learn more deeply on the reasons behind each of the testing rules yahoo though about you can read the very informative document from yahoo about “Best Practices for Speeding Up Your Web Site

Feed Validator

Get your rss feed validated

AOL webpagetest

from the AOL web page test:

Pagetest allows you to provide the URL of a webpage to be tested. The test will be conducted from the location specified and you will be provided a waterfall of your page load performance as well as a comparison against an optimization checklist.

aol pagetest waterfall

Technorati Tags: , , ,

Implementing MediaWiki

My favorite type of wiki is mediawiki,
I love the ease of use, the huge matrix of extensions available,
and the look and feel of the wiki itself.
backup, restore and upgrade support are also very important reasons to choose a specific wiki software,
and having gone through all this steps in mediawiki, I am very pleased with the ease of use.

Starting from the begining:

what is mediawiki?

MediaWiki is free server-based software which is licensed under the GNU General Public License (GPL). It’s designed to be run on a large server farm for a website that gets millions of hits per day. MediaWiki is an extremely powerful, scalable software and a feature-rich wiki implementation, that uses PHP to process and display data stored in its MySQL database.
Media wiki site

Media wiki also saves the versions of the updated files – allowing for easy reverts and versioning of edited files.

The largest sites using medaiwiki:

Mediawiki large sites list

Design matters

Wiki website doesn’t have to have the MediaWiki standard look,
you can design the look and feel either manually to suite the corporate guidelines or with existing skins.

Novelle’s wiki site:

Novell wiki site

marvel.wikia.com:

marvel

Extensions

Extensions are compilations of PHP code that add new features or enhance functionality of the main MediaWiki core. Extensions are one of the main advantages of MediaWiki. They give wiki administrators and wiki end-users the ability to adapt MediaWiki to their requirements.

The extensions can add capabilities like:

Integrate into the Organization

Using LDAP we can integrate the wiki with the main active directory.
http://www.mediawiki.org/wiki/Ldap will show you the step to add ldap support to the wiki install,
with ldap you can have single and multi domain authentication (including local database)
Retrieval of user information from LDAP:
  • Email address
  • Real name
  • Nickname
  • Language
you can configure the wiki to allow to only domain users to access the server, and you can create wikis that will be accessible only by a specific domain group/users.
You can restrict edit access only to users who have created an account AND verified their email address.
more features the mediawiki ofers:
  • A watch list – update by email when a watched page has changed.
  • By default, MediaWiki’s page URLs look like /index.php?title=Your_Page,
  • but an .htaccess file tweak can make them look like Wikipedia’s clean /wiki/Your_Page links.
  • When a user submits an edit to a page, MediaWiki writes it to the database, but without deleting the previous versions of the page, thus allowing easy reverts in case of vandalism or spamming.

First steps with editing wiki pages

http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Editing_overview

This simple editing tutorial will show you the basic step in editing a new wiki page:

  • headings
  • lists
  • links

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: , , , , , , ,

Apache and MySQL on windows

xampp apache and mysql on windows

Although I’m a great Linux fan, i still have Windows on my personal computer, since the computer is not used by me alone, and although i have various Linux OS installed on this same computer, most of the time its on the windows mode. so what do i do when i need to test something on wordpress or mediawiki?

For that reason i needed a development environment on my home computer that will run Apache, MySQL, php and Perl. There are some ways to go about that – i could have installed Cygwin, which is a Linux-like environment for windows.

Another way to go about it is to install the windows version Apache and mysql and php and perl.

These two options are fine solutions but they will need some more work on them , other then the point and click option which is xampp.
xampp for windows version 1.7.1 on default will include all of these:

  • Apache HTTPD 2.2.11 + Openssl 0.9.8i
  • MySQL 5.1.33
  • PHP 5.2.9
  • phpMyAdmin 3.1.3.1

and if you want to can add Perl 5.10.0-2.2.11 from their Add-Ons page.

The install process is a next,next,next version of a regular windows install, and in the the end you have everything installed into the default location at C:\xampp.

xampp control panel

This is the windows control panel that stops and starts the Apache and MySQL for you if you don want to install them as services, personally i prefer to start them when I’m developing since they are resource heavy applications.

Some default file locations:
the html and php files are installed to C:\xampp\htdocs
Perl scripts should be placed here: C:\xampp\cgi-bin
the php.ini (php config file) can be found at: C:\xampp\apache\bin\php.ini
httpd.conf (apache config file) is located in: C:\xampp\apache\conf

Note that for Unix Perl scripts you need to replace the first line with the location of the Perl binary on your windows, so it should look like:
#!”C:\xampp\perl\bin\perl.exe”

Another not is that the xampp on default is set to work with php 5 , but you can from the xampp configure page which is at http://localhost/xampp/ , use the “PHP switcher” and change the install to work with php 4 instead.

And that’s it – your local development website is ready and is available at: http://localhost/ to play with.

Technorati Tags: , , , ,

13 books and magazines for linux sysadmins

This is a list of books and magazines i read through the years to learn my job,
there are many other good books as well, but these are my must haves.

1) Magazines:

linux format linux magazin

These two magazines I have been reading for years and they keep getting me fresh ideas and money savers for work,
they have some tutorials for beginners, some more heavy weight material, and fun projects for the free time (ach, whose kidding, what free time…).

although the info in them is usually a little out of date – they are published once a month and the industry is moving so fast, they do have a lot of good ideas in them, and it much more fun to snuggle with a color magazine then sit in front of the screen to read.

2) DNS:

DNS and BIND (5th Edition)

DNS and bind – every Linux sysadmin should know networking as well, and DNS is one of the pillars of the Internet,
even if you are not responsible to a DNS server, if you are working with anything related to the web or networking, you are using DNS, and knowing this subject good will help you solve many networking and web related problems.

3) Sys Admin handbooks:

linux_system unix_system

These are two books from the same authors, both are fantastic easy to use, in depth system administration books,
but you should buy just one out of the two since they very much a like.

so which one to buy? that depends on what flavors of unix/linux you need this info for:
UNIX System Administration Handbook (3rd Edition)
if you have many different unix servers at work you should get the unix book, it covers Solaris 2.7, HP-UX 11.00, Red Hat Linux 6.2, and FreeBSD 3.4.
a little out dated, but still very helpful as it will show you how to do the same thing in the different systems.

Linux Administration Handbook
on the other hand, if you have different linux versions running this book covers redhat, suse and debian – again showing you how to do the same thing in the different flavors.

4) PHP scripting

Different scripting languages are good for different things, PHP is good for building web interfaces for actions you wish your users to do without a shell account on your server.
php allows you to easily build forms and web pages to manipulate files on your server, and changing passwords, restore and backup files, etc…

php_cookbook programming_php

Programming PHP
Is the php book to start with, it takes you through the step of learning a new language and writing easy code.

PHP Cookbook
this php book will give you real world questions and answers for php coding – like how to open and read each word in a local or remote files, working with other web pages etc..

5) PERL scripting

PERL is faster to use when you want to do heavy weight work on databases or files and text manipulation and sorting.

Learning Perl, 5th Edition
The learning perl book will teach you perl from the beginning with real live samples and mind you – perl is tricky.

Programming Perl (3rd Edition)
this is a more in depth book for perl.

6) Bash shell

bash is the most popular shell for the linux environment, its strong and flexible and allows you to do many manipulations from the command line on files and texts, and its a great scripting tool to ease the work of a weary linux sysadmin (or lazy – its a great moto – always write something once).

Learning the bash Shell: Unix Shell Programming

and

bash Cookbook: Solutions and Examples for bash Users

as you can see by now, i really like the combination of a learning book and a cookbook 😉

7) security

hacking_linux_exposed
Hacking Exposed Linux, 3rd Edition

learning what your enemy knows will help you better understand where to look for security holes,
working in this job turns you slowly into a paranoid sysadmin if you wish to continue working, and this book will give you an insight into where likely holes in your servers will be and how to clear them.

8). IT management

practice_system
Practice of System and Network Administration, The (2nd Edition)

Never forget, your not only a linux sysadmin, you are also working in the IT environment and your decision and work is not just linux, you also need to consider network and the other servers and services around you.
this book is about the practice itself, not the technical stuff which we should all learn, and its based on the vast years of experience the authors have.
for example – how to build a support system – the people the software etc,
or how to structure your mail system so you will have place for growth when the company grows.

one of the best books I have read!!!

Technorati Tags: , , ,