# httpd



Version d'Apache:

```bash title="Version"
httpd24 -v

Server version: Apache/2.4.46 (Unix)
Server built:   Apr 19 2021 14:41:36
```



Logs:

```bash title="Voir les logs"
cd /var/log/httpd/

-rw-rw----  1 system log  383317 Aug 25 14:21 apache24-error_log
bruno@DS916:/var/log/httpd $
```



Arrêt du serveur Apache:

```bash
$ sudo synosystemctl stop pkg-apache24
Password:
[pkg-apache24] stopped.
```

Démarrage du serveur Apache:

```bash
$ sudo synosystemctl start pkg-apache24
[pkg-apache24] started.
```

Redémarrage du serveur Apache:

```bash
$ sudo synosystemctl restart pkg-apache24
[pkg-apache24] restarted.
```



Modules activés:

```bash
$ httpd24 -M
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_worker_module (static)
```



Tester la configuration:

```bash
$ httpd24 -t
l: httpd24: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
AH00316: WARNING: MaxRequestWorkers of 150 is not an integer multiple of ThreadsPerChild of 32, decreasing to nearest multiple 128, for a maximum of 4 servers.
Syntax OK
```



Configuration des VirtualHosts:

```bash
$ httpd24 -S
VirtualHost configuration:
*:443                  127.0.0.1 (/usr/local/etc/apache24/conf/httpd24.conf:99)
*:80                   127.0.0.1 (/usr/local/etc/apache24/conf/httpd24.conf:99)
ServerRoot: "/usr/local/etc/apache24"
Main DocumentRoot: "/usr/htdocs"
```



Configuration:

```bash
$ httpd24 -V
Server version: Apache/2.4.51 (Unix)
Server built:   Jan  5 2022 15:16:28
Server's Module Magic Number: 20120211:118
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
Architecture:   64-bit
Server MPM:     worker
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D BIG_SECURITY_HOLE
 -D SECURITY_HOLE_PASS_AUTHORIZATION
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_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"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="local/etc/apache24/conf/mime.types"
 -D SERVER_CONFIG_FILE="local/etc/apache24/conf/httpd24.conf"
```



Aide:

```bash
$ httpd24 -h
Usage: httpd24 [-D name] [-d directory] [-f file]
               [-C "directive"] [-c "directive"]
               [-k start|restart|graceful|graceful-stop|stop]
               [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
  -D name            : define a name for use in <IfDefine name> directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed vhost settings
  -t -D DUMP_RUN_CFG : show parsed run settings
  -S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
  -t -D DUMP_MODULES : show all loaded modules
  -M                 : a synonym for -t -D DUMP_MODULES
  -t -D DUMP_INCLUDES: show all included configuration files
  -t                 : run syntax check for config files
  -T                 : start without DocumentRoot(s) check
  -X                 : debug mode (only one worker, do not detach)
```



Fichiers de configuration:

```bash
bruno@DS916:/usr/local/etc/apache24 $ l
total 24
drwxr-xr-x  6 root root 4096 Feb 23 06:30 .
drwxr-xr-x 21 root root 4096 May  4 08:17 ..
lrwxrwxrwx  1 root root   58 Feb 23 06:30 conf -> /var/packages/Apache2.4/target/usr/local/etc/apache24/conf
drwxr-xr-x  2 root root 4096 Dec 10 11:50 conf-available
drwxr-xr-x  2 root root 4096 Dec 10 11:50 conf-enabled
lrwxrwxrwx  1 root root   58 Feb 23 06:30 logs -> /var/packages/Apache2.4/target/usr/local/etc/apache24/logs
lrwxrwxrwx  1 root root   52 Feb 23 06:30 modules -> /var/packages/Apache2.4/target/usr/local/lib/modules
lrwxrwxrwx  1 root root   57 Feb 23 06:30 run -> /var/packages/Apache2.4/target/usr/local/etc/apache24/run
drwxr-xr-x  2 root root 4096 Jun 30  2021 sites-available
drwxr-xr-x  2 root root 4096 Jul 16  2021 sites-enabled
```



Dossiers des modules:

```bash
bruno@DS916:/usr/local/etc/apache24/modules $ l
total 3284
drwxr-xr-x 1 root root   3570 Jan  5 08:21 .
drwxr-xr-x 1 root root     14 Jan  5 08:21 ..
-rwxr-xr-x 1 root root  10456 Jan  5 08:21 mod_access_compat.so
-rwxr-xr-x 1 root root  10456 Jan  5 08:21 mod_actions.so
-rwxr-xr-x 1 root root  18744 Jan  5 08:21 mod_alias.so
-rwxr-xr-x 1 root root  10392 Jan  5 08:21 mod_allowmethods.so
...
```

