diff --git a/Dockerfile b/Dockerfile index c365fea..ba26f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,14 @@ FROM registry.access.redhat.com/rhscl/httpd-24-rhel7:latest +# CGI scripts go to /opt/rh/httpd24/root/var/www/cgi-bin/ ADD share/cgi-bin /opt/rh/httpd24/root/var/www/cgi-bin/ + +# Static files go to /opt/rh/httpd24/root/var/www/html ADD share/html /opt/rh/httpd24/root/var/www/html -VOLUME /ogl/data +# Install missing Perl modules +RUN yum update -y \ + && yum install -y perl-CGI perl-Sys-CPU \ + && yum clean all \ + && rm -rf /var/cache/yum -ENTRYPOINT [ "/usr/bin/run-httpd" ] -CMD [ ] diff --git a/share/cgi-bin/welcome-pl.cgi b/share/cgi-bin/welcome-pl.cgi new file mode 100755 index 0000000..3246f2a --- /dev/null +++ b/share/cgi-bin/welcome-pl.cgi @@ -0,0 +1,10 @@ +#!/usr/bin/perl -w +use CGI; +use Sys::CPU; +$number_of_cpus = Sys::CPU::cpu_count(); +$q = CGI->new; +print $q->header, + $q->start_html('hello world'), + $q->h1('hello world'), + $q->pre('CPU Count: '.Sys::CPU::cpu_count()."\nSpeed: ".Sys::CPU::cpu_clock()."\nType: ".Sys::CPU::cpu_type()."\n"), + $q->end_html; diff --git a/share/cgi-bin/welcome.cgi b/share/cgi-bin/welcome-sh.cgi similarity index 100% rename from share/cgi-bin/welcome.cgi rename to share/cgi-bin/welcome-sh.cgi