Sign inSign up

san0123/rocky8-http-php

By san0123

•Updated about 1 year ago

RockyLinux 8 || HTTPD (Apache 2.4) || PHP-FPM 7.2, 7.3 (from remi-repo)

Image
Web servers
1

1.1K

san0123/rocky8-http-php repository overview

If you want to use more modern PHP (7.4, 8.0, 8.1, 8.2, 8.3) fallow link. https://hub.docker.com/r/san0123/rocky9-http-php⁠

  • Static Badge
    • Static Badge
    • Static Badge OR Static Badge

⁠HOW TO USE:

⁠Run Container(Windows):
C:\> docker run -d -p 80:80 -e TZ=Asia/Seoul --mount type=bind,source=d:\project\abc.com\html,target=/var/www/html san0123/rocky8-http-php:7.3
⁠Preparation for run on Mac/Linux
~]$ sudo groupadd -g 48 apache
~]$ sudo useradd -s /sbin/nologin -u 48 -g apache -d /usr/share/httpd -c Apache apache
~]$ sudo chown apache: /free/home/project/html
⁠Run Container(Linux/Mac):
~]$ sudo docker run --detach --restart unless-stopped \
                    --name project --publish 80:80 \
                    --env TZ=Asia/Seoul \
                    --mount type=bind,source=/free/home/project/html,target=/var/www/html \
                    san0123/rocky8-http-php:7.3

Get inside the Container
~]$ sudo docker exec -it project bash -l
Realtime logs from Container
~]$ sudo docker logs -f main_site
Describe Important Option for Run
optionvalueDescribe
--nameprojectSet to Container name
--restartunless-stoppedContainer is not recently stopped, it'll be start
--publish80:80docker_proxy Host:80 to Container:80
--envTZ=Asia/SeoulSet Container Timezone to Asia/Seoul
optionvalueHOST OSHOST volumeContainer volume
--mounttype=bind,source=/free/home/project/html,target=/var/www/htmlLinux/free/home/project/html/var/www/html
--mounttype=bind,source=d:\project\abc.com\html,target=/var/www/htmlWindowsD:\project\abc.com\html/var/www/html
Adjusted APACHE, PHP-FPM Setting

Apache and PHP-FPM connecting FastCGI with PORT(:9000). coz some PC or Server are cannot run PHP-FPM with unix socket file.

⁠/etc/php.ini was edited some like below.
short_open_tag            = On
upload_max_filesize       = 100M
post_max_size             = 120M
mysqli.allow_local_infile = On
⁠The /etc/httpd/conf/httpd.conf file contains the trusted private IPs. and .htaccess file allowed in httpd.conf file.
<Files ".ht*">
    Require all granted
</Files>
...
...
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 10.0.0.0/8
RemoteIPTrustedProxy 172.16.0.0/12
RemoteIPTrustedProxy 192.168.0.0/16
⁠It's contain a Apache security setting like below on /etc/httpd/conf.d/userdir.conf
<DirectoryMatch ".*\.(git|svn)/.*">
  Require all denied
</DirectoryMatch>
<FilesMatch "\.(inc|ini|conf|cfg|properties)$">
  Require all denied
</FilesMatch>
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
  Require all denied
</Files>
How to use CI4
~]$ sudo docker exec project composer create-project codeigniter4/appstarter html
~]$ sudo docker exec project chown -R apache: html
~]$ sudo docker exec project sed -i "s+DocumentRoot \"/var/www/html+DocumentRoot \"/var/www/html/public+g" /etc/httpd/conf/httpd.conf
~]$ sudo docker restart project

Tag summary

Content type

Image

Digest

sha256:9e698491b…

Size

180.8 MB

Last updated

about 1 year ago

docker pull san0123/rocky8-http-php:7.3