Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:webmanagement [2016/05/03 19:51] alfred [Backups] |
wiki2:webmanagement [2020/10/27 08:59] (actual) |
||
|---|---|---|---|
| Línea 49: | Línea 49: | ||
| </VirtualHost> | </VirtualHost> | ||
| </code> | </code> | ||
| - | It will depend on the server name. | + | It will depend on the server name. \\ |
| + | We will use then the ''a2ensite name_of_config'' to enable it. \\ | ||
| + | And... ''service apache2 reload'' | ||
| + | ==== Several ServerName's ==== | ||
| + | <code> | ||
| + | <VirtualHost *:80> | ||
| + | |||
| + | Servername wiki.lan | ||
| + | ServerAlias wiki | ||
| + | |||
| + | [...] | ||
| + | |||
| + | </Virtualhost> | ||
| + | </code> | ||
| + | Or... | ||
| + | <code> | ||
| + | <VirtualHost *> | ||
| + | DocumentRoot /Sites/example | ||
| + | ServerName www.example.com | ||
| + | ServerAlias *.example.com *.x-ample.com *.xmpl.com *.egzample.com | ||
| + | </VirtualHost> | ||
| + | </code> | ||
| ==== Restart ==== | ==== Restart ==== | ||
| <code> | <code> | ||
| Línea 56: | Línea 77: | ||
| </code> | </code> | ||
| + | ==== Check if config is right ==== | ||
| + | <code> | ||
| + | $ apachectl configtest | ||
| + | </code> | ||
| + | ==== Enable SSL ==== | ||
| + | |||
| + | You will need to enable the ssl mod: | ||
| + | <code> | ||
| + | $ a2enmod ssl | ||
| + | </code> | ||
| + | Also, you will need to check that the VirtualHost config allows ssl: | ||
| + | <code> | ||
| + | <IfModule mod_ssl.c> | ||
| + | <VirtualHost _default_:443> | ||
| + | </code> | ||
| + | Then... | ||
| + | * {{:wiki2:webmanagement:install_an_ssl_certificate_-_wikihow.pdf|}} | ||
| + | * {{:wiki2:webmanagement:how_to_create_a_self-signed_certificate.pdf|}} | ||
| + | |||
| + | |||
| + | ==== Install for PHP ==== | ||
| + | <code> | ||
| + | apt-get install php5-sqlite php5-gd php5-curl | ||
| + | </code> | ||
| + | |||
| + | ==== Auth ==== | ||
| + | * http://doc.norang.ca/apache-basic-auth.html | ||
| ===== Domain registration ===== | ===== Domain registration ===== | ||
| We should change the CNAME table and give an A type to a new record. | We should change the CNAME table and give an A type to a new record. | ||
| + | |||
| + | ===== Certbot ===== | ||
| + | https://certbot.eff.org/ | ||
| + | |||
| + | |||
| + | Para añadir un certificado para una web: | ||
| + | <code> | ||
| + | certbot --apache | ||
| + | </code> | ||
| + | |||
| + | Para updatear: | ||
| + | <code> | ||
| + | certbot renew | ||
| + | </code> | ||
| + | |||
| + | El update lo puedes poner en un crontab: | ||
| + | <code> | ||
| + | 20 2,14 * * * certbot renew | ||
| + | </code> | ||
| + | |||
| + | ==== Acciones ==== | ||
| + | |||
| + | Listar certificados: | ||
| + | <code> | ||
| + | docker exec -ti nginx /usr/local/bin/certbot-auto certificates | ||
| + | </code> | ||
| + | |||
| + | |||