Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 56

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 198

Montando outro Servidor Ubuntu do Zero

E-mail Imprimir PDF
Dia 3 de outubro de 2007 comecei este blog quando me aventurei a instalar um servidor ubuntu com as seguintes características:
  • administração remota com algumas ferramentas disponíveis como: webmin, phpMyAdmin, phpMyLdapAdmin, Swat e outras que estiverem disponíveis e forem úteis ao meu propósito
  • acesso via putty externo
  • servidor samba
  • servidor ldap
  • servidor apache
  • servidor de email
  • servidor Web-Dav
  • servidor Ftp
  • servidor aMule interno
  • servidor Asterisk
  • servidor Impressão PDF
  • servidor MySql
  • servidor uPnP e Streaming de audio e video
  • servidor vmWare
  • dentre outros aplicativos ....

Durante este processo, fiz e refiz uma porção de configurações e utilizei este blog como uma maneira de registrar as informações que fui garimpando pela internet para realizar estas tarefas.

Não imagino que o processo de aprendizagem terminou mas vou colocar nesta postagem uma série de passos que vou seguir para refazer o servidor em questão pela enésima vez. Um dia pretendo fazer um script ou algo do tipo com a finalidade de falicitar este processo.

Passo 1 - Instalar o Ubuntu

Fiz o download da imagem Iso da versão atual do Ubuntu em http://www.ubuntu.com/getubuntu/download

Neste caso a versão disponível é a 7.10 - Gutsy Gibbon - lançada em 18 de outubro de 2007.

A instalação é bem simples e no momento de escolher os pacotes a instalar, escolhi:

  • DNS Server
  • LAMP Server
  • MAIL Server
  • OpenSSH Server
  • Print Server
  • Samba File Server

Como configurações adicionais solicitadas, temos:

  • senha root do MySQL
  • Postfix - Apenas local (depois configuro)
  • Postfix - Nome de mail: casa.lan

Passo 2 - Configurar senha do Root

Faça o login no sistema com o usuário informado na instalação e depois digite o comando abaixo.

sudo passwd root

Passo 3 - Configurar endereço IP estático

Edite o arquivo conforme o comando abaixo. Este comando utiliza o nano que é um editor de texto bem simples. Para sair e atualizar o conteúdo tecle control+X e confirme as alterações realizadas (Yes) e salve o arquivo com o mesmo nome anterior (Enter).

sudo bash
cp /etc/network/interfaces /etc/network/interfaces.old
nano /etc/network/interfaces

Troque o texto abaixo....

auto eth0
iface eth0 inet dhcp

.... pelo texto

auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Passo 4 - Configurar servidores de DNS

Edite o arquivo conforme o comando abaixo. Este comando utiliza o nano que é um editor de texto bem simples. Para sair e atualizar o conteúdo tecle control+X e confirme as alterações realizadas (Yes) e salve o arquivo com o mesmo nome anterior (Enter).

sudo bash
cp /etc/resolv.conf /etc/resolv.conf.old
nano /etc/resolv.conf

Troque o texto abaixo....

search virtua.com.br
nameserver 201.6.0.112
nameserver 201.6.0.139

.... pelo texto

search casa.lan
nameserver 192.168.1.10
nameserver 201.6.0.112
nameserver 201.6.0.139
nameserver 201.6.0.108
nameserver 127.0.0.1
domain casa

Reinicie e teste a configuração:

sudo /etc/init.d/networking restart
cd /root
host ubuntu.com
ifconfig > ifconfig.txt
/sbin/route > tabela_roteamento.txt
netstat -nat > conexões_internet.txt
netstat -tulp > portas_abertas.txt

Outras configurações antes de configurar o BIND.

sudo bash
cp /etc/hostname /etc/hostname.old
nano /etc/hostname

Troque o texto abaixo....

server

.... pelo texto

server.casa.lan

Depois...

sudo bash
cp /etc/hosts /etc/hosts.old
nano /etc/hosts

Troque o texto abaixo....

127.0.0.1 localhost
127.0.1.1 server

.... pelo texto

127.0.0.1 localhost server server.casa
127.0.1.1 server.casa.lan server server.casa
192.168.1.10 server.casa.lan server server.casa

Depois...

sudo bash
cp /etc/bind/named.conf.options /etc/bind/named.conf.options.old
nano /etc/bind/named.conf.options

Troque o texto abaixo....

forwarders {
};

.... pelo texto

forwarders {
201.6.0.112;
201.6.0.139;
201.6.0.108;
};
allow-transfer {192.168.1.0/24;localhost;localnets;};
allow-query { any; };
recursion yes;
allow-recursion {192.168.1.0/24;localhost;localnets;};
allow-query-cache {192.168.1.0/24;localhost;localnets;};
listen-on port 53 { 127.0.0.1;192.168.1.10;localhost;localnets;}; 
version "not currently available"; // para econder a versão do seu bind
tcp-clients 10; //quantidade de clientes para utilizar este DNS server

Reinicie o servidor de DNS:

sudo /etc/init.d/bind9 restart


Alterar o comportamento de como o sistema checa o DNS ...

sudo bash
cp /etc/nsswitch.conf /etc/nsswitch.conf.old
nano /etc/nsswitch.conf

Troque o texto abaixo....

hosts: files


.... pelo texto


hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4



Passo 5 - Atualizar os pacotes da instalação

Edite o arquivo conforme o comando abaixo. Este comando utiliza o nano que é um editor de texto bem simples. Para sair e atualizar o conteúdo tecle control+X e confirme as alterações realizadas (Yes) e salve o arquivo com o mesmo nome anterior (Enter).

sudo bash
cp /etc/apt/sources.list /etc/apt/sources.list .old
nano /etc/apt/sources.list
Comente com o caractere # a linha que começa com deb cdrom para quem tem conexão com internet e não deseja atualizar pelo CDROM.

Descomente apagando o caracter # da linha identificada como gutsy partner para ter acesso a pacotes de parceiros da canonical e arquivos.

Inclua as seguintes linhas ao final:

## Repositório Debian Sarge para instalação do Webmin
deb http://download.webmin.com/download/repository sarge contrib


Atualize tudo, inclusive verifique os upgrades disponíveis.
apt-get update
apt-get upgrade

Passo 6 - Acesso via SSH

Basta utilizar o aplicativo Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/).

Para editar arquivos pode-se utilizar programas como o vi, nano, pico ou o joe.
Em máquinas windows pode-se ainda utilizar o programa WinSCP (http://winscp.net/eng/index.php) para editar os arquivos via SSH.

Caso o Servidor SSH não tenha sido instado instale pelo comando abaixo
apt-get install openssh-server

Passo 7 - Instalar Webmin e Usermin

Vale a pena checar se voce possui todas as bibliotecas necessárias:

apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl libmd5-perl webmin usermin



Ao final do processo de instalação o Webmin se encontrará em /usr/share/webmin


Para acessar o webmin digite no browser:

https://localhost:10000/

Para acessar o usermin digite no browser:

ttps://localhost:20000/

Se precisar abrir a porta do servidor para fornecer acesso ao webmin segue algumas dicas não testadas (link: http://www.ubuntu.rohraff.org/index.php?title=Main_Page#Additional_Repositories_.28Gutsy_Gibbon_7.10.29) :
rule for IPTABLES (to open port 10000): iptables -A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT
to set up root password: sudo /usr/share/webmin/changepass.pl /etc/webmin root <your passwordhere>

Passo 8 - Adicionar Usuários

Para adicionar um usuário com todos os opcionais configurados execute:

adduser <username>
adduser <username> <group>
visudo --para modificar lista de sudoers ou simplemente adicione o usuário ao grupo admin
groups <username> --lista os grupos do usuário


Para remover algum grupo execute:

adduser --backup-to /home/backups/username --remove-home <username>
delgroup <username>


o link: http://www.yolinux.com/TUTORIALS/LinuxTutorialManagingGroups.html tem várias dicas de comandos (não testei todos) para gerenciar usuários e grupos no linux.

Passo 9 - Servidor de Backup

Para instalar software de backup Bacula execute:
apt-get install bacula-common bacula-console bacula-director-common bacula-fd bacula-sd libpg3 mtx mt-st
apt-get install bacula-director-mysql

Configure-o pelo webmin e informe a senha do Mysql quando da instalação.Link útil: http://www.vivaolinux.com.br/artigos/verArtigo.php?codigo=1910&pagina=2

Siga o tutorial do link http://www.debianhelp.co.uk/baculaweb.htm para instalar uma interface web própria.

wget  http://superb-west.dl.sourceforge.net/sourceforge/bacula/brestore_2.2.1-1_all.deb
wget  http://superb-west.dl.sourceforge.net/sourceforge/bacula/bweb-common_2.2.1-1_all.deb
wget  http://superb-west.dl.sourceforge.net/sourceforge/bacula/bweb_2.2.1-1_all.deb

apt-get install libtime-modules-perl libgtk2-gladexml-perl libexpect-perl libhtml-template-perl libgd-graph-perl
dpkg --install bweb-common_2.2.1-1_all.deb
dpkg --install bweb_2.2.1-1_all.deb
dpkg --install brestore_2.2.1-1_all.deb
mysql -p bacula < /usr/share/bweb/bweb-mysql.sql
chmod 644 /etc/bacula/bconsole.conf
chmod 755 /usr/bin/bconsole

nano /etc/apache/conf.d/bweb.conf
/etc/init.d/apache2 restart



Para acessar digite no browser:

https://localhost/bacula-web/test.php

Como o Bacula para fazer funcionar é meio complicado uma boa alternativa é o Restore.Instruções de como instalá-lo abaixo. Link: http://restore-backup.com/

Welcome to the Restore Repository for Debian/Ubuntu

To add this repository, add one of these to your /etc/apt/sources.list:

deb http://distro.holonyx.com/restore etch main
deb http://distro.holonyx.com/restore edgy main
deb http://distro.holonyx.com/restore feisty main
deb http://distro.holonyx.com/restore gutsy main

Add our repository's signature:

# wget -O - http://distro.holonyx.com/restore/restore.asc | sudo apt-key add -

To install the packages for Restore Enterprise Edition:

# sudo apt-get update
# sudo apt-get install restore-ee

To install the packages for Restore Data Center Edition:

# sudo apt-get update
# sudo apt-get install restore-dc



Passo 10 - Samba com o SWAT

Instale Swat com o comando:

apt-get install swat



Para acessar o usermin digite no browser, mas antes faça um shutdown no servidor:


http://localhost:901/

Próximo Passo

Lista de itens a escrever como fazer:

Configurar Fstab

Configurar Samba

Cups-pdf

apt-get install cups-pdf

Última atualização (
Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 117

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 243

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 249

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 250
Seg, 09 de Março de 2009 22:25 )
 

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 250
Banner

Identificação

Visitantes


Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/modules/mod_vvisit_counter/helper.php on line 56

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/modules/mod_vvisit_counter/helper.php on line 57

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/modules/mod_vvisit_counter/helper.php on line 58

Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/modules/mod_vvisit_counter/helper.php on line 59

Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/modules/mod_vvisit_counter/helper.php on line 60

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/modules/mod_vvisit_counter/helper.php on line 63
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterHoje43
mod_vvisit_counterOntem80
mod_vvisit_counterEsta semana292
mod_vvisit_counterEste mês1344
mod_vvisit_counterTodos505520

Últimas Notícias


Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 198

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_latestnews/helper.php on line 109

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_latestnews/helper.php on line 109

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_latestnews/helper.php on line 109

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_latestnews/helper.php on line 109

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_latestnews/helper.php on line 109

Mais Vistos


Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 198

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_mostread/helper.php on line 79

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_mostread/helper.php on line 79

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_mostread/helper.php on line 79

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_mostread/helper.php on line 79

Warning: Creating default object from empty value in /home/edifast0/public_html/corp/modules/mod_mostread/helper.php on line 79

Itens Relacionados


Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 198

Newsflash


Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/edifast0/public_html/corp/libraries/joomla/utilities/date.php on line 198
SERVER NOT FOUND or TIME OUT