Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

NginX as Web server for CF10

New Here ,
Jun 08, 2012 Jun 08, 2012

Hi everyone,

I've been playing around with CF10 with our server and it works great. It's just I've been wondering if it is possible to use Nginx as the web server? maybe someone can guide me through on how to make it work on a CentOS 5 server.

Thank you in advance.

Andrew

4.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 08, 2012 Jun 08, 2012
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2012 Jun 08, 2012

Hi Padz,

Thank you for responding to my query. I've checked on the links that you gave and it's really helpful. Just one thing on the discussion for url rewriting, I think it still uses the internal web server "Apache Tomcat". Is there a possibility that this internal web server totally replaced with Nginx? Just like the option to use Apache web server upon installation of CF10.

Thanks again.

Andrew

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 08, 2012 Jun 08, 2012

Hi Andrew,

In a word, no.  The reason being is that CF is a java web app so needs to live within a java app server.  When you look at the deployment variations for CF you'll see that CF always lives within a java app server engine such as Tomcat, JRun, JBoss, Oracle As, Websphere .. java app server whatever. 

By configuring an external web server such as Apache or IIS or JWS or Nginx you are proxying the web traffic through the web server to service the requests.  So why bother using a web server?  Well, two quick, very good reasons include:

  1. Separation of static and dynamic content loads [web server belts out the static stuff [js, css, html, txt]as fast as poss and the java app only needs to focus on the bits that concern it [cfoutput or similar]].
  2. Web servers offer a range of additional functions to improve overall system performance such as multi-hosting [virtual hosts], forward caching for content, dynamic file compression, additional security functionality, forward errror handling, etc thereby reducing unecessary load to the java app server.

Why Nginx over Apache?  It's about resource utilisation on the hardware.  Nginx has a much lower footprint than Apache (around 15mb vs 53mb per instance so handles more traffic).  Nginx is reputed to process requests faster than apache as well. Nginx been around for 7+ years now so is pretty mature and stable.  Nginx has also been used successfuly for software based load balancing in front of large website clusters. 

Does that help answer the question?

Padz

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2012 Jun 08, 2012

Hi Padz,

I appreciate your effort to make this clear as possible. I guess I have to stick with nginx as reverse proxy instead.

Thank you so much.

regards,

Andrew

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 08, 2012 Jun 08, 2012
LATEST

Hi Andrew,

As a quick follow up.  Whats the difference between the java app servers and where does CF fit in?  Ok, as stated previously CF is a java web app.  It is deployed into a java web container and processes requests via a java servlet designed for delivering web based content {JSP, Java TagLibs and in our case CFML [complied into java byte code on execution]. 

Tomcat is expressly designed as a java web app container that can connect to a database and doesn't contain the additional java libraries for processing to larger systems using java2 EE protocols and is therefore used for web specific operations that, in effect, offer standalone services.  For larger systems found in corporates and large websites requiring to have more sophisticated and complex resources for operation Java 2 EE compliant app servers are used as they contain additional java libraries [usually .jar files] offering a range of specific services for a limted set of functional tasks. 

An example of the different deployments with CF illustrate how Cf fits in the the overall java scheme of things. 

You can deploy CF as a standalone [contains Tomcat] or as a .war [java web achive - essentially a zipped file of  java specific config and resources] or as an .ear [enterprise java archive file like the war but in within another java specific folder structure wrapper ]. 

  1. The standalone is designed to make development deployments and simple production deployments fast and easy. 
  2. WAR deployments are dropped into the java servlet container essentially as standalones and leverage the resource usage of a java2 EE app server so run multiple wars and ears concurrently.  An example of war deployments would be where you have a CF application(s) running the intranet [say intranet.example.com/ ] alonside another war app that provides an SAP front end [accessible via intranet.example.com/sap/ ].  Both appear under the same domain to an end user but completely different applications needing different resources.
  3. EAR deployments offer the ability to add extra config/components to a CF instance thereby leveaging CF for the web app bit within a much larger application deployment.  An example of an EAR deployment would be for a particular application to talk to a robotic warehouse API, an order processing management API, an LDAP directory and deliver the dynamic compiled results to a web frontend via CF.

Why makes ColdFusion / Railo / BlueDragon so great?  In my view, they do tons of stuff out of the box for hooking into EE resources with minimal effort, are much faster to develop, more flexible and easier to maintain that their competitor technologies.

Note:  If anyone wants to improve or comment on the above - feel free ; )

Best,

Padz

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources