Configurando um servidor Linux
- Instalar o Linux CentOS 6.4 64bits minimal
- Configurar a rede (eth0 local, eth1 velox)
- /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.220.131
NETMASK=255.255.255.0
GATEWAY=192.168.220.250
- /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
- /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
- Desabilitar SELinux
- /etc/selinux/config
SELINUX=disabled
- /etc/hosts (Acrecentar o resultado do comando hostname)
127.0.0.1 localhost ... nomedohost
- Instalar repositório YUM
# yum install wget
# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# yum clean all
# yum update
- Instalar pacotes do yum
# yum install openssh-clients dhcp samba squid cups openvpn rp-pppoe vsftpd gcc make httpd gd gd-devel pcre pcre-devel man php ntpdate ntsysv bind chkconfig
# chkconfig --levels 235 dhcpd on
# chkconfig --levels 235 smb on
# chkconfig --levels 235 squid on
# chkconfig --levels 235 cups on
# chkconfig --levels 235 openvpn on
# chkconfig --levels 235 vsftpd on
# chkconfig --levels 235 httpd on
# chkconfig --levels 235 bind on
- Baixar o SARG
# cd /root
# wget http://sourceforge.net/projects/sarg/files/sarg/sarg-2.3.7/sarg-2.3.7.tar.gz/download
- Configurar a velox
- Colocar no /etc/hosts o nome do servidor para o ip 127.0.0.1
# pppoe-setup
- Testar o nat
# iptables -F
# iptables -X
# echo "1" > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o ppp+ -s 192.168.0.0/24 -j MASQUERADE
- Configurar o DNS
- https://sites.google.com/site/silviogarbes/sistemas/linux/bind
- Configurar o Firewall
- https://sites.google.com/site/silviogarbes/sistemas/linux/iptables
- Configurar o Squid
# chmod 4755 /usr/lib64/squid/pam_auth
- https://sites.google.com/site/silviogarbes/sistemas/linux/squid
- Configurar o Sarg
- https://sites.google.com/site/silviogarbes/sistemas/linux/sarg
- Configurar o DHCP
- https://sites.google.com/site/silviogarbes/sistemas/linux/dhcp
- Configurar o FTP
- Configurar o Samba
- Configurar o Cups
- Configurar o Openvpn
- Configurar o Apache
Habilitar os serviços para inicializarem automaticamente
# ntsysv