Next >
Page:   
Recent Blog Posts:
Category Mobile - Web - Media
Date Tuesday, Sep 11, 2007 6:44:17 PM
Running LightTPD and PHP on Windows
While I honestly feel ColdFusion is a great platform for Web Applications, it turns out there's some things it's not so great at, one of which is serving of a lot of files, and in my case, it's the streaming and downloading of mp3s. ColdFusion has a max thread count setting, and if you are serving an mp3 file via CFContent (to hide the file's location, and handle tracking it's use), this max number becomes a serious limitation.

This has now become a problem because ArtistServer is seeing more traffic and more listeners, which means more streaming and downloads. We've started hitting that max thread count, and need to move the mp3 streaming and downloading to another solution. My goals for the new solution include:
  • High availability – Able to support a large number of simultaneous users
  • Free – I can't afford to purchase solutions, and I'd like to move more into open source solutions
  • Stable – While I am looking for mature solutions, I will try newer options if they look promising, but they need to be stable
  • Focus on serving files – If possible, the soltuions will need to be ideal for serving files and supporting byte ranges (ffwd an mp3)
  • Can Run on Windows – I'd like to move to linux, but I'm hesitant to change everything at once.
After some research, I decided to try a relatively new Web server called LightTPD and PHP, a Web standard. For the OS, I'll use Windows 2000 Advanced Server. The process takes a few steps, so I thought I'd outline them and post the process so that other's can save time and use this as reference.
From the lighttpd Web site: http://www.lighttpd.net/

lighttpd is used by many well-known sites. The typical scenario is using lighttpd as off-load server to push out static content and leave to complex work to another server. One example is YouTube. They have a farm of servers which push out the thumbnails you see before you see the movies.

Security, speed, compliance, and flexibility--all of these describe LightTPD which is rapidly redefining efficiency of a webserver; as it is designed and optimized for high performance environments. With a small memory footprint compared to other web-servers, effective management of the cpu-load, and advanced feature set (FastCGI, CGI, Auth, Output-Compression, URL-Rewriting and many more) LightTPD is the perfect solution for every server that is suffering load problems. And best of all it's Open Source licensed under the revised BSD license.

light footprint + httpd = LightTPD (pronounced lighty)

For my specific case, I now have a test server setup with lighttPD and PHP, and have started working on a translation of my file serving/streaming/tracking code. Once I have the code up and running, I can start testing on linux server and consider removing Windows from the equation. Making a platform change would provide even better performance and a higher number of concurrent users. Why not do it now? Because I'm new to PHP and don't want to change all the elements at once. After I gain a comfort level with PHP, I can start working with it on linux.

Windows + LightTPD + PHP

  1. Install Windows Server: I'm using Win2000 Adv Server. Remove all the items from the installer that you won't need on a server, like games, etc. Uncheck everything that deals with IIS, the mail server, and ftp. I suggest using other options for FTP. I don't know of a mail server to use, so if you must, install Microsoft's mail server.

    Once Windows is installed, run Windows update and reboot accordingly. Do this until you finally do not see any more updates. With Win2000 Server, I had to upadate 'Windows Update' then do a few updates, then about 54 updates, then another 9, then a few more... so it takes awhile.
  2. Download: Now download all the software you'll need to run the server. In my case, this will include:
  3. Install: VNC Server – for remote access, Notepad++ for editing config files, and FileZilla as your FTP server
  4. Install LightTPD: I suggest installing to the root: C:\lighttpd
  5. Install PHP: I suggest installing to the root: C:\PHP - during installation, you will be asked to select your server, select 'other CGI' as 'lighttpd' is not a listed option.
  6. LigHTTPd Configuration – I'm using version: 1.4.18
    • Open the configuration file: C:\LightTPD\conf\lighttpd-inc.conf
    • Uncomment mod-cgi – just delete the '#' in front of it.
    • Uncomment mod-rewrite - same method, unless you don't need it
    • edit "index-file.names" leaving only: "index.php", "index.htm"
    • consider trimming the mimetypes down to what you would be serving
    • edit "static-file.exclude-extensions" - set to ".php" only
    • be sure to create a file for catching errors – uncomment this line after you create the file and save it at the root.: server.error-handler-404 = "/error-handler.php"
    • Uncomment cgi.assign, delete all but php, and add a slash: (".php" => "PHP/php-cgi.exe") to this: (".php" => "/PHP/php-cgi.exe")
    • Set LighTTPD up as a service – first, click on this exe file: C:\LightTPD\bin\Service-Install.exe When I tried this, the registry entries fail, so the next step is to edit the registry and add the keys by hand (or a .reg file). Be sure to replace the lighttpd installation directory with your own. Save the following as a .reg file and double click on it to merge these keys with your registry (if the service installer did not show an error, skip this step):
      Windows Registry Editor Version 5.00

      [HKEY_Local_Machine\SYSTEM\CurrentControlSet\Services\LightTPD]
      "DisplayName"="LightTPD"
      "Description"="A fast, secure and flexible webserver - WLMP Project"
      "ObjectName"="LocalSystem"

      [HKEY_Local_Machine\SYSTEM\CurrentControlSet\Services\LightTPD\Parameters]
      "AppDirectory"="C:\\LightTPD"
      "Application"="lighttpd.exe"
      "AppParameters"="-f conf\\lighttpd-srv.conf -m lib -D"

      [HKEY_Local_Machine\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\AuthorizedApplications\List]
      "C:\\LighTTPD\\lighttpd.exe"="C:\\LightTPD\\lighttpd.exe:*:Enabled:LightTPD (WLMP Project)"
    • At this point, you may need to stop/start the lighttpd server service – I use the Computer Management Console – and navigate to the Services icon, then the actual service.
    • In your browser's address bar, type: localhost – you should now see the default index page for lightTPD. If not, possibly the registry keys were not added correctly, or you made a mistake when editing the lightTPD configuration file.
  7. PHP Configuration – I'm using version: 5.2.4
    • open the php.ini file: C:\php\php.ini
    • move the upload temp and session directories, and changed their references in the php.ini file:
      upload_tmp_dir="C:\php\upload"
      session.save_path="C:\php\session"
    • locate and set: doc_root ="C:\lighttpd\htdocs"
  8. Test the server
    • create a new text file in the web root called index.php
    • type this into it:
      then save
    • in your browser's address bar, type: localhost
    • you should see the php info specs in your browser
  9. Alternate Setup: Unfortunately, fastCGI on Windows either doesn't work, or doesn't work very well (at this point in time), which means it won't work with lightTPD. There are many other options for you to tweak and try in the configuration file, my only suggestion is to save a copy of this first version of your configuration file as a backup.
  10. Finish:

This information is offered for free and does not imply any responsibility nor consultation. If you have any questions, I'll do my best to answer, but I think the best thing to do is to post to the lighttpd forums.

Good luck in your developments, I'll post again once I have made some progress.



Tags        

ADD TO:
Add to BlinkBlink
Add to Del.icio.usDel.icio.us
Add to DiggDigg
Add to FurlFurl
Add to GoogleGoogle
Add to SimpySimpy
Add to SpurlSpurl
Add to Y! MyWebY! MyWeb

Permalink:

Category Mobile - Web - Media
Date Wednesday, Aug 29, 2007 9:35:26 AM
HostMySite.com Limits ColdFusion, Does Not Tell Customers
Are you considering HostMySite.com as a Web host for your ColdFusion site?

If you are, please read the following, because you won't find this information out on the the HostMySite.com Website - in particular, this post refers to their "Builder" package.

Two months ago, a new client of mine wanted their site hosted with a 'more established' ISP as opposed to hosting with my current ISP - who is great, very responsive, honest, etc. - but they are small, have less resources, etc. While they aren't 'big,' my host is at a great facility and we have a lot of bandwidth available. I definitely recommend them. HostMySite.com on the other hand... is a company you may want to avoid.

The issues I'm going to cover here came up because I ran into a problem when trying to upload a 1.2mb zip file using a very simple file upload script. The upload failed, so I checked my code - no problems there - then I run though some tests and find that smaller files 'do' upload. I found the largest file that would upload was 550k - anything larger, and the server would not respond. No error message... just no response at all.

After wasting 30 minutes trying to find the problem, I contacted their support team over chat.

My description of the problem was not enough - the staff at HostMySite would not do anything unless I would give him the URL so he could see the issue happen for himself. My question to him was, "How many sites are you placing on each server?" Over the period of 30min that we were on chat, I asked the same question 5 times - finally, asking, "Why will you not tell me how many sites are on that server?" then backing up my request with the following, "This is key information for me as a customer - I need to know how overloaded this server is that you have us on." He replied that it's not their policy - in other words, they do not feel it is important to let their customers know what they are paying for. Here is a direct quote from Julius F., the second support person who responded by email:
We are not allowed to disclose how many sites are assigned to each server however I can say we do allocate a set number of sites based on the specifications of the server and each configuration has been time/stress tested before it is deployed as a production server.
Interesting wording... they are not "allowed." What are they afraid of?

Another thing to point out here... this stress test they do... doesn't mean much when you place the same number of applications and users on a box who are amateur developers. Although, they do have a 'safety measure' in place, which brings us to the second issue with HostMySite.com that you should know about.

"All ColdFusion processes must complete in under 50 seconds. If a process takes 50 seconds or longer, the process gets cancelled."

  • This is not written on their site.
  • This is not listed as a feature of their hosting packages.
  • This is not listed in the Admin area where you manage your site.
  • Apparently, not even the general support staff know about this limitation.
  • If they kill off your processes, they don't inform you - you would have to discover that it is happening either on your own or if you are lucky, a user would inform you
The support person I was chatting with had no idea this was put in place. He hit our site, tried the form, and uploaded a 10mb file (he's on the same network) with no problem. I then had to waste another 30 minutes doing more tests, uploading files from remote servers, etc. In the end - the support person said they would respond to me in email once they figured it out. Here's the email:
HostMySite.com Support:
The timeout error that you are receiving is from a program that we run on our ColdFusion servers called SeeFusion. It is set to kill any cf process that runs longer then 50 seconds. SeeFusion was implemented to increase the stability of our ColdFusion servers, which it has done. The only way to avoid this timeout on a shared server would be to use a different method of uploading, like ASPupload. Alternately, you could go to a VPS.

If you have any other questions feel free to contact us.
I wrote back, and explained that what they were doing was enforcing a limitation on my hosting package that I was never told existed. If I would have known this before I signed my client up, I would most likely have selected a different host. While you may not agree with me, I tend to feel that HostMySite.com is misleading customers. I also told them that this is a "feature" of the hosting package, and that they need to list it on the package page: http://www.hostmysite.com/hosting/builder/ - as you can imagine... they probably don't put it there because it will not help with sales.

What do you think? Is not telling a customer about a limitation of a service the same thing as lying about what you've sold a customer? Would you be happy if you bought a car, and then find that it could only go 60mph for 50 seconds before the engine would turn off?

HostMySite.com - I thought you were going to be a great host, instead, I'm quite disappointed at your lack of openness with customers about the number of sites per server, and the lack of informing customers what you've really sold them. I will not set another client up on your service and will continue to tell others to look elsewhere until your policy changes.

What am I going to do? Well, we are past the 30 day money back guarantee and the client already paid for the first year - so it looks like I have to create a hybrid solution for them that uses ASPupload for all the file uploads. Hopefully I can integrate it without having to spend much time in ASP rewriting portions of my application. Thanks HostMySite - I was almost done with this project - now you've added more work AND wasted an afternoon spent discovering your 'features.'

How about you? Do you host a site there? Did you know of these issues? Are you experiencing any other problems with HostMySite.com?

Tags      

ADD TO:
Add to BlinkBlink
Add to Del.icio.usDel.icio.us
Add to DiggDigg
Add to FurlFurl
Add to GoogleGoogle
Add to SimpySimpy
Add to SpurlSpurl
Add to Y! MyWebY! MyWeb

Permalink:

Category ArtistServer
Date Monday, Jul 31, 2006 1:23:20 PM
Blocking Spammers with CAPTCHA

ArtistServer has added a CAPTCHA challenge-response system to the various forms where people can either contact it's members or post replies to blog posts. With CAPTCHA, we can now block the multitude of spammers and spam bots who crawl the Web looking for Web forms.

The following text comes from: http://lyla.maestropublishing.com

What is a Captcha?

A Captcha is a type of challenge-response test used to determine whether or not a user is human. A common type of Captcha requires the user to enter the correct string of characters that have been distorted in an image. A Captcha can also be an response to a question that most people should be able to answer.

What does Captcha stand for?

Alan Turning described challenge-response tests in a paper he wrote in 1950. Computer scientists at Carnegie Mellon University and IBM coined the term in 2000. Captcha is an acronym for "completely automated public Turing test to tell computers and humans apart." In 1997 Alta Vista developed the modern-day Captcha to prevent bots from adding URLs to search engines. The rest is history.

For those who want to know how I set this up, I used LylaCAPTCHA for ColdFusion - which is an open source project built from another open source project from: http://www.compoundtheory.com. In only took a few hours to add to integrate the code into the site and add to the various forms we needed it on.

Thanks goes out to: Peter J. Farrell and Mark Mandel - the developers of this CAPTCHA solution.



Tags      

ADD TO:
Add to BlinkBlink
Add to Del.icio.usDel.icio.us
Add to DiggDigg
Add to FurlFurl
Add to GoogleGoogle
Add to SimpySimpy
Add to SpurlSpurl
Add to Y! MyWebY! MyWeb

Permalink:

Category Mobile - Web - Media
Date Thursday, Jul 27, 2006 12:08:44 PM
If Google Goes Down, We All Feel It
What happens when you take a large number of popular Web destinations, and tie them all to a single Web Service?  You create a situation where that single Web Service can greatly disrupt a healthy percentage of the Web.

How many of you noticed a problem with Google yesterday (July 26)? Did you visit any sites where the pages wouldn't fully load, when they usually snap into place? I sure did.

Near 7:00 pm Pacific time, I noticed my site ArtistServer.com running slowly - but it turned out to be Google AdSense. Every page I had AdSense on was not fully loading. In some cases the frame where the ad would normally display, an standard Firefox error page would display, showing that the url could not be found or couldn't respond.

Unfortunately, I first thought that the problem was with 'my' server - so I began to crawl the Web, looking for an answer for the odd error message I found in the ColdFusion log. While I was browsing is when I came to the conclusion that the site was slowing down due to Google AdSense not loading. This was after seeing the same thing happening on 3 other sites on the Web.

In order to fix the situation, I had to open up the code for generating Google Ads on ArtistServer and add a variable which could disable google ads across the site. This allowed me to toggle the ads off until I noticed that AdSense was loading properly.

And the error in my ColdFusion log? You won't believe it... the error is not real - here it is:
warning Unable to open C:\CFusionMX7\runtime/lib/license.properties
So, I check for my license, and it's not there! No problem, I pulled a copy from backup, drop it in, restart... and now it reverts to the developer edition - which means the site went offline.

After searching on Adobe, I found this technote: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=cf8f287b

In summary, it says:
There is usually a warning in the coldfusion-out.log that says "warning Unable to open C:\CFusionMX7\runtime/lib/license.properties." This warning should be ignored.
Yes, thank you Macromedia/Adobe! I appreciate the opportunity of having my site offline due to a warning that I apparently should have ignored. Cool.

Fortunately, I followed the instructions of the Technote, rebooted, and she was back online. Drama!

Let's get back to that first paragraph - I'm all for the idea of Web Services, widgets, APIs and the idea of micro-chunking, but I think there's an important piece of the puzzle here that needs to be addressed by developers who dabble in these technologies.  We have to ask the question, "What will my mashup or site or widget do when the service it relies on goes down?" When I saw what Google was doing to my site and other people's sites last night, I started to think about this.

What I imagine being a solution, is a scheduled task which pings the Web Service and checks it's response time, then decides if the Web Service should be used, or if "plan B" should be used. "Plan B" could either be old/backup/default data, or another Web Service, or at the very least, displaying a message that the Web Service is currently unavailable.

In our current example with Google AdSense, I could have the code swap to a different Ad provider instead of turning the ads off altogether. Then later on, after AdSense comes back with an acceptable response time, the code would swap back to AdSense.  The same thing could be setup for Map Mashups.

Tags        

ADD TO:
Add to BlinkBlink
Add to Del.icio.usDel.icio.us
Add to DiggDigg
Add to FurlFurl
Add to GoogleGoogle
Add to SimpySimpy
Add to SpurlSpurl
Add to Y! MyWebY! MyWeb

Permalink:

Category Mobile - Web - Media
Date Tuesday, Feb 07, 2006 8:43:26 AM
DiffMerge.com browser based Diff and Merge solution launched
For those who work with code - you may want to take a look at this site I recently built and launched (still in beta).

http://diffmerge.com/

Here's the description:

DiffMerge.com will provide a browser based 'Diff' and 'Merge' solution, which is the process of comparing two files, identifying what is different, then merging the documens to create a new doc.

DiffMerge begins with selecting what you want to compare using any of the following methods: URL, TextArea (copy/paste your content) or file upload. Currently, only the URL method is enabled.

After submission of the form, the user will see a split screen with the two documents below, and the start of the final merged document above. Each document's unique content is color coded to point out it's location in your documents.

In the merged document, the user will click on an icon next to the version of the content they wish to remove, leaving behind the selection they wish to keep in the final version. Users also have the option of clicking on any line to edit it. Simply click on the text, and a text area will display with save and cancel buttons.

Once all selections have been made, the user can click on a button at the top of the page to generate their merged document.

Later on, I'll addin the option for generating a 'new' file with a name, but for now, the final results display in the main frame and you have to copy/paste it to your computer/doc/etc.

===========

The site and service are free, and I plan to expose the site's functionality through Web Services - which means the application 'could' be integrated into other solutions (as long as a browser window is used to display the results).

Even if you don't know what Diff/Merge is, you can give it a try. I have the site set up to work with a copy of Yahoo.com - just hit the site, leave the DEMO selected - and run DiffMerge.

Chances are, you won't find a need for DiffMerge. It's not something people tend to use unless they are dealing with code. For the most part, it was an experiment for me, I wanted to see if I could do it, and if it would actually work... and it does!

I may release the code as Open Source - I just need to spend some more time with the project and research it some more before I make that choice. It's written in ColdFusion and uses the Prototype Javascript library.

If you have any feedback after trying it, or have some ideas on how DiffMerge could be used, contact me at http://www.markenmedia.com/.



Tags          

ADD TO:
Add to BlinkBlink
Add to Del.icio.usDel.icio.us
Add to DiggDigg
Add to FurlFurl
Add to GoogleGoogle
Add to SimpySimpy
Add to SpurlSpurl
Add to Y! MyWebY! MyWeb

Permalink:

               Next >
Page:   

Gideon Marken
Web Technologist & Electronic Artist

My status - click to chat with me.


Add Me to your Linked In Network



About


Blog Categories
 »  ArtistServer
 »  Sonic Wallpaper News
 »  Mobile - Web - Media
 »  SocialNetwork.in

February 2010
SUN MON TUE WED THU FRI SAT
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28       
< Previous Month  -  Next Month >
Click on dates, or view all

Twitter Tweets


My Music - Widget from ArtistServer:


What I've Been Listening To:
Listening chart from Last.fm


Free Ringtones From ArtistServer:


My Blog Tag Cloud


Kiss My RSS Get Firefox San Diego Bloggers