How do I run Apache server from Docker without mapping to a location

+1 vote

Docker Image: has apache; has an HTML file in the apache root.

How can I access that file form the browser? (when I run the image)

I tried:

docker run -d -p 8080:80 myimage/myimage

When I use the docker ps I get to see the port as 0.0.0.0:8080->80/tcp but as it open I  get HTTP ERROR 500 0.0.0.0:8080 or localhost:8080

Apr 4, 2018 in DevOps & Agile by Atul
• 10,240 points
2,200 views
Open port 8080 in ec2 security group

2 answers to this question.

0 votes

What you can do is first login to docker container and start the apache server

docker exec -it container_id /bin/bash

service apache2 restart

Then from browser access using : http://localhost:8080

I hope it will resolve your query.

answered Apr 4, 2018 by shubham
• 7,340 points
0 votes

If you're seeing a 500 error, that's Apache responding, so the web server is already running.

answered Oct 18, 2018 by lina
• 8,220 points

Related Questions In DevOps & Agile

0 votes
1 answer

How do I assign a port mapping to an existing Docker container?

Below are some steps which you can ...READ MORE

answered Sep 19, 2018 in DevOps & Agile by Damon Salvatore
• 5,980 points
9,312 views
0 votes
1 answer
0 votes
1 answer

How do I push a docker image to a private repository?

Here is what you can do. Just try ...READ MORE

answered Sep 19, 2018 in DevOps & Agile by Damon Salvatore
• 5,980 points
1,393 views
0 votes
1 answer

How to a run deployed app in Docker for Windows?

To deploy an ASP.NET web application to ...READ MORE

answered Aug 30, 2018 in DevOps & Agile by Tyrion anex
• 8,700 points
1,221 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,720 views
+14 votes
5 answers

How do I run a cron job inside a docker container

If you can SSH into your server ...READ MORE

answered Jul 27, 2018 in DevOps & Agile by Kalgi
• 52,350 points
16,555 views
+1 vote
1 answer

How do I get a Docker container's IP address from the host?

Save your docker image as a tar ...READ MORE

answered Aug 29, 2018 in DevOps & Agile by shubham
• 7,340 points
1,002 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP