Re: port based VirtualHosts ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Aha ! it is working now - I moved, in /etc/httpd/conf.d, the default
files:
     welcome.conf -> welcome.dir
     manual.conf   -> manual.dir
and then included them from 'Apache.dir', which is included by
both Apache.conf (the *:80 Vhost) and ssl.conf (the *:443 vhost).

So I guess it is because the default, un-vhosted server now has
NO directory entries associated with it, that is has nothing to serve,
so vhost resolution is forced.


On 27/12/2021, Jason Vas Dias <jason.vas.dias@xxxxxxxxx> wrote:
> Thanks Eric -
>
>   Yes, it was DocumentRoot, a typo in my email only - sorry .
>
>   I now have ALL site in separate VHosts .
>
>   I put all the default directory entries in conf/httpd.conf into
>   a separate conf.d/Apache.conf :
>
>    <VirtualHost *:80>
>      ServerName $HOST_DNS_NAME:80
>      include conf.d/Apache.dir
>    </VirtualHost>
>
>   And my ssl.conf now does:
>
>   <VirtualHost *:443>
>      ... # original ssl.conf
>      ServerName $HOST_DNS_NAME:443
>      include conf.d/Apache.dir
>    </VirtualHost>
>
>   And my A & B conf are both (where $PORT is either 2x080 or 1x080)
>   (numbers redacted):
>
> conf.d/A.conf:
> Listen $HOST_DNS_IP:1x080 https
>
> <VirtualHost *:1x080>
>   ServerAdmin ${ME}@localhost
>   ServerName  $HOST_DNS_NAME:1x080
>   DocumentRoot "/opt/A"
>   SSLEngine on
>   SSLCertificateFile    /etc/pki/tls/certs/localhost.crt
>   SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
>   ErrorLog    "logs/A-error_log"
>   TransferLog "logs/A-access_log"
>   <Directory "/opt/A">
>     Options +ExecCGI +Includes +Indexes +FollowSymLinks
>     require all granted
>   </Directory>
> </VirtualHost>
>
> conf.d/B.conf:
>
> Listen $HOST_DNS_IP:2x080 https
>
> <VirtualHost *:2x080>
>   ServerName  $HOST_DNS_NAME:2x080
>   ServerAdmin ${ME}@localhost
>   DocumentRoot "/opt/B"
>   SSLEngine on
>   SSLCertificateFile      /etc/pki/tls/certs/localhost.crt
>   SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
>   ErrorLog     "logs/B-error_log"
>   TransferLog "logs/B-access_log"
>   <Directory "/opt/B">
>     Options +ExecCGI +Includes +Indexes +FollowSymLinks
>     require all granted
>   </Directory>
> </VirtualHost>
>
> I also created a _default_.conf file containing:
>
> <VirtualHost _default_:*>
> </VirtualHost>
>
> httpd starts and httpd -S says :
>
> httpd -S
> VirtualHost configuration:
> *:80                     $HOST_DNS_NAME  (/etc/httpd/conf.d/Apache.conf:1)
> *:48080                $HOST_DNS_NAME (/etc/httpd/conf.d/B.conf:5)
> *:*                      $HOST_DNS_NAME
> (/etc/httpd/conf.d/_default_.conf:1)
> *:60080                $HOST_DNS_NAME (/etc/httpd/conf.d/B.conf:5)
> *:443                   $HOST_DNS_NAME (/etc/httpd/conf.d/ssl.conf:56)
>
> But still, a request to either $HOST_DNS_NAME:1x080 or
> $HOST_DNS_NAME:2x080 returns the same page as :80 or :443,
> the "Testing 123" default Apache test page.
>
> Any ideas how to get them to serve the DocumentRoot and
> Directory entries in their VirtualHost entries ?
>
> Thanks & Best Regards,
> Jason
>
>
> On 27/12/2021, Eric Covener <covener@xxxxxxxxx> wrote:
>>>     <VirtualHost *:10080>
>>>      Directory "/opt/A"
>>
>> Did you mean DocumentRoot?
>>
>> Can you show the verbatim config for one of the virtual hosts?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux