Linux for Data Scientists
HOGENT toegepaste
informatica
Thomas Parmentier, Andy Van Maele, Bert Van Vreckem, Jan Willem
2025-2026
/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.logerror.logsystemctl status mariadbsystemctl status apache2ss -tlnpInfo opvragen: geen sudo nodig
$ systemctl status <service>
$ systemctl is-enabled <service>
$ systemctl is-active <service>
$ systemctl list-units --type=service
$ systemctl list-units --failed
Toestanden wijzigen: sudo vereist!
$ sudo systemctl start <service>
$ sudo systemctl stop <service>
$ sudo systemctl restart <service>
$ sudo systemctl enable <service>
$ sudo systemctl disable <service>
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))
CLI webbrowser op de VM
PHP testen: maak bestand /var/www/html/info.php
Surf naar: http://localhost/info.php
ssl/etc/apache2/
mods-available, mods-enabledconf-available, conf-enabledhogent@LinuxGUI:/var/www/html$ sudo a2ensite default-ssl
Enabling site default-ssl.
To activate the new configuration, you need to run:
systemctl reload apache2
hogent@LinuxGUI:~$ sudo a2enmod ssl
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Module socache_shmcb already enabled
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
systemctl restart apache2
hogent@LinuxGUI:~$ sudo systemctl restart apache2.service
Controleer open poorten met ss en open de pagina met
https!
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
journalctljournalctl vereist root-permissies
adm of
systemd-journal/var/log/syslog (hoofd-logbestand)/var/log/dmesg (log bootproces)| Actie | Commando |
|---|---|
| Toon laatste lijnen en wacht | journalctl -f,
--follow |
| Toon enkel log van SERVICE | journalctl -u SERVICE,
--unit=SERVICE |
Log voor executable, bv.
dhclient |
journalctl /usr/sbin/dhclient |
Log voor apparaat, bv.
/dev/sda |
journalctl /dev/sda |
| Toon auditd logs | journalctl _TRANSPORT=audit |
| Actie | Commando |
|---|---|
| Toon log sinds laatste boot | journalctl -b,
--boot |
Kernelberichten (zoals
dmesg) |
journalctl -k,
--dmesg |
| Omgekeerde uitvoer (nieuwste eerst) | journalctl -r,
--reverse |
| Toon alleen fouten en erger | journalctl -p err,
--priority=err |
| Sinds gisteren | journalctl --since=yesterday |
Filter op tijd (voorbeeld):
journalctl --since=2018-06-00 \
--until="2018-06-07 12:00:00"
Veel meer opties in de man-pagina!
ip a
$ sudo mysql mysql
...
MariaDB [mysql]> SHOW DATABASES;
MariaDB [mysql]> SELECT user,password from user;
MariaDB [mysql]> quitsudo => inloggen als MariaDB-root
sudo2e mysql: inloggen op database
mysql
Ga nu zelf verder met de labo-oefening! Leerpad 4.4.1