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

Re: [users@httpd] virtual host

I wonder if the :80 in the ServerName directive is causing you grief, since it isn't passed that way for http?

On Fri, Sep 28, 2018, 05:10 Carmel NY <carmel_ny@xxxxxxxxxxx> wrote:
On Fri, 28 Sep 2018 11:21:36 +0200, Sander Smeenk stated:

>Quoting Carmel NY (carmel_ny@xxxxxxxxxxx):
>> This is my first attempt to set up a virtual host with apache24 on a
>> FreeBSD 11.2 machine, and it is not working out so well. 
>Please elaborate on the 'not working out so well' bit.
>> Assuming a site name of example.net, I tried to configure a simple vhost.
>> <VirtualHost *:80>
>>     ServerAdmin webmaster@xxxxxxxxxxx
>>     DocumentRoot "/usr/local/www/testdir"
>>     ServerName stem.example.net:80 
>The port addition here is not needed and might interfere with your
>>     ServerAlias www.stem.example.net
>>     ErrorLog "/var/log/stem.error.log"
>>     CustomLog "/var/log/stem.access.log" common
>>     AcceptPathInfo On
>>   <Directory "/usr/local/www/testdir/">
>>     AllowOverride all
>>     Order Allow,Deny
>>     Allow from all
>>     # For Apache 2.4 add:
>>     Require all granted 
>Remove the 'Order' and 'Allow' lines if you're running Apache 2.4
>Leave the 'Require all granted' line in that case.
>>   </Directory>
>> </VirtualHost> 
>Otherwise this vhost config looks just dandy!
>> apachectl -S
>> VirtualHost configuration:
>> *:80                   stem.example.net
>> (/usr/local/etc/apache24/extra/httpd-vhosts.conf:24)
>> *:443                  example.net
>> (/usr/local/etc/apache24/extra/httpd-ssl.conf:121) 
>It shows up here on port 80 too!
>> Obviously, I am dong something wrong, but I have no idea what. 
>Please tell us what is not working for you!

Okay, on a stock FreeBSD installation, maybe on others too, there is an
index.html file in the document root that displays, "It Works" when it is
access. Now, when I type in my normal web address; http://example.net, the
vhost site is displayed. However, if I type in the vhost name;
http://stem.example.net, the regular site is display; ie. "It Works". That
is exactly opposite of what it is supposed to be doing. That make no sense,
so I know that I am doing something really wrong.

My dns is handled by <dyn.com>. This is an export of the settings:

$TTL 86400
example.net IN SOA ns1153.dns.dyn.com. zone-admin.dyndns.com. (
                     2018092719 ; serial number
                     10800 ; refresh
                     1800 ; update retry
                     604800 ; expire
                     1800 ; minimum
                     NS ns1153.dns.dyn.com.
                     NS ns2173.dns.dyn.com.
                     NS ns3176.dns.dyn.com.
                     NS ns4139.dns.dyn.com.

google._domainkey.example.net. 600 IN TXT "v=DKIM1\; k=rsa\; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvIiRSLU6aPFuQ9vNjioVMLbJfHayAL9DNByMtJV3dKy0nckOMa0mhDEbnTg7/SNVwmgI8Wb0PY2FFsu2pGLJNFflOeSxV1w8Fs3JHbqhRmdH4da8Kzpwg17+ZwjHX1/0nELEkrNqKwa1Htj3apzbEJETCa7+Qp2qXxE84d3ZZmwIDAQAB"
scorpio.example.net. 600 IN A
example.net. 600 IN A
example.net. 600 IN TXT "v=spf1 include:_spf.google.com ~all"
example.net. 86400 IN MX 1 aspmx.l.google.com.
example.net. 86400 IN MX 10 alt3.aspmx.l.google.com.
example.net. 86400 IN MX 10 alt4.aspmx.l.google.com.
example.net. 86400 IN MX 5 alt1.aspmx.l.google.com.
example.net. 86400 IN MX 5 alt2.aspmx.l.google.com.
stem.example.net. 600 IN A
www.scorpio.example.net. 600 IN CNAME scorpio.example.net.
www.example.net. 600 IN CNAME example.net.
www.stem.example.net. 600 IN CNAME stem.example.net.


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