Archive for the ‘Opinion’ Category

Case Sensitivity in URLs

Wednesday, October 17th, 2007

I am an open source guy - so naturally I prefer the flagship OSS software Apache to the proprietary Microsoft IIS. But there is one area where IIS does a better job than Apache - the case sensitivity of URLs.

Are URLs Case Sensitive?

They should not be - but they sometimes are. Domain names are not case sensitive - for example http://www.apache.org/ and http://WWW.Apache.Org/ goes to the same location. But in the LAMP platform, the path is case sensitive…

But in the case of Microsoft IIS server, this is not true - try…

Reason: Linux Filesystem is Case Sensitive

The root cause of this is that the filesystem in the Linux OS is case sensitive - while FAT32/NTFS filesystems in Windows are not.

Dynamic URLs

Now Dynamic/friendly/clean URLs are appearing in many CMS tools. A good example for this is the ‘permalink structure’ in WordPress. These dynamic URLs could be case sensitive or not - it depends on the software. In WordPress they are case insensitive. Del.icio.us is also case insensitive. TinyURL is another service that uses case insensitive URLs. But it is possible for the tool to make the URLs case sensitive.

From the SEO perspective

If the search bot visits two urls say, example.com/MyWebPage/Index and example.com/mywebpage/index , will the bot index both page contents? If they are same, will one get the duplicate content penalty? Or will google just index the URL with lower case and ignore the other - remember, in Linux/Apache, both pages may have different content.

Conclusion

The RFC for URL says they must be case insensitive.

For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names (e.g., allow “HTTP” as well as “http”).

Apache must not use the filesystem as an excuse - I really hope they provide case insensitive URLs

Between Web Application and Desktop Applications

Sunday, August 26th, 2007

There is a distinct line between web application and desktop applications. But over the last few years, this line is becoming thinner. Due to faster internet connection and technologies like ajax, web applications are becoming much faster and more responsive. And, if you have a local web server installed, a ‘web’ application can become desktop application.

I have a web server(Apache), and a database server(MySQL) running at all times on my local system. Since LAMP is my preferred platform of development, if I need a new software, I will create it on LAMP. A good example of this is Nexty. Over time, I have discovered that web application can be used as desktop applications. All you need is a web server, a database server and a browser.

There must be some changes to the current model to make this system work. These are a few I could think of…

  • Web Server must run as the current user. That way, you can read/write to any file using PHP(or equivalent).
  • The application must not be available over the network. Or, the web server must only accept connections from 127.0.0.1
  • An installer for these kind of applications must be made.

Advantages

  • Familiarity: People are already used to web applications - so it will be easy to switch.
  • User Customizable: Users can change the appearance of the application(user stylesheets), and to a limited extent, the functionality(GreaseMonkey).
  • Open Source: If the code is in PHP or Ruby on Rails, or anything similar, the code will be available for study or even modification.
  • Cross Platform: The same program can be installed in Windows or Linux or whatever - as long as it has a Web server.

Disadvantages

  • Imaginary: As of yet no such system exists.
  • High Level: The system will not be able to do low level system operations.
  • Limited: There will be some very serious limitation to the application unless the current systems are modified. For example, the browser cannot read or write to the filesystem.

I have been using some web applications as desktop applications for a while now - these include WordPress(for keeping notes), activeCollab(project management), Nexty(to do list), and Tiker(time tracker).

Choosing a License

Friday, August 10th, 2007

License

As you may know, I publish a lot of code for others to use. Often I forget to specify a license for the code - and I get a few comment asking me what license it is under. So I have created a license page for both Bin-Co and OpenJS. I hate restricting use of my code - so I choose the most permissive one around - the BSD License.

I know that many people feel strongly about software license. I still get a lot of flank from my LUG because I prefer using BSD License over their favorite GPL.

GPL was not an option as most of my code are snippets that are meant to be used with other code. GPL will not allow my code to be used within proprietary projects. Another option is LGPL - but I still prefer BSD.

Basically, all scripts, codes and programs from any of my sites are in the BSD License. That means that you can do anything with the scripts - except claim that you wrote it. You can use, copy, sell, modify or whatever you want with it - but you cannot claim authorship.

Importance of Choosing a License

If you are planning to release your code publicly, it is very important that you say what license you are using. If you fail to specify a license, many people will not use your code. It was a big mistake waiting this long before putting up a license on my sites.

If you want help in deciding the license, these links should be of help…

More Links

Nexty 2 will use PHP 5

Saturday, August 4th, 2007

GoPHP5

The next version of nexty is coming out very soon - and unlike the last version, Nexty 2 will require PHP 5.

The main reason behind this change is GoPHP5. Go PHP 5 is a movement to promote the use of PHP5 in hosting servers and for projects.

Another reason for this decision is that iFrame, the framework I used in Nexty, uses PHP 5.

If you are stuck with PHP 4, I cannot help it. You can still use the first version. But if you have a choice, PHP 4 is dead - move on.

More on GoPHP5

Web Application Installer

Sunday, July 1st, 2007

Almost all distributed web applications has an installer - it makes installation process easier for the end user. I will try to outline some of the most important things to look out for when creating an installer.

Examples of Web Installers

WordPress

WordPress Installer Screenshot

Joomla

Joomla Installer Screenshot

Nexty

I have created an installer for Nexty - I used the same installer for Jus5 as well. Here’s a screenshot…

Nexty Installer Screenshot

Functions of an Installer

Check Requirements

If you software needs the GD PHP extension, check for it - it it is not present, show an error. If any folder must be writable, check for that. Make sure that the user cannot go to the next page without solving all the problems.

Make sure you have provided clear instructions on how to solve the problems - changing the permission might be easy for you and me - but the average user will find it very hard.

Database Connection Details

The user have to provide this data if our system uses a database.

  • Host
  • User
  • Password
  • Database

In some applications, the user must manually enter these data into the config file(for eg. WordPress). In other software, the user have to enter it at the time of installation. For example, Joomla uses this method - as does my application, Nexty.

Create tables and insert initial data

Check for existing data first - you don’t want to delete the existing data when reinstalling the software. This step is necessary only if you are using a Database in your application.

Save the inputted data

The user inputted data must be saved - in my application I just write it to the config file. But for that to work, the config file must have write permission. I also give the user an option to copy the code and place it in the config file themself.

Joomla also writes the values to a config file. However, WordPress inserts the data into the database. The only thing in the config file in wordpress is the database connection details - which the user must enter manually.

Disable the Installer

Make sure that the installer cannot be run after the installation is successfully compleated. This is important for the security of the application. You really don’t want any Yahoos opening up the install URL of your application and resetting all the data!

The easiest way of doing this is just deleting the installation script/folder. Joomla insists that you remove the installation folder before letting you use the application. In Nexty, removing the installation directory is recommended - but not enforced.

More on Web Installers in the next post.

Subscribe to Feed