Apache : virtualHost vers une ip
Salut à tous
J'ai mis 3 CMS dans des dockers, un drupal, un wordpress et un joomla sur mon raspberrypi en archlinux,
chacun avec leurs base de donnée respective :
Code:
1 2 3 4 5 6 7 8
| docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
474da62f9518 powabanga/joomla-sentierandco:latest "/entrypoint.sh apac
" About an hour ago Up About an hour 0.0.0.0:1093->80/tcp, :::1093->80/tcp joomla-sentierandco
453b81404cae powabanga/wordpress-sentierandco:latest "docker-entrypoint.s
" 3 hours ago Up 3 hours 0.0.0.0:1091->80/tcp, :::1091->80/tcp wordpress-sentierandco
2c08a2a2f48f powabanga/drupal-sentierandco:latest "docker-php-entrypoi
" 3 hours ago Up 3 hours 0.0.0.0:1092->80/tcp, :::1092->80/tcp drupal-sentierandco
6b2ea6257270 powabanga/mariadb-joomla-sentieretco "/init" 3 hours ago Up 3 hours 0.0.0.0:33009->3306/tcp, :::33009->3306/tcp mariadb-joomla-sentier-and-co
20ff0d57d158 powabanga/mariadb-wordpress-sentieretco "/init" 3 hours ago Up 3 hours 0.0.0.0:33008->3306/tcp, :::33008->3306/tcp mariadb-wordpress-sentier-and-co
9a3319faa4fb powabanga/mariadb-drupal-sentieretco "/init" 3 hours ago Up 3 hours 0.0.0.0:33007->3306/tcp, :::33007->3306/tcp mariadb-drupal-sentier-and-co |
J'aimerais donc à présent qu'ils soient accessible depuis internet, j'ai donc créé des redirection chez ovh sur ces adresses vers mon domaine :
http://sentiersetcompagnie-drupal.powerbang.ovh/
http://sentiersetcompagnie-joomal.powerbang.ovh/
http://sentiersetcompagnie-wordpress.powerbang.ovh/
Code:
1 2 3 4 5 6 7
| powabanga@Rpi4 conf]$ pwd
/etc/httpd/conf
powabanga@Rpi4 conf]$ ls
extra httpd.conf magic mime.types vhosts
powabanga@Rpi4 conf]$ ls vhosts
domain1.com.conf gang.powerbang.ovh.conf rpi4-jenkins.powerbang.ovh.conf sentiersetcompagnie-joomla.powerbang.ovh.conf
domain2.com.conf phpmyadmin.conf sentiersetcompagnie-drupal.powerbang.ovh.conf sentiersetcompagnie-wordpress.powerbang.ovh.conf |
Code:
1 2 3 4 5 6 7
| pwd && ls -l
/srv/http
total 16
drwxr-xr-x 3 root root 4096 16 fév 19:14 domain1.com
drwxr-xr-x 2 root root 4096 14 fév 12:10 domain2.com
drwxr-xr-x 2 root root 4096 17 fév 05:51 gang.powerbang.ovh
drwxr-xr-x 3 root root 4096 17 fév 06:35 rpi4-jenkins.powerbang.ovh |
le souci que j'ai actuellement est donc c'est que mes trois url m'ouvre le domain1.com au lieu de rediriger sur mes dockers... :(
Code:
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
| powabanga@Rpi4 vhosts]$ pwd
/etc/httpd/conf/vhosts
powabanga@Rpi4 vhosts]$ cat sentiersetcompagnie-drupal.powerbang.ovh.conf
<VirtualHost *:80>
ServerAdmin webmaster@sentiersetcompagnie-drupal.powerbang.ovh
DocumentRoot "/srv/http/rpi4-jenkins.powerbangg.ovh"
ServerName sentiersetcompagnie-drupal.powerbang.ovh
ServerAlias sentiersetcompagnie-drupal.powerbang.ovh
ErrorLog "/var/log/httpd/sentiersetcompagnie-drupal.powerbang.ovh-error_log"
CustomLog "/var/log/httpd/-sentiersetcompagnie-drupal.powerbang.ovh-access_log" common
ServerName 172.19.0.5
ProxyPass /srv/http/sentiersetcompagnie-drupal.powerbang.ovh 172.19.0.5
ProxyPassReverse /srv/httpd/sentiersetcompagnie-drupal.powerbang.ovh 172.19.0.5
<Directory "/srv/http/http/sentiersetcompagnie-drupal.powerbang.ovh">
Require all granted
</Directory>
</VirtualHost>
powabanga@Rpi4 vhosts]$ cat sentiersetcompagnie-joomla.powerbang.ovh.conf
<VirtualHost *:80>
ServerAdmin webmaster@sentiersetcompagnie-joomla.powerbang.ovh
DocumentRoot "/srv/http/rpi4-jenkins.powerbangg.ovh"
ServerName sentiersetcompagnie-joomla.powerbang.ovh
ServerAlias sentiersetcompagnie-joomla.powerbang.ovh
ErrorLog "/var/log/httpd/sentiersetcompagnie-joomla.powerbang.ovh-error_log"
CustomLog "/var/log/httpd/-sentiersetcompagnie-joomla.powerbang.ovh-access_log" common
ServerName 172.19.0.7
</VirtualHost>
powabanga@Rpi4 vhosts]$ cat sentiersetcompagnie-wordpress.powerbang.ovh.conf
<VirtualHost *:80>
ServerAdmin webmaster@sentiersetcompagnie-wordpress.powerbang.ovh
DocumentRoot "/srv/http/rpi4-jenkins.powerbangg.ovh"
ServerName sentiersetcompagnie-wordpress.powerbang.ovh
ServerAlias sentiersetcompagnie-wordpress.powerbang.ovh
ErrorLog "/var/log/httpd/sentiersetcompagnie-wordpress.powerbang.ovh-error_log"
CustomLog "/var/log/httpd/-sentiersetcompagnie-wordpress.powerbang.ovh-access_log" common
ServerName 172.19.0.6
</VirtualHost>
powabanga@Rpi4 vhosts]$ |
Code:
1 2 3 4 5 6 7 8 9 10 11
| powabanga@Rpi4 http]$ pwd
/srv/http
powabanga@Rpi4 http]$ ls -l
total 28
drwxr-xr-x 3 root root 4096 16 fév 19:14 domain1.com
drwxr-xr-x 2 root root 4096 14 fév 12:10 domain2.com
drwxr-xr-x 2 root root 4096 17 fév 05:51 gang.powerbang.ovh
drwxr-xr-x 3 root root 4096 17 fév 06:35 rpi4-jenkins.powerbang.ovh
drwxr-xr-x 2 root root 4096 20 mai 14:10 sentiersetcompagnie-drupal.powerbang.ovh
drwxr-xr-x 2 root root 4096 20 mai 14:11 sentiersetcompagnie-joomla.powerbang.ovh
drwxr-xr-x 2 root root 4096 20 mai 14:10 sentiersetcompagnie-wordpress.powerbang.ovh |
même après un systemctl restart httpd cela ne fonctionne pas... Si quelqu'un savait m'aiguiller par rapport à cette demande spécifique ca serait vraiment super top :)