Before setting up a server we must know the real meaning or definition of a server. So, the Server is a program that provides the client with any kind of services. For example, a web server provides our websites, a database server provides us data. This means every server has work to do and for every different work we want them to do, we have to choose different servers.
For knowing more about servers and their working click here. To check more about dockers – click here.
- Linux Operating system Like Ubuntu, Redhat, Kali Linux.
- Internet connectivity
- Docker installed on system
What we are going to do VISUAL:
Let’s now understand the installation and configuration.
3 steps to configure a Web Server
- Install the Server Program
- Configuration of Server
- Start the server
Installing the Server Software
Start docker services.
systemctl start docker
Open the docker container, you can use centos 7 images to launch.If you don’t have centos images you can download it from the www.hub.docker.com
docker run -it --network host centos:7
We are going to use HTTPD server.It could be installed using YUM command and DNF if you are using RHEL 8.
yum install httpd
Configuring the Web server
Actually the server is already been configured and now its the time to update or make a website over this server.Server website can be accessed using the IP address of the host.
In this directory you could save your website and it would be available over the network.
Start the server
systemctl start httpd
If this doesn’t start the server, try this
Access the content of website
To access the content of the webserver you must know the ip address, which could be known using “ifconfig” command.And then do the further steps.
curl http://IP of host/page_name.html
- Creating a Network in Docker and Connecting a Container to That Network
- Backing up a Docker Container
- How to Get the IP Address of a Docker Container?
- What to do when load on a Linux based web server goes high?
- How to Setup Browsersync for Web Development in Ubuntu?
- Running GUI Applications on Docker in Linux
- How to setup firewall in Linux?
- How to setup Proxychains in Linux without any Errors?
- Setup Terraform On Linux and Windows Machine
- Exposing Localhost Server over Internet Using ngrok and VS Code
- How to Install and Configure Docker in Ubuntu?
- Create your own secure Home Network using Pi-hole and Docker
- Difference between RUN vs CMD vs ENTRYPOINT Docker Commands
- Docker - USER Instruction
- Docker - HEALTHCHECK Instruction
- Docker - WORKDIR Instruction
- Docker - ARG Instruction
- Docker - EXPOSE Instruction
- Docker - LABEL Instruction
- How to Run a Python Script using Docker?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.