21 lines
853 B
Docker
21 lines
853 B
Docker
|
FROM httpd:latest
|
||
|
|
||
|
# Habilita mod_cgi y configura Apache para ejecutar scripts CGI
|
||
|
RUN sed -i '/mod_cgi/s/^#//g' /usr/local/apache2/conf/httpd.conf
|
||
|
RUN echo "AddHandler cgi-script .cgi .pl" >> /usr/local/apache2/conf/httpd.conf
|
||
|
RUN echo "ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/" >> /usr/local/apache2/conf/httpd.conf
|
||
|
RUN chmod -R 755 /usr/local/apache2/cgi-bin/
|
||
|
|
||
|
# Habilita mod_rewrite
|
||
|
RUN sed -i '/mod_rewrite/s/^#//g' /usr/local/apache2/conf/httpd.conf
|
||
|
|
||
|
# Copia el script CGI al directorio /usr/local/apache2/cgi-bin/
|
||
|
COPY cgi-bin/ /usr/local/apache2/cgi-bin/
|
||
|
RUN chmod +x /usr/local/apache2/cgi-bin/script.pl
|
||
|
|
||
|
# Copia las imágenes al directorio htdocs/images
|
||
|
COPY images/ /usr/local/apache2/htdocs/images/
|
||
|
|
||
|
# Copia el archivo .htaccess para configurar el directorio htdocs/images
|
||
|
COPY .htaccess /usr/local/apache2/htdocs/images/.htaccess
|