skip to Main Content

I have created a new folder and copy my index html from that image. The image looks like this

 FROM centos:latest
 RUN yum update -y
 RUN yum install httpd -y
 RUN mkdir -p /var/www/html/gci/
 COPY ./public-html/ /var/www/html/gci/
 ENTRYPOINT ["/usr/sbin/httpd","-D","FOREGROUND"]

However this defaults to serving from /var/www/html/ and not from /var/www/html/gci
Without this new folder, it works just fine serving index.html file I have in public-html folder.
What am I doing wrong?

2

Answers


  1. Chosen as BEST ANSWER

    oh it works, just needed to add /gci when searching in the browser and Kaboom works like magic


  2. You should edit Apache2 conf to serve directly from /cgi

    First, create a cgi.conf file (or whatever name you want), with those values at minimum *(it would be better to delve a bit more on apache2 conf than just this) *

    <VirtualHost *:80>
      DocumentRoot /var/www/html/cgi
    </VirtualHost>
    

    Then add this file in your image ADD cgi.conf /etc/apache2/sites-available

    Then deactivate the default site and activate yours RUN a2dissite 000-default.conf && a2ensite cgi.conf

    After that, when launching your containerand trying to access it, you’ll directlygo to the /cgi directory.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search