Hi, I define both vhost with <hostname>:<port> because each “hostname” links to different hosts. Machines A and B are differents and they are serving its sites, so in Apache I must declare (I think…)
each host because I need to differentiate them. If I use *:<port>, how are I differentiating both hosts if they are different? Output of “apachectl -S”:
VirtualHost configuration: my_ip_address:80 is a NameVirtualHost default server A.mydomain (/etc/httpd/conf.d/000-default.conf:1) port 80 namevhost A.mydomain (/etc/httpd/conf.d/000-default.conf:1) alias A alias A.mydomain.v2 port 80 namevhost B.mydomain (/etc/httpd/conf.d/000-default.conf:101) alias B alias B.mydomain.v2 ServerRoot: "/etc/httpd" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/etc/httpd/logs/error_log" Mutex mpm-accept: using_defaults Mutex authdigest-opaque: using_defaults Mutex proxy-balancer-shm: using_defaults Mutex rewrite-map: using_defaults Mutex authdigest-client: using_defaults Mutex proxy: using_defaults Mutex authn-socache: using_defaults Mutex default: dir="/run/httpd/" mechanism=default PidFile: "/run/httpd/httpd.pid" Define: _RH_HAS_HTTPPROTOCOLOPTIONS Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="apache" id=48 Group: name="apache" id=48
VirtualHost configuration: 192.168.1.2:80 A.mydomain (/etc/httpd/conf.d/000-default.conf:1) 192.168.1.5:80 B.mydomain (/etc/httpd/conf.d/000-default.conf:101) ServerRoot: "/etc/httpd" Main DocumentRoot: "/var/www/html" Main ErrorLog: "/etc/httpd/logs/error_log" Mutex authdigest-opaque: using_defaults Mutex watchdog-callback: using_defaults Mutex proxy-balancer-shm: using_defaults Mutex rewrite-map: using_defaults Mutex authdigest-client: using_defaults Mutex lua-ivm-shm: using_defaults Mutex proxy: using_defaults Mutex authn-socache: using_defaults Mutex default: dir="/etc/httpd/run/" mechanism=default Mutex cache-socache: using_defaults PidFile: "/etc/httpd/run/httpd.pid" Define: DUMP_VHOSTS Define: DUMP_RUN_CFG User: name="apache" id=48 Group: name="apache" id=48 Thanks a lot! De: Frank Gingras <thumbs@xxxxxxxxxx>
On Fri, Dec 15, 2023 at 2:57 AM Gestió Servidors <sysadmin.caos@xxxxxxx.invalid> wrote:
You don't want to define a vhost as <hostname>:<port>, unless you know exactly what you are doing. When unsure, always use *:<port>. Show the output from apachectl -S or httpd -S after you applied the fixes. |