commit 98538d37cf16d5e50acac96e8e59edccf775fe21 Author: junikimm717 <68165832+junikimm717@users.noreply.github.com> Date: Sun May 15 10:02:40 2022 -0400 first commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f1fa602 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM nginx:latest +RUN apt-get clean && apt-get update + +RUN apt-get install -y spawn-fcgi \ + fcgiwrap \ + ruby-full \ + perl\ + libcgi-fast-perl + +RUN sed -i 's/www-data/nginx/g' /etc/init.d/fcgiwrap +RUN chown nginx:nginx /etc/init.d/fcgiwrap +ADD ./vhost.conf /etc/nginx/conf.d/default.conf +WORKDIR /var/www +CMD /etc/init.d/fcgiwrap start \ + && nginx -g 'daemon off;' diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..aceba6e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' +services: + web: + build: + context: . + volumes: + - ./html:/var/www/html + ports: + - "8080:80" diff --git a/html/50x.html b/html/50x.html new file mode 100644 index 0000000..a57c2f9 --- /dev/null +++ b/html/50x.html @@ -0,0 +1,19 @@ + + + +Error + + + +

An error occurred.

+

Sorry, the page you are looking for is currently unavailable.
+Please try again later.

+

If you are the system administrator of this resource then you should check +the error log for details.

+

Faithfully yours, nginx.

+ + diff --git a/html/helloworld.cgi b/html/helloworld.cgi new file mode 100755 index 0000000..fcd6ae8 --- /dev/null +++ b/html/helloworld.cgi @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use CGI; + +my $q = CGI->new; +print $q->header; + +my $a = $q->param('a'); +my $b = $q->param('b'); + +my $result; +$result = (scalar $a) + (scalar $b); + +print < + + Hello + +

Hello World

+

+ $result +

+ + +EOF diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..e8f5622 --- /dev/null +++ b/html/index.html @@ -0,0 +1,23 @@ + + + +Welcome to nginx! + + + +

Welcome to nginx!

+

If you see this page, the nginx web server is successfully installed and +working. Further configuration is required.

+ +

For online documentation and support please refer to +nginx.org.
+Commercial support is available at +nginx.com.

+ +

Thank you for using nginx.

+ + diff --git a/vhost.conf b/vhost.conf new file mode 100644 index 0000000..d2e349d --- /dev/null +++ b/vhost.conf @@ -0,0 +1,30 @@ +server { + listen 80; + listen [::]:80; + #server_name localhost; + root /var/www/html; + + #access_log /var/log/nginx/host.access.log main; + + location / { + index index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /var/www/html; + } + + location ~ \.pl|cgi$ { + try_files $uri =404; + fastcgi_pass unix:/run/fcgiwrap.socket; + fastcgi_param SERVER_NAME \$http_host; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +}