Today i will show you and give you some input how to make a web and websocket server with Tornado, which is currently my favorite when i need “mockup” service so i can show it to someone. Anyway this article will mostly cover websockets then “standard” web.
Few days ago i had a chance to work bit different with Nginx, and what was needed to be done is how to determinate if user had successfully downloaded file. Why this is needed because file should be erased from server after download and PHP would be bad solution, also they told me that they don’t want to use any additional application eg. programming languages.
PHP-FPM (FastCGI Process Manager) is an alternative FastCGI implementation with some additional features useful for websites of any size, especially high-load websites. It makes it particularly easy to run PHP on Nginx.
Included features – from original website :
- Adaptive process spawning
- Basic statistics
- Advanced process management with graceful stop/start
- Ability to start workers with different uid/gid/chroot/environment and different php.ini
- Stdout & stderr logging
- Emergency restart in case of accidental opcode cache destruction
- Accelerated upload support
- Support for a “slowlog”
- Enhancements to FastCGI, such as fastcgi_finish_request() – a special function to finish request & flush all data while continuing to do something time-consuming
..and much more..
Source Wikipedia :
Hotlinking is a term used on the Internet that refers to the practice of displaying an image on a website by linking to the same image on another website, rather than saving a copy of it on the website on which the image will be shown.
Hotlinking can be major issue for bandwidth leeching for some sites. Here is small config part which you can add to prevent those activities.
Everyone got excited about new feature in nginx. From version 1.3.13 nginx have native support for proxying websockets, but i can not find it useful on any project of mine, please correct me if i’m wrong, and if you wish you can give me idea in comments. I just want to try it but i spend like 2-3 hours and hardly make them to work.
When i was working on one project i needed to secure some pages eg. cart, checkout, login, .. This will implement SSL on pages you want and i will assume that you have working Zend Framework application and that you know how to implement this action helper.
You must know also that securing pages with SSL is not actually “secure” which will help you fix your mistakes done in writing code, but it will help against traffic sniffing.
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (non-clustered) requests per second and 30% CPU load, course, this was 2xIntel Xeon with HT enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
This simple view helper for the Zend Framework will truncate a string to the desired length and automatically add customizable postfixes if the string was truncated.
I will show you how you can create simple but effective absolute path view helper in Zend Framework. In this example, i will create new file under /library/My/View/Helper with name GetApsolutePath.php
When i started to work with Zend Framework, i actually didn’t understand plugins and loaders, now when i made my own CMS based on Zend i actually did everything with plugins and view helpers for making my life easier.
I will show you here how you can make plugin, view helper which will do all hard work for you so your web site can be more SEO friendlier. Also, i need to tell you that i don’t understand SEO too much and you will maybe need to add some features or tags based on your own knowledge about SEO.