OSDir


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

[users@httpd] Reverse proxy to ntopng with Apache 2.4 on FreeBSD


Hi list, 
 
I am trying to get an Apache 2.4 reverse proxy to ntopng to work, but unfortunately without success yet. Hopefully you can provide some pointers.
 
It is a FreeBSD 11.2-RELEASE-p4 system:
user@system:user $ freebsd-version -u
11.2-RELEASE-p4
user@system:user $ freebsd-version -k
11.2-RELEASE-p4
 
Apache version and other info:
user@system:user $ 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_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)
-D APR_USE_FLOCK_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/usr/local"
-D SUEXEC_BIN="/usr/local/bin/suexec"
-D DEFAULT_PIDLOG="/var/run/httpd.pid"
-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"
 
Apache modules loaded:
user@system:user $ httpd -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
authz_host_module (shared)
authz_core_module (shared)
allowmethods_module (shared)
mime_module (shared)
log_config_module (shared)
expires_module (shared)
headers_module (shared)
proxy_module (shared)
proxy_http_module (shared)
mpm_prefork_module (shared)
unixd_module (shared)
status_module (shared)
info_module (shared)
dir_module (shared)
alias_module (shared)
rewrite_module (shared)
 
The ntopng specific config is:
   ProxyRequests off
   ProxyPreserveHost on
   ProxyPass /ntopng/ http://localhost:3000/ntopng/
   ProxyPassReverse /ntopng/ http://localhost:3000/ntopng/
 
   <Location "/ntopng/">
      Require all granted
   </Location>
 
The ntopng version is:
user@system:user $ pkg info | grep ntopng
ntopng-3.6.d201800910,1        Network monitoring tool with command line and web interfaces
 
ntopng is started with:
/usr/local/etc/ntopng.conf
-U ntopng
-G /var/run/ntopng/ntopng.pid
-1 /usr/local/share/ntopng/httpdocs
-2 /usr/local/share/ntopng/scripts
-3 /usr/local/share/ntop
--dns-mode 1
--http-port 3000
--http-prefix /ntopng
 
What is happening is that I get the ntopng login page when browsing to http://ntopngsystem.intra.domain.com/ntopng/. But after filling the username and password the login page stays.
 
The access log shows:
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/ HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/lua/login.lua?referer=ntopngsystem.intra.domain.com/ HTTP/1.1" 200 5118
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/bootstrap/css/bootstrap-theme.css HTTP/1.1" 200 14939
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/bootstrap/css/bootstrap.css HTTP/1.1" 200 120067
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/rickshaw.css HTTP/1.1" 200 7309
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/dc.css HTTP/1.1" 200 4109
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/font-awesome/css/font-awesome.css HTTP/1.1" 200 37414
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/flags.css HTTP/1.1" 200 12737
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/jquery-ui.css HTTP/1.1" 200 37326
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/bootstrap-duallistbox.css HTTP/1.1" 200 1984
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/cal-heatmap.css HTTP/1.1" 200 1025
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/nv.d3.css HTTP/1.1" 200 12015
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/pie-chart.css HTTP/1.1" 200 1003
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/bootstrap-slider.css HTTP/1.1" 200 7889
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/custom_theme.css?1538121830 HTTP/1.1" 200 570
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/bootstrap-datetimepicker.css HTTP/1.1" 200 9038
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/ntopng.css?1538121830 HTTP/1.1" 200 7228
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/js/ntop.min.js?1538121830 HTTP/1.1" 200 53260
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/css/bootstrap-nav-wizard.css HTTP/1.1" 200 2982
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/js/jquery_bootstrap.min.js?1538121830 HTTP/1.1" 200 801964
10.x.y.z - - [28/Sep/2018:11:22:47 +0200] "GET /ntopng/js/deps.min.js?1538121830 HTTP/1.1" 200 908406
10.x.y.z - - [28/Sep/2018:11:23:09 +0200] "POST /ntopng/authorize.html HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:23:09 +0200] "GET /ntopng/ HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:23:09 +0200] "GET /ntopng/lua/login.lua?referer= ntopngsystem.intra.domain.com/ HTTP/1.1" 200 5118
10.x.y.z - - [28/Sep/2018:11:23:28 +0200] "POST /ntopng/authorize.html HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:23:28 +0200] "GET /ntopng/ HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:23:28 +0200] "GET /ntopng/lua/login.lua?referer= ntopngsystem.intra.domain.com/ HTTP/1.1" 200 5118
10.x.y.z - - [28/Sep/2018:11:41:53 +0200] "POST /ntopng/authorize.html HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:41:53 +0200] "GET /ntopng/lua/login.lua?referer= ntopngsystem.intra.domain.com/ HTTP/1.1" 200 5118
10.x.y.z - - [28/Sep/2018:11:42:11 +0200] "POST /ntopng/authorize.html HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:42:11 +0200] "GET /ntopng/ HTTP/1.1" 302 -
10.x.y.z - - [28/Sep/2018:11:42:11 +0200] "GET /ntopng/lua/login.lua?referer= ntopngsystem.intra.domain.com/ HTTP/1.1" 200 5118
 
The ntopng man page shows:
       -Z|--http-prefix <prefix>
        HTTP prefix to be prepended to URLs. This is useful when using ntopng
        behind a proxy.  E.g. if you want to make the ntopng web interface
        accessible through a proxy at a certain IP address with the /ntopng/
        base URL and you have the following lines in your proxy's
        configuration:
            ProxyPass /ntopng/ http://192.168.0.3:3000/ntopng/
            ProxyPassReverse /ntopng/ http://192.168.0.3:3000/ntopng/
        You must use ntopng with -Z "/ntopng"
        Do not use trailing shashes in the HTTP prefix.
 
And this is what I am doing. So what am I missing here?
 
I have
# ErrorLog: The location of the error log file.
ErrorLog "/var/log/apache/httpd-error.log"
ErrorLog syslog:daemon
 
# LogLevel: Control the number of messages logged to the error_log.
LogLevel debug
In my httpd.conf
 
And the file /var/log/apache/httpd-error.log shows no information!
 
Any pointers are really appreciated!
 
Thank you in advance.
 
With kind regards,
Lars 


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