Tip on installing graphic support for PHP in FreeBSD
GD is a graphic library that enable PHP to manipulate images, to install it from FreeBSD port us:
# cd /usr/ports/graphics/php4-gd # make -DWITHOUT_X11 install
The tip is to use WITHOUT_X11 option this will save you from compiling X Windows which is needed for some of GD supported formats.
New start page
Whenever I install new machine or a new browser I download one HTML file and make it my home page.
This start page contains:
- Search form for many of my favourite search engines.
- Links to my favourite links.
The start page save me a lot of time typing, since it have links of frequently used websites.
Give it a try, My Start Page.
Caching method compared
I tested different types of caching, here is my times:
Method | Hit Time | Improvments over Miss |
---|---|---|
File | 0.00029 | 19337.93% |
MySQL | 0.00064 | 8762.50% |
memcached | 0.00103 | 5444.66% |
Altought File caching is much faster that the other two methods, it can suffer from file locking problems, and can’t be shared between more than one server.
memcached client used is written in PHP which will slow it down a little bit.
So MySQL seems the ideal choice 😉
New plans for alriyadh.com
When I started building alriyadh.com website I decided to generate all pages as static HTML files, I relied heavily on Server Side Includes (SSI) to build complex pages.
The main reason for this decision was the fact that the server was very slow on processing PHP files, espcially with a site with high load.
Generating static HTML files has its advantages but it also had many problems:
- Regenerate everytime you want to test a change
- Changing the design will cause regenrating the whole website, which could take forever.
- Generating complex pages is very hard, I had to rely on SSI.
- What to do with pages that change frequently, e.g. pages with comments.
- When importing old data, you need to generate them as well.
- Static HTML files performance advantage for frequently used data, like todays issue, but for old issues it just take a lot of disk space.
Soon I’ll start testing dynamicly generated of pages with these points in mind:
Ruby on Rails
Ruby on Rails is a web development framework written in Ruby computer language.
It is based on the Model-View-Controller (MVC) architecture.
Smarty does a good job in the areas of View-Controller in PHP language, but I always had a feeling that the model part can be improved, but no idea how. I raed a little about Object-Relational mapping but it seems very complicated and very restircting.
Ruby on Rails on the other hand does a good job in the these 3 areas, specially the Model part, they have something called ActiveRecord which maps database tables.
There are also PHP clone for Ruby on Rails, Cake PHP, it is still in its early phases, but could give a feeling of what Ruby on Rails can offer.
Saudi Ubuntu Yahoo Group
Osama Aldosary started a Saudi Ubuntu email group at Yahoo Groups, join us!
Click to join subuntu
Upgrading SAUDI NET mail server
We’ve just upgrade SAUDI NET main mail server 350GB, RAID-5, simply awesome.
My Sun Certified System Admin notes
It is little old but I found it useful from time to time. My Notes
no-www
I removed www from my site name, so from now on it is only http://rayed.com/, www.rayed.com will be still acceptable but will be redirect to rayed.com.
Here is how it is done in Apache:
<VirtualHost *> ServerName www.rayed.com Redirect permanent / http://rayed.com/ </VirtualHost>