Mudanças entre as edições de "Projeto Integrador - 2014.2 - No Pain No Gain"
Linha 105: | Linha 105: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Quando a tela de configuração do tipo de servidor aparecer escolher a opção SITE DA INTERNET. | + | <syntaxhighlight lang=bash> |
− | + | Quando a tela de configuração do tipo de servidor aparecer escolher a opção SITE DA INTERNET. | |
− | No campo, Nome de email do sistema | + | No campo, Nome de email do sistema nopainnogain.com.br |
− | |||
Arquivo /etc/postfix fazer uma copia do arquivo main.cf | Arquivo /etc/postfix fazer uma copia do arquivo main.cf | ||
+ | cp main.cf main.cf.original | ||
− | + | # vi main.cf | |
− | |||
− | |||
− | |||
− | # vi main. | ||
− | |||
− | Apagar tudo que | + | Apagar tudo que esta no arquivo e copiar o que esta abaixo e alterar apenas o que esta em negrito para a configuração. |
− | < | + | <syntaxhighlight lang=bash> |
− | # Debian specific: | + | # See /usr/share/postfix/main.cf.dist for a commented, more complete version |
− | # line of that file to be used as the name. | + | # Debian specific: Specifying a file name will cause the first |
+ | # line of that file to be used as the name. The Debian default | ||
# is /etc/mailname. | # is /etc/mailname. | ||
#myorigin = /etc/mailname | #myorigin = /etc/mailname | ||
Linha 157: | Linha 153: | ||
alias_database = hash:/etc/aliases | alias_database = hash:/etc/aliases | ||
myorigin = /etc/mailname | myorigin = /etc/mailname | ||
− | mydestination = nopainnogain. | + | mydestination = nopainnogain.com.br, hostname_do_seu_servidor, localhost.localdomain, localhost |
− | relayhost = smtp.nopainnogain. | + | relayhost = smtp.nopainnogain.com.br |
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 | mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 | ||
mailbox_size_limit = 0 | mailbox_size_limit = 0 | ||
Linha 167: | Linha 163: | ||
Salvar o arquivo. | Salvar o arquivo. | ||
− | Ainda na pasta do postfix (/etc/postfix), criar um arquivo chamado | + | Ainda na pasta do postfix (/etc/postfix), criar um arquivo chamado saslpass com o editor de texto e adicionar a seguinte linha |
− | < | + | <syntaxhighlight lang=bash> |
+ | smtp.seudominio.com.brcontadeemail@seudominio.com.br:senhadaconta | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Linha 175: | Linha 172: | ||
Compilar o arquivo. | Compilar o arquivo. | ||
− | + | sudo postmap /etc/postfix/saslpass | |
sudo postfix reload | sudo postfix reload | ||
− | + | Por ultimo alterar o arquivo aliases que esta em /etc/ adicionando um alias para root o arquivo deve ficar igual ao exemplo abaixo. | |
− | + | <syntaxhighlight lang=bash> | |
− | Por | + | # See man 5 aliases for format |
− | < | ||
postmaster: root | postmaster: root | ||
root: seu_email@dominio.com.br | root: seu_email@dominio.com.br | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
Sair do arquivo e executar os seguintes comandos: | Sair do arquivo e executar os seguintes comandos: | ||
− | + | sudo newaliases | |
sudo postfix reload | sudo postfix reload | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Testamos o Email de acordo com o texto, abaixo: | Testamos o Email de acordo com o texto, abaixo: | ||
− | < | + | |
+ | <syntaxhighlight lang=bash> | ||
> sudo service postfix restart | > sudo service postfix restart | ||
> telnet localhost 25 | > telnet localhost 25 | ||
Linha 204: | Linha 200: | ||
354 End data with <CR><LF>.<CR><LF> | 354 End data with <CR><LF>.<CR><LF> | ||
subject: Teste | subject: Teste | ||
+ | |||
blabla | blabla | ||
. | . | ||
Linha 214: | Linha 211: | ||
<h1>'''Dia 25/11/2014'''</h1> | <h1>'''Dia 25/11/2014'''</h1> | ||
+ | |||
+ | - Configuramos o '''DNS''': | ||
''Arquivo: /etc/network/interfaces'' | ''Arquivo: /etc/network/interfaces'' | ||
− | < | + | <syntaxhighlight lang=bash> |
# The loopback network interface | # The loopback network interface | ||
auto lo eth1 eth1:0 eth0 eth0.10 eth0.20 eth0.30 | auto lo eth1 eth1:0 eth0 eth0.10 eth0.20 eth0.30 | ||
Linha 240: | Linha 239: | ||
gateway 192.168.1.1 | gateway 192.168.1.1 | ||
− | #Teste | + | #Teste Vlan10 |
iface eth0.10 inet static | iface eth0.10 inet static | ||
address 192.168.10.2 | address 192.168.10.2 | ||
netmask 255.255.255.128 | netmask 255.255.255.128 | ||
− | + | gateway 192.168.10.1 | |
− | #Teste | + | #Teste Vlan20 |
iface eth0.20 inet static | iface eth0.20 inet static | ||
address 192.168.20.2 | address 192.168.20.2 | ||
netmask 255.255.255.128 | netmask 255.255.255.128 | ||
− | + | gateway 192.168.20.1 | |
− | #Teste | + | #Teste Vlan30 - Rede Sem Fio |
iface eth0.30 inet static | iface eth0.30 inet static | ||
address 192.168.30.2 | address 192.168.30.2 | ||
netmask 255.255.255.128 | netmask 255.255.255.128 | ||
− | + | gateway 192.168.30.1 | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
''Arquivo: /etc/bind/named.conf.local'' | ''Arquivo: /etc/bind/named.conf.local'' | ||
− | < | + | <syntaxhighlight lang=bash> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
//Zona de pesquisa direta | //Zona de pesquisa direta | ||
zone "nopainnogain.sj.ifsc.edu.br" { | zone "nopainnogain.sj.ifsc.edu.br" { | ||
Linha 279: | Linha 268: | ||
//Zona de pesquisa reversa | //Zona de pesquisa reversa | ||
− | zone " | + | zone "1.168.192.in-addr.arpa" { |
type master; | type master; | ||
− | file "/etc/bind/db.192"; | + | file "/etc/bind/db.192"; |
+ | }; | ||
+ | ~ | ||
</syntaxhighlight> | </syntaxhighlight> | ||
''Arquivo: /etc/bind/db.nopainnogain.sj.ifsc.edu.br'' | ''Arquivo: /etc/bind/db.nopainnogain.sj.ifsc.edu.br'' | ||
− | < | + | <syntaxhighlight lang=bash> |
; | ; | ||
; BIND data file for local loopback interface | ; BIND data file for local loopback interface | ||
; | ; | ||
− | $TTL | + | $TTL 604800 |
− | @ IN | + | @ IN SOA nopainnogain.sj.ifsc.edu.br. root.nopainnogain.sj.ifsc.edu.br. ( |
− | + | 100 ; Serial | |
− | + | 604800 ; Refresh | |
− | + | 86400 ; Retry | |
− | + | 2419200 ; Expire | |
− | + | 604800 ) ; Negative Cache TTL | |
− | ; | + | ; |
− | + | nopainnogain.sj.ifsc.edu.br. IN NS nopainnogain.sj.ifsc.edu.br. | |
− | + | nopainnogain.sj.ifsc.edu.br. IN A 192.168.1.21 | |
− | + | roteador IN A 192.168.1.1 | |
− | + | vendas IN A 192.168.1.50 | |
− | + | www IN CNAME nopainnogain.sj.ifsc.edu.br. | |
− | |||
− | www | ||
</syntaxhighlight> | </syntaxhighlight> | ||
''Arquivo: /etc/bind/db.192'' | ''Arquivo: /etc/bind/db.192'' | ||
− | < | + | <syntaxhighlight lang=bash> |
+ | ; | ||
; BIND reverse data file for local loopback interface | ; BIND reverse data file for local loopback interface | ||
; | ; | ||
− | $TTL | + | $TTL 604800 |
− | @ | + | @ IN SOA nopainnogain.sj.ifsc.edu.br. root.napainnogain.sj.ifsc.edu.br. ( |
− | + | 1 ; Serial | |
− | + | 604800 ; Refresh | |
− | + | 86400 ; Retry | |
− | + | 2419200 ; Expire | |
− | + | 604800 ) ; Negative Cache TTL | |
; | ; | ||
− | + | IN NS nopainnogain. | |
− | + | 1 IN PTR roteador.nopainnogain.sj.ifsc.edu.br. | |
− | + | 50 IN PTR vendas.nopainnogain.sj.ifsc.edu.br. | |
− | + | 21 IN PTR nopainnogain.sj.ifsc.edu.br. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
- Configuramos o '''Apache''': | - Configuramos o '''Apache''': | ||
− | < | + | <syntaxhighlight lang=bash> |
NameVirtualHost *:80 | NameVirtualHost *:80 | ||
Linha 350: | Linha 331: | ||
- Configuramos o '''DHCP''': | - Configuramos o '''DHCP''': | ||
+ | |||
+ | OBS: Vamos alterar alguns parâmetros desta configuração após nosso IP 200.135.37.121/26 esteja liberado. | ||
''Arquivo: /etc/dhcp/dhcpd.conf'' | ''Arquivo: /etc/dhcp/dhcpd.conf'' | ||
− | < | + | <syntaxhighlight lang=bash> |
#Tempos de Aluguel | #Tempos de Aluguel | ||
default-lease-time 600; | default-lease-time 600; | ||
Linha 358: | Linha 341: | ||
#VLAN1 ETH0.10 | #VLAN1 ETH0.10 | ||
− | subnet 192.168.10.0 netmask 255.255.255.128 { | + | subnet 192.168.10.0 netmask 255.255.255.128 { |
− | + | range 192.168.10.2 192.168.10.126; | |
− | + | option broadcast-address 192.168.10.127; | |
− | + | option routers 192.168.10.1; | |
− | + | option domain-name-servers 192.168.1.21; | |
− | # | + | # option domain-name "nopainnogain.sj.ifsc.edu.br"; |
} | } | ||
#VLAN2 ETH0.20 | #VLAN2 ETH0.20 | ||
− | subnet 192.168.20.0 netmask 255.255.255.128 { | + | subnet 192.168.20.0 netmask 255.255.255.128 { |
− | + | range 192.168.20.2 192.168.20.126; | |
− | + | option broadcast-address 192.168.20.127; | |
− | + | option routers 192.168.20.1; | |
− | + | option domain-name-servers 192.168.1.21; | |
− | # | + | # option domain-name "nopainnogain.sj.ifsc.edu.br"; |
} | } | ||
#VLAN3 ETH0.30 - Rede Sem Fio | #VLAN3 ETH0.30 - Rede Sem Fio | ||
− | subnet 192.168.30.0 netmask 255.255.255.128 { | + | subnet 192.168.30.0 netmask 255.255.255.128 { |
− | + | range 192.168.30.2 192.168.30.126; | |
− | + | option broadcast-address 192.168.30.127; | |
− | + | option routers 192.168.30.1; | |
− | + | option domain-name-servers 192.168.1.21; | |
− | + | # option domain-name "nopainnogain.sj.ifsc.edu.br"; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | # | ||
} | } | ||
Linha 396: | Linha 370: | ||
hardware ethernet 00:1a:4d:97:a4:63; | hardware ethernet 00:1a:4d:97:a4:63; | ||
fixed-address 200.135.37.121; | fixed-address 200.135.37.121; | ||
− | + | option host-name "nopainnogain"; | |
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Linha 403: | Linha 378: | ||
''Arquivo: /etc/default/isc-dhcp-server'' | ''Arquivo: /etc/default/isc-dhcp-server'' | ||
− | < | + | <syntaxhighlight lang=bash> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? | # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? | ||
# Separate multiple interfaces with spaces, e.g. "eth0 eth1". | # Separate multiple interfaces with spaces, e.g. "eth0 eth1". | ||
− | INTERFACES=" | + | INTERFACES="eth0.10 eth0.20 eth0.30" |
− | + | ||
#eth0.10 VLAN1 | #eth0.10 VLAN1 | ||
#eth0.20 VLAN2 | #eth0.20 VLAN2 | ||
#eth0.30 VLAN3 - Rede Sem Fio | #eth0.30 VLAN3 - Rede Sem Fio | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Linha 439: | Linha 392: | ||
- Configurando o '''Webmail''' | - Configurando o '''Webmail''' | ||
− | < | + | <syntaxhighlight lang=bash> |
instalando | instalando | ||
Linha 474: | Linha 427: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[arquivo: Img-7993fef2.png]] | [[arquivo: Img-7993fef2.png]] | ||
+ | |||
<h1>'''Dia 28/11/2014'''</h1> | <h1>'''Dia 28/11/2014'''</h1> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Edição das 19h04min de 9 de dezembro de 2014
Início Dia 17/11/2014
Decidimos pelo nome da equipe "No Pain, No Gain".
Escolhemos o Sistema Operacional Centos 6.6, porém só conseguiremos instala-lo no dia 18/11.
- Informações Técnicas do Servidor:
- Processador Intel Core
- Memória RAM 1GB.
- HD 320GB.
- Placa de Rede Healtek
- Três interfaces de Rede: Onboard(1) Offboard(2)
Dia 18/11/2014
Serviços previstos:
Tivemos palestra com o Engº Patrick Soares, da empresa OI, das 19 às 20:30.
Retornamos ao Projeto Integrador na aula do Professor Fábio, de Instalação.
Tivemos problema quanto a instalação do Sistema Operacional Centos 6.6, mas no fim, conseguimos faze-la com um CD bootável. Para isso, foi preciso trocar o drive de CD da máquina do Servidor.
Instalamos os seguintes Serviços e Servidores: DHCP, DNS, PHP, MYSQL, RADIUS, APACHE
Dia 19/11/2014
Alteramos nosso Sistema Operacional para Ubuntu Server 13.04, pois o Centos 6.6 não era conhecido por todos da equipe e se tornaria mais difícil a sua configuração.
No entanto, tivemos problemas com a instalação do novo SO em nosso Servidor.
Por isso, trocamos nossa máquina Servidora:
- Informações Técnicas do Servidor:
- Processador Pentium D 1.2Ghz
- Memória RAM 1,5GB.
- HD 80GB.
- Placa de Rede Healtek
- Três interfaces de Rede: Onboard(1) Offboard(2)
Dia 20/11/2014
Conseguimos instalar o Sistema Operacional Ubuntu Server 13.04.
Dividimos nossas atividades de acordo com a tabela, abaixo:
Tarefa | Responsável |
---|---|
Programação | Tiago Flores |
DNS, WEB | Nivaldo |
EMAIL, WEBMAIL | Joel |
DHCP, FIREWALL, SSH | Bruna |
- Atualização do Ubuntu Server, utilizando os comandos:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade.
- Instalação de alguns serviços, utilizando os comandos:
sudo apt-get install openssh-server
sudo apt-get install bind9
sudo apt-get install apache2
sudo apt-get install isc-dhcp-server
sudo apt-get install mysql-server
Dia 21/11/2014
Tivemos quatro aulas de Cabeamento com o Professor Saul, onde pudemos realizar as seguintes atividades:
- Instalação DSLAM na sala de RedesI
- Separamos o Patch Panel, Organizadores de cabos, Switch, Bandejas do Armário e
- Definimos os 4 Pontos de Tomada (Rede e Câmera).
Dia 24/11/2014
- Configuramos o Postfix:
sudo apt-get install postfix
Quando a tela de configuração do tipo de servidor aparecer escolher a opção SITE DA INTERNET.
No campo, Nome de email do sistema nopainnogain.com.br
Arquivo /etc/postfix fazer uma copia do arquivo main.cf
cp main.cf main.cf.original
# vi main.cf
Apagar tudo que esta no arquivo e copiar o que esta abaixo e alterar apenas o que esta em negrito para a configuração.
<syntaxhighlight lang=bash>
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# SASL
smtp_sasl_auth_enable=yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/saslpass
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = hostname_do_seu_servidor
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = nopainnogain.com.br, hostname_do_seu_servidor, localhost.localdomain, localhost
relayhost = smtp.nopainnogain.com.br
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
Salvar o arquivo.
Ainda na pasta do postfix (/etc/postfix), criar um arquivo chamado saslpass com o editor de texto e adicionar a seguinte linha
smtp.seudominio.com.brcontadeemail@seudominio.com.br:senhadaconta
Salvar o arquivo e voltar para a pasta do postfix.
Compilar o arquivo. sudo postmap /etc/postfix/saslpass sudo postfix reload Por ultimo alterar o arquivo aliases que esta em /etc/ adicionando um alias para root o arquivo deve ficar igual ao exemplo abaixo.
# See man 5 aliases for format
postmaster: root
root: seu_email@dominio.com.br
Sair do arquivo e executar os seguintes comandos: sudo newaliases sudo postfix reload </syntaxhighlight>
Testamos o Email de acordo com o texto, abaixo:
> sudo service postfix restart
> telnet localhost 25
220 ger ESMTP postfix (Ubuntu)
helo mail
250 ger
mail from: aluno@ifsc.edu.br
250 2.1.0 OK
rcpt to: postmaster@gar.edu.br
250 2.1.5 OK
data
354 End data with <CR><LF>.<CR><LF>
subject: Teste
blabla
.
250 2.0.0 OK: queued as 71259CCA3
quit
221 2.0.0 Bye
Connection closed by foreign host
>
Dia 25/11/2014
- Configuramos o DNS:
Arquivo: /etc/network/interfaces
# The loopback network interface
auto lo eth1 eth1:0 eth0 eth0.10 eth0.20 eth0.30
iface lo inet loopback
#Configuração IP Principal (Modem)
iface eth1 inet static
address 200.135.37.121
netmask 255.255.255.192
gateway 200.135.37.126
#Configuração IP Secundário (Optica)
iface eth1:0 inet static
address 200.135.37.122
netmask 255.255.255.192
gateway 200.135.37.126
#Configuração para Vlan
iface eth0 inet static
address 192.168.1.21
netmask 255.255.255.0
gateway 192.168.1.1
#Teste Vlan10
iface eth0.10 inet static
address 192.168.10.2
netmask 255.255.255.128
gateway 192.168.10.1
#Teste Vlan20
iface eth0.20 inet static
address 192.168.20.2
netmask 255.255.255.128
gateway 192.168.20.1
#Teste Vlan30 - Rede Sem Fio
iface eth0.30 inet static
address 192.168.30.2
netmask 255.255.255.128
gateway 192.168.30.1
Arquivo: /etc/bind/named.conf.local
//Zona de pesquisa direta
zone "nopainnogain.sj.ifsc.edu.br" {
type master;
file "/etc/bind/db.nopainnogain.sj.ifsc.edu.br";
};
//Zona de pesquisa reversa
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/db.192";
};
~
Arquivo: /etc/bind/db.nopainnogain.sj.ifsc.edu.br
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA nopainnogain.sj.ifsc.edu.br. root.nopainnogain.sj.ifsc.edu.br. (
100 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
nopainnogain.sj.ifsc.edu.br. IN NS nopainnogain.sj.ifsc.edu.br.
nopainnogain.sj.ifsc.edu.br. IN A 192.168.1.21
roteador IN A 192.168.1.1
vendas IN A 192.168.1.50
www IN CNAME nopainnogain.sj.ifsc.edu.br.
Arquivo: /etc/bind/db.192
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA nopainnogain.sj.ifsc.edu.br. root.napainnogain.sj.ifsc.edu.br. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS nopainnogain.
1 IN PTR roteador.nopainnogain.sj.ifsc.edu.br.
50 IN PTR vendas.nopainnogain.sj.ifsc.edu.br.
21 IN PTR nopainnogain.sj.ifsc.edu.br.
- Configuramos o Apache:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/var/www/cli"
ServerName www.nopainnogain.sj.ifsc.edu.br
</virtualhost>
Alias /webmail "/usr/share/squirrelmail/"
DirectoryIndex index.php
Dia 26/11/2014
- Configuramos o DHCP:
OBS: Vamos alterar alguns parâmetros desta configuração após nosso IP 200.135.37.121/26 esteja liberado.
Arquivo: /etc/dhcp/dhcpd.conf
#Tempos de Aluguel
default-lease-time 600;
max-lease-time 7200;
#VLAN1 ETH0.10
subnet 192.168.10.0 netmask 255.255.255.128 {
range 192.168.10.2 192.168.10.126;
option broadcast-address 192.168.10.127;
option routers 192.168.10.1;
option domain-name-servers 192.168.1.21;
# option domain-name "nopainnogain.sj.ifsc.edu.br";
}
#VLAN2 ETH0.20
subnet 192.168.20.0 netmask 255.255.255.128 {
range 192.168.20.2 192.168.20.126;
option broadcast-address 192.168.20.127;
option routers 192.168.20.1;
option domain-name-servers 192.168.1.21;
# option domain-name "nopainnogain.sj.ifsc.edu.br";
}
#VLAN3 ETH0.30 - Rede Sem Fio
subnet 192.168.30.0 netmask 255.255.255.128 {
range 192.168.30.2 192.168.30.126;
option broadcast-address 192.168.30.127;
option routers 192.168.30.1;
option domain-name-servers 192.168.1.21;
# option domain-name "nopainnogain.sj.ifsc.edu.br";
}
host nopainnogain {
hardware ethernet 00:1a:4d:97:a4:63;
fixed-address 200.135.37.121;
option host-name "nopainnogain";
}
- Editamos a Interface que vai atender ao DHCP:
Arquivo: /etc/default/isc-dhcp-server
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0.10 eth0.20 eth0.30"
#eth0.10 VLAN1
#eth0.20 VLAN2
#eth0.30 VLAN3 - Rede Sem Fio
Dia 27/11/2014
- Configurando o Webmail
instalando
apt-get install squirrelmail
adicionar as duas linhas abaixo no arquivo "/etc/apache2/httpd.conf":
Alias /webmail "/usr/share/squirrelmail/"
DirectoryIndex index.php
ir no diretório:
"/usr/share/squirrelmail"
depois:
"squirrelmail-configure"
vai abrir essa janela de configuração:
opção 1 define o nome da empresa: No Pain No Gain
opção 2 o dominio do servidor: nopainnogain.sj.ifsc.edu.br
ainda na opção 2 configurar:
3. Sendmail or SMTP : SMTP
A. Update IMAP Settings : localhost:143 (other)
B. Update SMTP Settings : localhost:25
acessar a opção D e configurar o servidor IMAP conforme o dominio: nopainnogain.sj.ifsc.edu.br
S para salvar e Q para sair
Digitando http://192.168.1.21/webmail aparecerá a tela abaixo:
</syntaxhighlight>
Dia 28/11/2014