iT邦幫忙

0

[已解決] ntopng 6.0 源碼編譯後,網頁登入一直失敗.求解?

  • 分享至 

  • xImage

請問透過 github 取得ntopng 6.0 Source自行編譯沒問題.
但執行後網頁上登入一直告知帳密錯誤!
請問有無網友自行編譯且成功使用.敬請有經驗網友給與指導!
謝謝.

OS: Rocky Linux 9.3
原碼下載處:
https://fossies.org/linux/ntopng/doc/README.md
參考網頁說明:
https://github.com/ntop/ntopng/blob/dev/doc/README.compilation

On Rocky 9
~~~~~~~~~~~~~~~~~
dnf group install "Development Tools"
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
yum install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
yum config-manager --set-enabled remi
dnf config-manager --set-enabled crb
yum clean all
yum install openldap-devel libpcap-devel openssl-devel libcurl-devel libmaxminddb-devel sqlite-devel\
 mysql-devel radcli-devel librdkafka-devel libcap-devel zeromq-devel rrdtool-devel\
 json-c-devel expect expat-devel npm numactl-devel net-snmp-devel
yum update
npm install -g uglify-es

dnf install redis
systemctl start redis

原碼編譯注意事項, ntopng 6.0 要選 nDPI 4.8版
nDPI 下載處 https://github.com/ntop/nDPI/tree/4.8-stable

unzip ntopng-6.0-stable.zip
mv ntopng-6.0-stable ntopng-6.0
cd ntopng-6.0
unzip nDPI-4.8-stable.zip
mv ./nDPI-4.8-stable/ nDPI/

cd nDPI/
  ./autogen.sh
  make
  cd .. # 回到 ntopng-6.0
./autogen.sh
./configure
make
make install

執行:
redis 要先執行:
cd /usr/local/bin
./ntopng

22/Mar/2024 08:50:46 [startup.lua:124] Initializing device polices...
22/Mar/2024 08:50:46 [startup.lua:140] Initializing alerts...
22/Mar/2024 08:50:46 [startup.lua:149] Initializing timeseries...
22/Mar/2024 08:50:46 [startup.lua:212] Fetching latest ntop blog posts...
22/Mar/2024 08:50:48 [startup.lua:233] Completed startup.lua
22/Mar/2024 08:50:48 [PeriodicActivities.cpp:167] Found 10 activities
22/Mar/2024 08:50:48 [FlowChecksLoader.cpp:261] WARNING: Unable to find flow check 'connection_failed': skipping it
22/Mar/2024 08:50:48 [NetworkInterface.cpp:3400] Started packet polling on interface ens192 [id: 1]...
22/Mar/2024 08:50:48 [NetworkInterface.cpp:3400] Started packet polling on interface lo [id: 2]...

執行成功,但透過網頁登入都會失敗!

若由 debug 模式:會出現下列訊息
22/Mar/2024 08:54:09 [HTTPserver.cpp:513] [HTTP] Session  is expired
22/Mar/2024 08:54:09 [HTTPserver.cpp:670] [HTTP] redirect_to_login()
22/Mar/2024 08:54:09 [HTTPserver.cpp:513] [HTTP] Session  is expired
22/Mar/2024 08:54:09 [HTTPserver.cpp:1320] [HTTP] /lua/login.lua [/usr/local/share/ntopng/scripts/lua/login.lua]
22/Mar/2024 08:54:09 [HTTPserver.cpp:1378] [HTTP] Serving file /usr/local/share/ntopng/httpdocs/dist/third-party.                  css
22/Mar/2024 08:54:09 [HTTPserver.cpp:1378] [HTTP] Serving file /usr/local/share/ntopng/httpdocs/dist/ntopng.css
22/Mar/2024 08:54:09 [HTTPserver.cpp:1378] [HTTP] Serving file /usr/local/share/ntopng/httpdocs/dist/login.js
22/Mar/2024 08:54:09 [HTTPserver.cpp:1378] [HTTP] Serving file /usr/local/share/ntopng/httpdocs/dist/white-mode.c                  ss
22/Mar/2024 08:54:09 [HTTPserver.cpp:1378] [HTTP] Serving file /usr/local/share/ntopng/httpdocs/dist/third-party.                  js
22/Mar/2024 08:54:09 [HTTPserver.cpp:513] [HTTP] Session  is expired
22/Mar/2024 08:54:09 [HTTPserver.cpp:670] [HTTP] redirect_to_login()
22/Mar/2024 08:54:09 [HTTPserver.cpp:513] [HTTP] Session  is expired
22/Mar/2024 08:54:09 [HTTPserver.cpp:1320] [HTTP] /lua/login.lua [/usr/local/share/ntopng/scripts/lua/login.lua]

預設 admin 密碼: admin 有查過 redis 資料庫 admin 存的是一樣!即使編譯舊版 ntopng 5.4 結果也一樣.所以想請問網友有無成功編譯能執行成功.謝謝

# echo -n 'admin' | md5sum
21232f297a57a5a743894a0e4a801fc3  -
# redis-cli GET ntopng.user.admin.password
"21232f297a57a5a743894a0e4a801fc3"

最後解決方法:
因網頁缺了 css 相關檔案,在 dist 目錄下查了好久終於在 github 討論區發現?

https://github.com/ntop/ntopng/issues/6805
# git clone https://github.com/ntop/ntopng-dist.git
# cp -pr /usr/local/src/ntopng-dist/* /usr/local/share/ntopng/httpdocs/dist/.

給有此問題的人參考!

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答