File size: 4,080 Bytes
a86048b
fc00a79
a86048b
e511e31
a86048b
 
ccdca6d
8e44ed7
12e05ba
 
be17ab0
12e05ba
e511e31
58c3e82
5b988dd
e511e31
 
dfb806a
a86048b
 
 
952ca2f
a86048b
3ef29ed
58c3e82
be17ab0
 
 
 
 
bdb1ead
be17ab0
3ef29ed
 
 
 
 
 
04775f6
3487576
37016c4
 
322402e
3958ff9
a86048b
04775f6
 
 
903fc0c
787faf0
04775f6
58c3e82
 
ebf9733
 
5b988dd
58c3e82
04775f6
 
da0faca
4e639e6
 
04775f6
58c3e82
 
098c355
 
fc00a79
c55624c
098c355
 
 
 
 
ccdca6d
50df220
5415194
 
098c355
5b988dd
58c3e82
bd15aee
6d0a615
db0995f
560daf7
 
 
 
 
f0d25b0
b32b1a2
9197a68
f495a56
 
9fb1d59
 
 
4e639e6
142fdcc
0de36b5
 
0e92133
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM debian:12.6
ARG DEBIAN_FRONTEND=noninteractive

# Actualización de sistema
RUN apt update -y
RUN apt upgrade -y
RUN apt install -y dialog apt-utils
RUN apt install -y curl unzip wget xz-utils gcc make libapr1-dev libaprutil1-dev libpcre3 libpcre3-dev
RUN apt search "Apache Portable Runtime Library"
RUN apt search "Apache Portable Runtime Utility "
RUN apt install -y libtool libapr1 libaprutil1 libtool-bin

# Usuario agregado
RUN useradd -m -u 1000 user
# USER user

# Instalación de Apache
WORKDIR /home/user
RUN wget https://dlcdn.apache.org/httpd/httpd-2.4.62.tar.gz
RUN tar -xf httpd-2.4.62.tar.gz
RUN cd httpd-2.4.62
WORKDIR /home/user/httpd-2.4.62
RUN ls -la


RUN echo 
RUN echo ===================================================================
RUN cat README
RUN echo 
RUN echo ===================================================================
RUN cat README
RUN echo 
RUN echo ===================================================================
RUN echo 
RUN cat INSTALL
RUN echo ===================================================================
RUN echo


RUN ./configure --prefix=/home/user/apache2 --enable-so
RUN make
RUN make install
# $HOME/apache
# /apache2/conf/httpd.conf

RUN chmod 777 -R /home/user/apache2
RUN ls -la /home/user/apache2/bin
RUN sed -i 's/Listen 80/Listen 7860/' /home/user/apache2/conf/httpd.conf
RUN cat /home/user/apache2/conf/httpd.conf
# RUN /apache2/bin/apachectl start
RUN rm -rf /home/user/httpd-2.4.62

USER root
RUN apt install -y locate
RUN updatedb
# USER user

RUN ls /home/user/apache2/bin/ -la
RUN cp -r /home/user/apache2/bin/ /usr/bin/
RUN ls /usr/bin/ -la
USER user
RUN /home/user/apache2/bin/apachectl start; /home/user/apache2/bin/apachectl stop; /home/user/apache2/bin/apachectl stop
RUN rm /home/user/apache2/htdocs/index.html

USER root

WORKDIR /home/user
RUN apt install -y libxml2 libxml2-dev libsqlite3-dev  libssl-dev libz-dev libpng-dev perl pkg-config
RUN apt install -y libapache2-mod-php8.2 autoconf automake re2c bison
RUN wget https://www.php.net/distributions/php-8.3.12.tar.gz
RUN tar -xf php-8.3.12.tar.gz
RUN cd php-8.3.12
WORKDIR /home/user/php-8.3.12
RUN ls -la
# RUN ./configure --with-apxs2=/home/user/apache2/bin/apxs --with-mysql
RUN ./configure --with-apxs2=/home/user/apache2/bin/apxs --with-pdo-mysql
RUN make
RUN make install
RUN apt install -y  php-xml php-sqlite3
# USER user

RUN sed -i 's/DirectoryIndex index.html/DirectoryIndex index.php index.html/' /home/user/apache2/conf/httpd.conf
RUN sed -i 's/#LoadModule rewrite_module modules\/mod_rewrite.so/LoadModule rewrite_module modules\/mod_rewrite.so/' /home/user/apache2/conf/httpd.conf
RUN sed -i -z 's/     #\n    AllowOverride None/     #\n    AllowOverride All/' /home/user/apache2/conf/httpd.conf
RUN echo "LoadModule php_module modules/libphp.so" >> /home/user/apache2/conf/httpd.conf
RUN echo "" >> /home/user/apache2/conf/httpd.conf
RUN echo "<FilesMatch \.php$>" >> /home/user/apache2/conf/httpd.conf
RUN echo "SetHandler application/x-httpd-php" >> /home/user/apache2/conf/httpd.conf
RUN echo "</FilesMatch>" >> /home/user/apache2/conf/httpd.conf
RUN which php-cgi;
# RUN a2enmod php
RUN which php
RUN updatedb
RUN locate default.conf;
RUN echo '<Directory /home/user/apache2/htdocs>' >> /etc/apache2/sites-available/000-default.conf
RUN echo '   AllowOverride All' >> /etc/apache2/sites-available/000-default.conf
RUN echo '</Directory>' >> /etc/apache2/sites-available/000-default.conf
USER user
COPY .htaccess /home/user/apache2/htdocs/
COPY app /home/user/apache2/htdocs/app
COPY public /home/user/apache2/htdocs/public
CMD [ "bash","-c", "cat /home/user/apache2/conf/extra/httpd-default.conf; echo ; echo ; echo ;cat /home/user/apache2/conf/original/extra/httpd-default.conf; echo ; echo ; cat /home/user/apache2/conf/httpd.conf; ls /home/user/apache2/modules ; cat /home/user/apache2/000-default.conf; echo '>>>>>>>>>>>>>>>>>>>> ls -la /home/user/apache2/'; ls -la /home/user/apache2/conf/; ls -la /home/user/apache2/htdocs/; /home/user/apache2/bin/apachectl start; curl localhost:7860; tail -F error.log" ]