
AlyssonAlmeida
(usa Ubuntu)
Enviado em 16/05/2023 - 19:53h
Atualmente meu script muda a porta 80 do apache2 para porta 81 com o comando ja definido na instalação do script.
sed -i 's,Listen 80,Listen 81,g' /etc/apache2/ports.conf
Alterando o arquivo /etc/apache2/ports.conf
E ficando desta forma.
###########################################################
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 81
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
###########################################################
So que eu preciso que o comando tambem adicione a porta 82 no /etc/apache2/ports.conf
Para ele ficar assim.
#########################################################
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 81
Listen 82
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
#######################################################
O que eu preciso adicionar ao comando
sed -i 's,Listen 80,Listen 81,g' /etc/apache2/ports.conf
Para escrever em /etc/apache2/ports.conf
Listen 81
Listen 82