88 lines
1.6 KiB
Markdown
88 lines
1.6 KiB
Markdown
# 5. Webmin
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
curl -o setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh
|
|
sh setup-repos.sh
|
|
rm setup-repos.sh
|
|
apt update && apt install webmin
|
|
```
|
|
|
|
## Configurer le compte admin
|
|
|
|
Remplacer `root` par `<USER>` dans :
|
|
- `/etc/webmin/miniserv.users`
|
|
- `/etc/webmin/webmin.acl`
|
|
|
|
```bash
|
|
sed -i 's/root:/<USER>:/' /etc/webmin/miniserv.users
|
|
sed -i 's/root:/<USER>:/' /etc/webmin/webmin.acl
|
|
service webmin restart
|
|
```
|
|
|
|
## Desactiver SSL natif (utiliser proxy Apache)
|
|
|
|
Webmin a des problemes avec SSL sur certaines versions. Utiliser un proxy Apache :
|
|
|
|
```bash
|
|
sed -i 's/ssl=1/ssl=0/' /etc/webmin/miniserv.conf
|
|
```
|
|
|
|
Ajouter dans `/etc/webmin/config` :
|
|
```
|
|
webprefixnoredir=1
|
|
relative_redir=1
|
|
```
|
|
|
|
Ajouter dans `/etc/webmin/miniserv.conf` :
|
|
```
|
|
referers=webmin.<DOMAINE>
|
|
redirect_port=443
|
|
redirect_ssl=1
|
|
```
|
|
|
|
```bash
|
|
systemctl restart webmin
|
|
```
|
|
|
|
## Creer le sous-domaine
|
|
|
|
1. DNS : A record `webmin` -> `<IP>`
|
|
2. ISPConfig > Sites > Subdomain (vhost) :
|
|
- Hostname : `webmin`
|
|
- Domain : `<DOMAINE>`
|
|
- Web folder : `webmin`
|
|
- SSL + Let's Encrypt
|
|
- Rewrite HTTP to HTTPS
|
|
|
|
3. Apache Directives :
|
|
```apache
|
|
<Proxy *>
|
|
Order deny,allow
|
|
Allow from all
|
|
</Proxy>
|
|
|
|
ProxyRequests Off
|
|
ProxyPass /stats !
|
|
ProxyPass /.well-known/acme-challenge !
|
|
|
|
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
|
|
ProxyPreserveHost On
|
|
|
|
ProxyPass / http://localhost:10000/
|
|
ProxyPassReverse / http://localhost:10000/
|
|
|
|
RedirectMatch ^/$ https://webmin.<DOMAINE>
|
|
```
|
|
|
|
## Ajouter le port au firewall
|
|
|
|
ISPConfig > System > Firewall : ajouter `10000` aux TCP ports.
|
|
|
|
## Acces
|
|
|
|
```
|
|
https://webmin.<DOMAINE>
|
|
```
|