Simple Demo Applications
By Brian
When doing a customer demo, I often need a simple app. Generally I am discussing the infrastructure – Elastic Load Balancer, API Gateway, etc – and the application is unimportant. I have found that phpinfo is a great sample application because it shows the headers received by the server. This allows me to see x-forwarded-for headers, etc. On Windows, ASP.NET Tracing provides similar results. Keep in mind that these utilities expose a lot of info about your environment so use them wisely.
Linux
PHP provides a function phpinfo()
that will returns a ton of info about the PHP environment. A simple page that includes the following is all you need. For example:
|
|
Here is an EC2 user data script that will install Apache and PHP and create the simple page. I have tested this on Amazon Linux 2, but it should work on any Fedora derivative.
|
|
Docker
The standard PHP image on Docker Hub supports phpinfo. You just need to create a PHP page that calls phpinfo()
. My Dockerfile looks like this.
|
|
The original image includes the entry point and exposes Apache in port 80. Therefore, you you can build and run locally like this.
|
|
Windows
ASP.NET (Legacy .NET Framework) provides a similar option. You simply add Trace="true"
to the page directive. For example:
|
|
Here is an EC2 user data script that will install IIS and create a simple page with tracing. I have tested this on Windows 2019, but it should work on any Windows version.
|
|