Our team has been working on a rather large and complex web application project for the past couple of years. Now, nearing its completion, we are challenged with the necessity to host, deploy and support the ready product. On one hand side, we want to retain control over the code base for each customer separately, i.e. be able to introduce individual installations which coexist but have different source code versions. On the other side, we want to offer the platform to everyone under a common URL namespace and be sure, that every user is routed to their own virtual host.
Main Challenges
- Host a large number of virtual hosts (e.g. more than 1000), each with its own code base, source code revision, database and settings;
- Introduce individual customer identification and authorization;
- Secure the virtual hosts serving the actual application and isolate them from the outside World through a firewall;
- Use the above information to route each customer to the correct virtual host, representing their individual installation;
- Bring everything transparently under the same URL namespace, advertising a single URL to everyone for product access.
The Approach
The basic idea was to authenticate each web user for the purposes of giving them access to the application. Then use this information to route the user’s requests to the correct virtual host, that contains their individual code base and settings. To achieve this, we decided to introduce a gateway server to handle the authentication and routing.
Continue reading “Bringing multiple Virtual Hosts within the same URL space with Apache”


Книгата се опитва да опише всички основни концепции, които е нужно да разбираме до поне някаква степен, за да се подсигурим, до колкото е възможно (тъй като се твърди, че абсолютната безопасност е близка до невъзможното), че личните данни ще останат лични, че ще избегнем излишно изразходване на ресурси и че не злоупотребяваме с хората/машините които ползват нашите услуги. Oбхващат се много важни и интересни теми като валидиране на потребителски данни, SQL инжекции, Cross-Site скриптинг, Remote execution, кражба на сесия и обезопасяване на мрежови връзки (SSL, SSH), които смятам, че са задължителни знания за всеки програмист, който работи с уеб приложения.
Книгата е по-скоро нещо като ревю на новостите в PHP. В началото разказва повече за новите характеристики на PHP >= 5 като (Namespaces, Traits, Generators, Closures). Минава през PSR стандартите, използването на компоненти и удобството да използваш Composer, добрите практики при създаването на PHP приложения, проследява целия процес по създаване на PHP приложение (Hosting, Provisioning, Tuning, Deployment, Testing, Profiling) и накрая завършва с може би най-интересната за мен част – HHVM и Hack и влиянието им върху PHP. Повечето от нещата в книгата са известни за хората, занимаващи се с програмиране, но се дава една базисна насока при създаването на нови приложения.