I have ~200 virtualhosts on my Apache HTTPD server and all use the declaration “<VirtualHost *>” with not port specification. Just a “Listen 80” directive. Do you specify the port on the VirtualHost directive because you don’t want to accept
traffic on all the ports there are Listen directives for?
Darryl Baker, GSEC (he/him/his)
Sr. System Administrator
Distributed Application Platform Services
Northwestern University
1800 Sherman Ave.
Suite 6-600 – Box #39
Evanston, IL 60201-3715
darryl.baker@xxxxxxxxxxxxxxxx
(847) 467-6674
From: Frank Gingras <thumbs@xxxxxxxxxx>
Reply-To: "users@xxxxxxxxxxxxxxxx" <users@xxxxxxxxxxxxxxxx>
Date: Tuesday, September 21, 2021 at 2:32 PM
Cc: "users@xxxxxxxxxxxxxxxx" <users@xxxxxxxxxxxxxxxx>
Subject: Re: [users@httpd] Four subdomain, fourth redirects to first
The first mistake is to use the hostnames when defining vhosts. Define them all as *:PORT, then test with curl, and run apachectl -S or httpd -S to spot any overlap.
On Tue, 21 Sept 2021 at 14:48, Daniel Armando Rodriguez <drodriguez@xxxxxxxxxxx.invalid> wrote:
Hi,
I have four subdomains on the same host which work as expected whis this
base config
<VirtualHost
4.DOMAIN.edu.ar:80>
ServerName
4.DOMAIN.edu.ar
ServerAlias
4.DOMAIN.edu.ar
ServerAdmin webmaster@xxxxxxxxxxxxx
DocumentRoot /var/www/4
<Directory "/var/www/4">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error_4.log
CustomLog ${APACHE_LOG_DIR}/access_4.log combined
</VirtualHost>
In the particular case of fourth subdomain, gets redirected to the
first. See
# curl -v -H Host:4.DOMAIN.edu.ar
http://INTERNAL-IP/
* Expire in 0 ms for 6 (transfer 0x55669ac96c10)
* Trying INTERNAL-IP...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55669ac96c10)
* Connected to INTERNAL-IP (INTERNAL-IP) port 80 (#0)
> GET / HTTP/1.1
> Host:4.DOMAIN.edu.ar
> User-Agent: curl/7.64.0
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 21 Sep 2021 18:32:32 GMT
< Server: Apache/2.4.48
< X-Pingback:
http://1.DOMAIN.edu.ar/xmlrpc.php
< X-Redirect-By: WordPress
< Location:
https://1.DOMAIN.edu.ar/
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host INTERNAL-IP left intact
As said, domains 1, 3 and 3 works. In fact, when configuring the 4th
just copied the one of the working configs and changed the subdomain,
directory and also the log. Nothing more, but the result is not the one
I expected.
Any hint will be much appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail:
users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail:
users-help@xxxxxxxxxxxxxxxx
|