pramodtripathi/apache2

By pramodtripathi

Updated over 5 years ago

Ubuntu Image with Apache installed on it.

Image

27

Steps need to be perform:

Pull image in to your system and Do following steps:

$ sudo docker pull pramodtripathi/apache2

1.$ sudo docker run -it -d -p 81:80 pramodtripathi/apache2

Will create an container for apache server.here -it flag is use to make it interactive ,-d flag is use to to run in background,-p is used for port forwarding.

81:80 is Hostport : Internal Port where apache server is running.By default apache run in 80 Port.

2.$ sudo docker ps

lists the running apache server images.

3.$ sudo docker exec -it container_name bash

Will open cmd for container_name where you can perform operations.

4.$ sudo docker exec -it container_name bash root@container_name:/# service apache2 status

  • apache2 is not running root@container_name:/# service --status-all
    [ + ] apache-htcacheclean [ - ] apache2 [ ? ] hwclock.sh [ - ] procps root@container_name:/# service apache2 start
  • Starting Apache httpd web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message

Will start apache server.

5.Now you can access server by going to browser and typing Host_ip:81

Docker Pull Command

docker pull pramodtripathi/apache2