Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run GoAccess with SSL support? #683

Closed
SeLLeRoNe opened this issue Mar 8, 2017 · 12 comments

Comments

@SeLLeRoNe
Copy link

commented Mar 8, 2017

Hi everyone,
i'm trying to run GoAccess in live mode and i would like to be able to catch those data using SSL, so i'm trying to use --ssl-cert and --ssl-key but apparently the error i've got is that the --ssl-cert is not a valid option.

This is the command i'm using with related error:

/usr/local/goaccess/bin/goaccess -f /var/log/httpd/domains/HOST.log -o /home/admin/domains/HOST/private_html/web.html --real-time-html --ws-url=HOST --ssl-cert=/usr/local/directadmin/data/users/admin/domains/sHOST.cert --ssl-key=/usr/local/directadmin/data/users/admin/domains/HOST.key

Error:

/usr/local/goaccess/bin/goaccess: unrecognized option '--ssl-cert=/usr/local/directadmin/data/users/admin/domains/HOST.cert'

My goal would be to have live data for the whole server (for now i'm testing just with a single log file) from the url https://HOST/web.html

I'm not 100% sure that the ssl part is actually needed, because Apache would take care of the SSL cert, but i'm not sure if i'm doing something wrong and what.

Thanks
Best regards
Andrea

@allinurl

This comment has been minimized.

Copy link
Owner

commented Mar 8, 2017

It looks like you didn't build GoAccess with --with-openssl support. You also need to install libssl-dev (in debian/ubuntu) before building goaccess. Please take a look at this table to determine the OpenSSL package you need.

Once you have installed the dev libraries for OpenSSL, you need to build goaccess as:

$ ./configure --enable-utf8 --enable-geoip=legacy --with-openssl
$ make
# make install

Then you should be able to run the command you posted above.

@allinurl allinurl changed the title SSL Configuration How to run GoAccess with SSL support? Mar 8, 2017
@SeLLeRoNe

This comment has been minimized.

Copy link
Author

commented Mar 8, 2017

Hi, thanks for that, it now start without error, but when i try to rech the page the page is just a loading "circle" with no data.

Also, what is the config value to run it in daemon mode?

Thanks

@allinurl

This comment has been minimized.

Copy link
Owner

commented Mar 8, 2017

Please take a look at your browser's console (Ctrl+Shift+j) and see if there are any errors. To run as a daemon, you can use --daemonize and make sure you are using absolute paths.

@SeLLeRoNe

This comment has been minimized.

Copy link
Author

commented Mar 8, 2017

Ok, i did check the network tab but not the console, the error is that is trying to conntect over http despide the ssl config:

Mixed Content: The page at 'https://HOST/web.html' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://HOST:7890/'. This request has been blocked; this endpoint must be available over WSS.

How do i need to set the ws path to specify ssl?

@allinurl

This comment has been minimized.

Copy link
Owner

commented Mar 8, 2017

Great question. You can specify it using --ws-url=host, e.g.,

--ws-url=wss://host:7890
@SeLLeRoNe

This comment has been minimized.

Copy link
Author

commented Mar 8, 2017

Ok! There we go! :) Now it's showing live informations :)

Thank you very much.

Let's say that now i wanna create an init script or a service to manage the daemon and keep the configuration file as the place where to get all the info (apparently exluding demonize but that shoudln't be a problem), as menthioned in a previous thread i cannot set the log-file path as *.log because i need to exlude *.error.log and there is no such a function.

If i try to use *.log in the log-file definition inside the config, it does'nt work.

Is that something i will always need to pass via command line using -f?

Thanks

@SeLLeRoNe

This comment has been minimized.

Copy link
Author

commented Mar 8, 2017

Side note, i've masquerated the host, can you please do the same on your last reply? ^^

Thanks

@allinurl

This comment has been minimized.

Copy link
Owner

commented Mar 9, 2017

In the config file you should be able to specify multiple log-file variables. The *.log is not possible in the config file since the actual expansion is done by the shell.

@SeLLeRoNe

This comment has been minimized.

Copy link
Author

commented Mar 9, 2017

I see, manually set the files is quite hard because of multiple domains and a file per-domain, i'll check if i can run a script before start the service to "compile" the config file so :)

Thanks

@allinurl

This comment has been minimized.

Copy link
Owner

commented Mar 9, 2017

Closing this. Feel free to reopen it if needed.

@allinurl allinurl closed this Mar 9, 2017
@zOthix

This comment has been minimized.

Copy link

commented Sep 16, 2019

how can i define in my config file --with-openssl

@allinurl

This comment has been minimized.

Copy link
Owner

commented Sep 16, 2019

@zOthix please build goaccess using --with-openssl then use --ssl-key=<path/priv.key> and --ssl-cert=<path/cert.crt>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.