Linux for Data Scientists
HOGENT toegepaste
informatica
Thomas Parmentier, Andy Van Maele, Bert Van Vreckem
2024-2025
/etc/apache2/
: configuratie Apache
/etc/apache2/apache2.conf
/etc/apache2/conf-enabled/*.conf
/etc/apache2/mods-enabled/*.conf
/etc/apache2/sites-enabled/*.conf
/var/www/html/
: Apache DocumentRoot/var/log/apache2/
: logbestanden
access.log
error.log
systemctl status mariadb
systemctl status apache2
ss -tlnp
ss = Show Sockets
Task | Command |
---|---|
Show server sockets | ss -l ,
--listening |
Show TCP sockets | ss -t ,
--tcp |
Show UDP sockets | ss -u ,
--udp |
Show port numbers(*) | ss -n ,
--numeric |
Show process(†) | ss -p ,
--processes |
(*) instead of service names from /etc/services
(†) root permissions required
linuxmint@linuxmint21:~$ sudo ss -tlnp
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 80 127.0.0.1:3306 0.0.0.0:* users:(("mariadbd",pid=45957,fd=20))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=850,fd=3))
LISTEN 0 511 *:80 *:* users:(("apache2",pid=52633,fd=4),[...])
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=850,fd=4))
/var/www/html/info.php
Voorbeeld voor Apache:
$ sudo journalctl
$ sudo journalctl -u apache2
$ sudo journalctl -flu apache2
$ sudo tail -f /var/log/apache2/access_log
$ sudo tail -f /var/log/apache2/error_log
journalctl
journalctl
vereist root-permissies
adm
of
systemd-journal
/var/log/syslog
(hoofd-logbestand)/var/log/dmesg
(log bootproces)Action | Command |
---|---|
Show latest log and wait for changes | journalctl -f ,
--follow |
Show only log of SERVICE | journalctl -u SERVICE ,
--unit=SERVICE |
Match executable,
e.g. dhclient |
journalctl /usr/sbin/dhclient |
Match device node,
e.g. /dev/sda |
journalctl /dev/sda |
Show auditd logs | journalctl _TRANSPORT=audit |
Action | Command |
---|---|
Show log since last boot | journalctl -b ,
--boot |
Kernel messages (like
dmesg ) |
journalctl -k ,
--dmesg |
Reverse output (newest first) | journalctl -r ,
--reverse |
Show only errors and worse | journalctl -p err ,
--priority=err |
Since yesterday | journalctl --since=yesterday |
Filter on time (example):
journalctl --since=2018-06-00 \
--until="2018-06-07 12:00:00"
Much more options in the man-page!
ip a
Hou je wachtwoorden goed bij!
$ sudo mysql mysql
...
MariaDB [mysql]> SHOW DATABASES;
MariaDB [mysql]> SELECT user,password from user;
MariaDB [mysql]> quit
sudo
=> inloggen als MariaDB-rootmysql
: inloggen op database mysql
Ga nu zelf verder met de labo-oefening! Leerpad 4.4.1