Installing Apache Web Server through Docker File For Windows Container

Installing Apache Web Server through Docker File For Windows Container

Installing Apache Web Server through Docker File For Windows Container

In this blog, we will show you Installing Apache Web Server through Docker File For Windows Container on windows 2016 container host.

 

REQUIREMENTS

  • Windows container host with docker service installed
  • Base windows server core image
  • Apache web server installation file

 

DOWNLOAD APACHE WEB SERVER

Installing Apache Web Server through Docker File

 

  • Download the latest modified apache web server setup file.

Installing Apache Web Server through Docker File

 

PREPARING FOR APACHE INSTALLATION

  • Create a new folder named apache on c:\ drive on windows container host machine using below command.

New-Item -ItemType Directory -Path c: -name apache

Installing Apache Web Server through Docker File

 

  • create a new folder named setup under apache on c:\drive using below command.

New-Item -Type Directory -Path C:\apache\ -Name setup

Installing Apache Web Server through Docker File

 

  • Copy the downloaded apache setup file to c:\apache\setup folder.

Installing Apache Web Server through Docker File

 

CREATING DOCKER FILE

  • Create a file named dockerfile on c:\apache folder using below command.

New-Item -Type file -Path c:\apache -name dockerfile

Installing Apache Web Server through Docker File

 

  • Add the below coding in the dockerfile and save it.

#THIS DOCKER FILE IS DEVELOPED BY ASSISTANZ NETWORKS

#SPECIFY THE CONTAINER IMAGE
FROM microsoft/windowsservercore

#COPY THE APACHE INSTALLATION FILES INTO THE CONTAINER
ADD ./setup c:/apache

#INSTALLING APACHE
RUN [“msiexec.exe”, “/i”, “C:\\apache\\apache_2.2.8-win32-x86-no_ssl.msi”, “/qn”]

#APACHE CONFIGURATION

RUN powershell.exe -command \

#COPY CUSTOMIZE HTTPD CONFIGURTION FILE TO APACHE conf FOLDER
copy-item c:/apache/httpd.conf -destination ‘”c:/program files (x86)/Apache Software Foundation/Apache2.2/conf”‘; \

#INSTALLING APACHE SERVICE USING BATCH FILE
cmd.exe /c c:/apache/service.bat; \

#SET APACHE SERVICE TO RUN UNDER LOCAL SYSTEM ACCOUNT
sc.exe config apache2.2 obj=LocalSystem; \

#REMOVE THE APACHE SETUP FILES DIRECTORY
remove-item c:/apache -Recurse

 

Installing Apache Web Server through Docker File

 

Installing Apache Web Server through Docker File

 

Installing Apache Web Server through Docker File

 

  • Copy these two files httpd.conf & service.bat in c:\apache\setup folder.

Installing Apache Web Server through Docker File

 

  • Now everything is set to start the installation.

 

INSTALLING APACHE ON WINDOWS CONTAINER

  • Open PowerShell window and execute the below command to build the apache container image using docker file.

docker build -t apache c:\apache

Installing Apache Web Server through Docker File

 

  • It will take few minutes to complete the building process.

Installing Apache Web Server through Docker File

 

VERIFY THE BUILT IMAGE

  • From the PowerShell window, type docker images command to verify the available images in the container host.

Installing Apache Web Server through Docker File

 

  • Run the below command to launch a container using the built image.

docker run -it -p 80:80 apache powershell

Installing Apache Web Server through Docker File

 

  • Once the container is online, we can verify the apache service status.

Installing Apache Web Server through Docker File

 

  • Access the container using the container host IP from outside VM.

Note: In this demo, our container host IP is 192.168.232.80

Installing Apache Web Server through Docker File

 

  • Also, we can able to access the apache web page using the container IP from the container host.

Installing Apache Web Server through Docker File

 

VIDEO:

Thanks for reading this blog. We hope it was useful for you to learn how to install apache on windows container.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage

ZFS Pool and Dataset Usage

ZFS Pool and Dataset Usage   I am back with another blog to provide the useful script to the Freebsd users to determine the zpool

Assistanz Networks

Installing Zabbix Agent in FreeBSD 12.0

Zabbix Agent Installation and Configuration Guide on FreeBSD 12.0   Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support