CA1 of Cloud Based Web Application. Name: Matheus Costa Diniz Student number: 2022042
First download the repository to be able to proceed with it.
Build the image:
docker build -t cbwa-ca1-matheus-diniz .Run the image on port 8080:
docker run -it --rm -p 8080:8080 cbwa-ca1-matheus-dinizBrowse to http://localhost:8080.
NOTE: To be able to run the CA project direclty form GitHub was added the following lines:
# Copying the content of Web CA1 to the scratch image
COPY --from=builder /home/static /home/static
## Changing working directory to /home/static/web_ca1-main
WORKDIR /home/static/webdev_ca1-mainCMD ["/busybox", "httpd", "-f", "-v", "-p", "8080", "-c", "httpd.conf"]NOTE: .dockerignore and .gitignore files are added in order no to add some files to the container when runing and to the git repository respectively.
Add to httpd.conf file and use the P directive:
P:/some/old/path:[http://]hostname[:port]/some/new/path
Add to the httpd.conf file and use the E404 directive:
E404:e404.html
...where e404.html is your custom 404 page.
Note that the error page directive is only processed for your main httpd.conf file. It will raise an error if you use it in httpd.conf files added to subdirectories.
Add to httpd.conf file and use the A and D directives:
A:172.20. # Allow address from 172.20.0.0/16
A:10.0.0.0/25 # Allow any address from 10.0.0.0-10.0.0.127
A:127.0.0.1 # Allow local loopback connections
D:* # Deny from other IP connections
You can also allow all requests with some exceptions:
D:1.2.3.4
D:5.6.7.8
A:* # This line is optional
Add a httpd.conf file, listing the paths that should be protected and the corresponding credentials:
/admin:my-user:my-password # Require user my-user with password my-password whenever calling /admin