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

Re: [users@httpd] virtual host

On Fri, 28 Sep 2018 15:40:49 +0200, Sander Smeenk stated:

>Quoting Carmel NY (carmel_ny@xxxxxxxxxxx):
>> >Please elaborate on the 'not working out so well' bit.  
>> >> apachectl -S
>> >> VirtualHost configuration:
>> >> *:80         
>> >> (/usr/local/etc/apache24/extra/httpd-vhosts.conf:24)
>> >> *:443        
>> >> (/usr/local/etc/apache24/extra/httpd-ssl.conf:121)    
>> 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;, the
>> vhost site is displayed. However, if I type in the vhost name;
>>, 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.  
>This is Apache 2.4.x ?
>I don't see the 'default server ...',' is a NameVirtualHost'
>and 'alias'-lines in your 'apache2ctl -S' output.
>Did you remove those yourself?  It always helps not to obfuscate your configs
>and logs when seeking help.
># apache2ctl -S
>VirtualHost configuration:
>    is a NameVirtualHost
>   default server
> (/etc/apache2/sites-enabled/ port 443 namevhost
> (/etc/apache2/sites-enabled/
> alias [ .. ]
>[2001:7b8:633:1:213:154:236:176]:443 is a NameVirtualHost
>   default server
> (/etc/apache2/sites-enabled/ port 443 namevhost
> (/etc/apache2/sites-enabled/
> alias
>Apache will, by default, treat the first vhost definition it finds as
>the default vhost for that IP/port combo. Try defining a simple vhost
>before defining the vhost so that no longer is your
>default vhost.

I don't have an "apache2ctl" program. I do have an "apachectl" one though.
This is my output:

apachectl -S
VirtualHost configuration:
*:80 (/usr/local/etc/apache24/extra/httpd-vhosts.conf:24)
*:443 (/usr/local/etc/apache24/extra/httpd-ssl.conf:121)
ServerRoot: "/usr/local"
Main DocumentRoot: "/usr/local/www/apache24/data"
Main ErrorLog: "/var/log/httpd-error.log"
Mutex ssl-stapling-refresh: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/"
User: name="www" id=80
Group: name="www" id=80

httpd -V
Server version: Apache/2.4.35 (FreeBSD)
Server built:   unknown
Server's Module Magic Number: 20120211:82
Server loaded:  APR 1.6.3, APR-UTIL 1.6.1
Compiled using: APR 1.6.3, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/bin/suexec"
 -D DEFAULT_PIDLOG="/var/run/"
 -D DEFAULT_SCOREBOARD="/var/run/apache_runtime_status"
 -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
 -D AP_TYPES_CONFIG_FILE="etc/apache24/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache24/httpd.conf"

Now, in the httpd.conf file, I changed the "ServerName" to
"ServerName" and now the vhost appears to be working correctly.

So, it appears that my next challenge will be to get SSL working on the vhost.

Thanks for your help. I am sure I will be needing more shortly.


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