/etc/apache2/ports.conf

1. /etc/apache2/ports.conf

Alysson
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







  


2. Re: /etc/apache2/ports.conf

Mauriciodez
Mauriciodez

(usa Debian)

Enviado em 17/05/2023 - 09:33h




v aí se ajuda

echo "Listen 80" | sed 's,Listen 80,Listen 81\nListen 82,' 



------------------------------------------------------| Linux User #621728 |------------------------------------------------------

" Nem sempre é amigo aquele que te tira do buraco !!! ( Saddam Hussein )"

------------------------------------------------------| Linux User #621728 |------------------------------------------------------








Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts