Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Apache HTTP Server serve dynamic content?

Can Apache HTTP Server serve only static content? Tomcat is used to serve Servlets/JSP. Can Tomcat serve other dynamic contents like perl, PHP etc?


2 Answers

Apache HTTP Server (http://httpd.apache.org) has:

  • CGI support: mod_cgi. This will run almost any dynamic content, you can even write a CGI in Bash.

  • WSGI support: mod_wsgi

  • FastCGI support: mod_fcgid (CGI, but more efficient)

  • Perl support: mod_perl

  • PHP support: mod_php

  • Python support: mod_python (using mod_wsgi is recommended)

  • Ruby support: mod_ruby (thanks to David Holm)

  • Bridge to serve Java content through a servlet container such as Tomcat: mod_jk, mod_proxy_ajp

  • Plus, an API to program your own apache modules that'll enable you to do as you wish, here's a repository of some of the existing modules: http://modules.apache.org

If you meant if Tomcat can, it cannot outside of a Java environment, it is only a servlet container. That said, Java can execute some other scripting languages and thus you could write programs to generate content in all supported scripting engines.

like image 116
Vinko Vrsalovic Avatar answered Sep 22 '26 23:09

Vinko Vrsalovic


Of course Apache is able to serve dynamic content! mod_perl, mod_php, and so are the modules you plug to Apache to give him the ability to serve them.

like image 31
gizmo Avatar answered Sep 22 '26 23:09

gizmo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!