Apache 2.4

Mario Lobo lobo at bsd.com.br
Fri Feb 9 17:16:09 UTC 2018


Hi;

2018-02-09 13:44 GMT-03:00 James B. Byrne via freebsd-questions <
freebsd-questions at freebsd.org>:

> I have Apache24 configured to load a virtual host. Viz:
>
> <VirtualHost 192.168.216.107:80>
>
>   ServerName    hll107.hamilton.harte-lyne.ca
>   DocumentRoot  /usr/local/www/apache24/data/hll_dav/upload
>   LogLevel      debug
>
>   ErrorLog      /var/log/httpd/apache24/webdav/webdav_error.x.log
>   TransferLog   /var/log/httpd/apache24/webdav/webdav_access.x.log
>
> # For Testing without ssl
> # This traps anyone under the actual file-system root
> # Just in case.
>   <Directory />
>     Order allow,deny
>     allow from all
>
>     Options               Indexes MultiViews
>     IndexOptions          FancyIndexing
>     AddDefaultCharset     UTF-8
>
>     AuthType              Basic
>     AuthBasicProvider     file
>     AuthName              ca.harte-lyne
>     AuthUserFile          /usr/local/etc/apache24/access.d/.htpasswd
>
>     Require               valid-user
>
> # mod_dav_fs
>     Dav On
>     # No Sever Minimum Timeout on locks - let WebDaV clients decide
>     DAVMinTimeout         0
>     DAVDepthInfinity      Off
>     LimitXMLRequestBody   96000000
>
>   </Directory>
> </VirtualHost>
>
>
>
> In httpd.conf I have these statements:
>
>
> ServerName    hll108.hamilton.harte-lyne.ca:80
> Listen        192.168.216.108:80
>
> ErrorLog      /var/log/httpd/apache24/httpd-error.log
> LogLevel      debug
>
> <Directory />
>     AllowOverride none
>     Require all denied
> </Directory>
>
> DocumentRoot "/usr/local/www/apache24/data"
>
> <Directory "/usr/local/www/apache24/data">
>     Options Indexes FollowSymLinks
>     AllowOverride None
>     Require all granted
> </Directory>
>
> <IfModule dir_module>
>     DirectoryIndex index.html
> </IfModule>
>
> ErrorLog /var/log/httpd/apache24/httpd-error.log
> LogLevel debug
>
> CustomLog /var/log/httpd/apache24/httpd-access.log "common"
>
> include etc/apache24/virtual.d/*.conf.x
>
>
> Now the problems:
>
> 1. When I restart apache24 and do a netstat I do not see the virtual
> host ip bound to port 80:
>
> netstat -an | grep -i list
> netstat: kvm not available: /dev/mem: No such file or directory
> tcp4       0      0 192.168.216.108.80     *.*                    LISTEN
> tcp4       0      0 127.0.107.1.25         *.*                    LISTEN
> tcp4       0      0 192.168.216.107.22     *.*                    LISTEN
> tcp4       0      0 127.0.107.1.53         *.*                    LISTEN
>
>
> 2. When I attempt to connect to the virtual host ipv4 address
> 192.168.216.107 I get this instead of a directory listing:
>
> fetch -o - http://192.168.216.107
> -                                               0% of   45  B    0
> Bps<html><body><h1>It works!</h1></body></html>
> -                                             100% of   45  B  293
> kBps 00m00s
>
> And in the logs I see this
>
>
> ll
> -rw-r--r--  1 root  wheel  0 Feb  9 11:07 httpd-access.log
> -rw-r--r--  1 root  wheel  0 Feb  9 11:07 webdav_access.x.log
> -rw-r--r--  1 root  wheel  0 Feb  9 11:07 webdav_error.x.log
>
> There are no entries made at all.
>
> What is going on?  I do not care that I get the default site content
> for the main host but why is the virtual host being redirected there
> as well.  And where is the listener for 192.168.216.107:80?  Why do I
> not see that in Netstat?
>
>
> --
> ***          e-Mail is NOT a SECURE channel          ***
>         Do NOT transmit sensitive data via e-Mail
>  Do NOT open attachments nor follow links sent by e-Mail
>
> James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
> Harte & Lyne Limited          http://www.harte-lyne.ca
> 9 Brockley Drive              vox: +1 905 561 1241
> Hamilton, Ontario             fax: +1 905 561 0757
> Canada  L8E 3C3
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-
> unsubscribe at freebsd.org"
>

Hi;

I'm not sure about this but I believe that for apache to run on different
IPs you have to have different instances of it.

You can change a virtualhost port but not the Ip on which the instance of
apache is running.

-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!]


More information about the freebsd-questions mailing list