1- Instalando o MySQL
Para instalar o MySQL acesse o diretório:
Para instalar o MySQL acesse o diretório:
1 | # cd /usr/ports/databases/mysql51-server/ |
Execute o comando de compilação e instalação do MySQL 5.1.52:
1 | # make BUILD_STATIC=yes BUILD_OPTIMIZED=yes WITH_OPENSSL=yes install clean |
Depois de instado o MySQL, vamos habilitar para o que ele inicialize quando o FreeBSD for reiniciado. Editar o arquivo “rc.conf”:
1 | # ee /etc/rc.conf |
Adicionando ao final do arquivo as linhas abaixo, depois salve o arquivo e saia:
1 2 | # MySQL mysql_enable="YES" |
Agora vamos iniciar o MySQL com o seguinte comando:
1 | # /usr/local/etc/rc.d/mysql-server start |
1 | # rehash |
Agora vamos realizar as alterações necessárias no MySQL. Primeiro alterar senha de root:
1 | # mysqladmin -uroot password “senha” (sem aspas) |
O próximo passo é criar um arquivo de configuração para o MySQL utilizando os samples existentes
1 | # cp /usr/local/share/mysql/my-large.cnf /var/db/mysql/my.cnf |
Depois acesse o arquivo my.cnf e descomente a linha skip-networking:
1 | # ee /var/db/mysql/my.cnf |
Agora reiniciar o MySQL:
1 | # /usr/local/etc/rc.d/mysql-server restart |
2- Instalando o Apache
Para instalar o Apache acesse o diretório:
1 | # cd /usr/ports/www/apache22 |
Configure as opções de compilação do Apache 2.2 com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no Apache 2.2.17_1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | [X] THREADS Enable threads support in APR [X] MYSQL Enable MySQL support for apr-dbd [ ] PGSQL Enable PostgreSQL support for apr-dbd [ ] SQLITE Enable SQLite support for apr-dbd [ ] IPV6 Enable IPv6 support [X] BDB Enable BerkeleyDB dbm [X] AUTH_BASIC Enable mod_auth_basic [X] AUTH_DIGEST Enable mod_auth_digest [X] AUTHN_FILE Enable mod_authn_file [ ] AUTHN_DBD Enable mod_authn_dbd [X] AUTHN_DBM Enable mod_authn_dbm [X] AUTHN_ANON Enable mod_authn_anon [X] AUTHN_DEFAULT Enable mod_authn_default [X] AUTHN_ALIAS Enable mod_authn_alias [X] AUTHZ_HOST Enable mod_authz_host [X] AUTHZ_GROUPFILE Enable mod_authz_groupfile [X] AUTHZ_USER Enable mod_authz_user [X] AUTHZ_DBM Enable mod_authz_dbm [X] AUTHZ_OWNER Enable mod_authz_owner [X] AUTHZ_DEFAULT Enable mod_authz_default [X] CACHE Enable mod_cache [X] DISK_CACHE Enable mod_disk_cache [X] FILE_CACHE Enable mod_file_cache [ ] MEM_CACHE Enable mod_mem_cache [X] DAV Enable mod_dav [X] DAV_FS Enable mod_dav_fs [ ] BUCKETEER Enable mod_bucketeer [ ] CASE_FILTER Enable mod_case_filter [ ] CASE_FILTER_IN Enable mod_case_filter_in [ ] EXT_FILTER Enable mod_ext_filter [ ] LOG_FORENSIC Enable mod_log_forensic [ ] OPTIONAL_HOOK_EXPORT Enable mod_optional_hook_export [ ] OPTIONAL_HOOK_IMPORT Enable mod_optional_hook_import [ ] OPTIONAL_FN_IMPORT Enable mod_optional_fn_import [ ] OPTIONAL_FN_EXPORT Enable mod_optional_fn_export [ ] LDAP Enable mod_ldap [ ] AUTHNZ_LDAP Enable mod_authnz_ldap [X] ACTIONS Enable mod_actions [X] ALIAS Enable mod_alias [X] ASIS Enable mod_asis [X] AUTOINDEX Enable mod_autoindex [X] CERN_META Enable mod_cern_meta [X] CGI Enable mod_cgi [X] CHARSET_LITE Enable mod_charset_lite [ ] DBD Enable mod_dbd [X] DEFLATE Enable mod_deflate [X] DIR Enable mod_dir [X] DUMPIO Enable mod_dumpio [X] ENV Enable mod_env [X] EXPIRES Enable mod_expires [X] HEADERS Enable mod_headers [X] IMAGEMAP Enable mod_imagemap [X] INCLUDE Enable mod_include [X] INFO Enable mod_info [X] LOG_CONFIG Enable mod_log_config [X] LOGIO Enable mod_logio [X] MIME Enable mod_mime [X] MIME_MAGIC Enable mod_mime_magic [X] NEGOTIATION Enable mod_negotiation [X] REWRITE Enable mod_rewrite [X] SETENVIF Enable mod_setenvif [X] SPELING Enable mod_speling [X] STATUS Enable mod_status [X] UNIQUE_ID Enable mod_unique_id [X] USERDIR Enable mod_userdir [X] USERTRACK Enable mod_usertrack [X] VHOST_ALIAS Enable mod_vhost_alias [X] FILTER Enable mod_filter [X] VERSION Enable mod_version [ ] PROXY Enable mod_proxy [ ] PROXY_CONNECT Enable mod_proxy_connect [X] PATCH_PROXY_CONNECT Patch proxy_connect SSL support [ ] PROXY_FTP Enable mod_proxy_ftp [ ] PROXY_HTTP Enable mod_proxy_http [ ] PROXY_AJP Enable mod_proxy_ajp [ ] PROXY_BALANCER Enable mod_proxy_balancer [ ] PROXY_SCGI Enable mod_proxy_scgi [X] SSL Enable mod_ssl [ ] SUEXEC Enable mod_suexec [ ] SUEXEC_RSRCLIMIT SuEXEC rlimits based on login class [X] REQTIMEOUT Enable mod_reqtimeout [ ] CGID Enable mod_cgid |
Execute o comando de compilação e instalação do Apache:
1 | # make install clean |
Marque as opções apropriadas para sua necessidade no perl 5.10.1_2:
1 2 3 4 5 6 7 8 9 | [ ] DEBUGGING Build with debugging support [ ] GDBM Build GDBM_File extension [X] PERL_MALLOC Use Perl malloc [X] PERL_64BITINT Use 64 bit integers (on i386) [X] THREADS Build threaded perl [ ] MULTIPLICITY Use multiplicity [ ] SUIDPERL Build set-user-id suidperl binary [ ] SITECUSTOMIZE Run-time customization of @INC [X] USE_PERL Rewrite links in /usr/bin |
Marque as opções apropriadas para sua necessidade no m4 1.4.15,1:
1 | [ ] LIBSIGSEGV Use libsigsegv for better diagnostics |
Marque as opções apropriadas para sua necessidade no libiconv 1.13.1_1:
1 2 | [X] EXTRA_ENCODINGS Include extra character sets [ ] EXTRA_PATCHES Apply patches to fix CP932, add EUCJP-MS |
Marque as opções apropriadas para sua necessidade no apr-ipv6-devrandom-gdbm-db42 1.4.2.1.3.10:
1 2 3 4 5 6 7 8 9 10 | [X] THREADS Enable Threads in apr [ ] IPV6 Enable IPV6 Support in apr [X] BDB Enable Berkley BDB support in apr-util [X] GDBM Enable GNU dbm support in apr-util [ ] LDAP Enable LDAP support in apr- [X] MYSQL Enable MySQL suport in apr- [ ] NDBM Enable NDBM support in apr- [ ] PGSQL Enable Postgresql suport in apr-util [ ] SQLITE Enable SQLite3 support in apr-util [X] DEVRANDOM Use /dev/random or compatible in apr |
Marque as opções apropriadas para sua necessidade no python26 2.6.6:
1 2 3 4 5 6 7 8 | [X] THREADS Enable thread support [ ] HUGE_STACK_SIZE Use a larger thread stack [ ] SEM Use POSIX semaphores (experimental) [ ] PTH Use GNU Pth for threading/multiprocessing [X] UCS4 Use UCS4 for unicode support [X] PYMALLOC Use python's internal malloc [ ] IPV6 Enable IPv6 support [ ] FPECTL Enable floating point exception handling |
Depois de realizado a instalação, vamos habilitar para o Apache inicializar quando o FreeBSDfor reiniciado. Editar o arquivo “rc.conf”.
1 | # ee /etc/rc.conf |
Adicionando ao final do arquivo as linhas abaixo, depois salve o arquivo e saia.
1 2 3 4 | # Apache apache22_enable="YES" accf_data_load="YES" accf_http_load="YES" |
Agora adicione a linha abaixo no “/etc/hosts”:
1 2 | # ee /etc/hosts 127.0.0.1 "hostname" |
Depois edite o arquivo “httpd.conf”:
1 2 | # ee /usr/local/etc/apache22/httpd.conf Servername "hostname":80 |
Agora vamos iniciar o Apache com o seguinte comando.
1 2 | # /usr/local/etc/rc.d/apache22 start # rehash |
Vamos agora testar o Apache. Use um browser para conectar a:
1 | # http:// "ip_do_servidor" |
Se tudo estiver certo será exibido “It works!”.
3- Instalando o PHP
Para instalar o PHP acesse o diretório:
1 | # cd /usr/ports/lang/php52 |
Configure as opções de compilação do PHP 52 com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no php52 5.2.14_1:
1 2 3 4 5 6 7 8 9 10 11 12 13 | [X] CLI Build CLI version [X] CGI Build CGI version [X] APACHE Build Apache module [ ] DEBUG Enable debug [X] SUHOSIN Enable Suhosin protection system (not for jails) [ ] MULTIBYTE Enable zend multibyte support [ ] IPV6 Enable ipv6 support [ ] MAILHEAD Enable mail header patch [ ] REDIRECT Enable force-cgi-redirect support (CGI only) [ ] DISCARD Enable discard-path support (CGI only) [X] FASTCGI Enable fastcgi support (CGI only) [ ] FPM Enable fastcgi process manager (CGI only) [X] PATHINFO Enable path-info-check support (CGI only) |
Acesse o diretório das extensões do PHP:
1 | # cd ../php52-extensions/ |
Configure as opções de compilação do php52-extensions com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no php52-extensions 1.4:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | [ ] BCMATH bc style precision math functions [X] BZ2 bzip2 library support [ ] CALENDAR calendar conversion support [X] CTYPE ctype functions [ ] CURL CURL support [ ] DBA dba support [ ] DBASE dBase library support [X] DOM DOM support [ ] EXIF EXIF support [ ] FILEINFO fileinfo support [X] FILTER input filter support [ ] FRIBIDI FriBidi support [ ] FTP FTP support [X] GD GD library support [X] GETTEXT gettext library support [ ] GMP GNU MP support [X] HASH HASH Message Digest Framework [X] ICONV iconv support [ ] IMAP IMAP support [ ] INTERBASE Interbase 6 database support (Firebird) [X] JSON JavaScript Object Serialization support [ ] LDAP OpenLDAP support [X] MBSTRING multibyte string support [X] MCRYPT Encryption support [X] MHASH Crypto-hashing support [ ] MING ming shockwave flash support [ ] MSSQL MS-SQL database support [X] MYSQL MySQL database support [ ] MYSQLI MySQLi database support [ ] NCURSES ncurses support (CLI only) [ ] ODBC unixODBC support [X] OPENSSL OpenSSL support [ ] PCNTL pcntl support (CLI only) [X] PCRE Perl Compatible Regular Expression support [X] PDF PDFlib support (implies GD) [X] PDO PHP Data Objects Interface (PDO) [ ] PDO_SQLITE PDO sqlite driver [X] PDO_MYSQL PDO mysql driver [ ] PGSQL PostgreSQL database support [X] POSIX POSIX-like functions [ ] PSPELL pspell support [ ] READLINE readline support (CLI only) [ ] RECODE recode support [X] SESSION session support [ ] SHMOP shmop support [X] SIMPLEXML simplexml support [ ] SNMP SNMP support [ ] SOAP SOAP support [ ] SOCKETS sockets support [X] SPL Standard PHP Library [ ] SQLITE sqlite support [ ] SYBASE_CT Sybase database support [ ] SYSVMSG System V message support [ ] SYSVSEM System V semaphore support [ ] SYSVSHM System V shared memory support [ ] TIDY TIDY support [X] TOKENIZER tokenizer support [ ] WDDX WDDX support (implies XML) [X] XML XML support [X] XMLREADER XMLReader support [ ] XMLRPC XMLRPC-EPI support [X] XMLWRITER XMLWriter support [ ] XSL XSL support (Implies DOM) [ ] YAZ YAZ support (ANSI/NISO Z39.50) [X] ZIP ZIP support [X] ZLIB ZLIB support |
Execute o comando de compilação e instalação do PHP e PHP Extensions:
1 | # make install clean |
Marque as opções apropriadas para sua necessidade no php52-pcre 5.2.14_1:
1 | [X] BUNDLED_PCRE Select if you use apache 2.0.x |
Marque as opções apropriadas para sua necessidade no php52-gd 5.2.14_1:
1 2 3 | [X] T1LIB Include T1lib support [X] TRUETYPE Enable TrueType string function [ ] JIS Enable JIS-mapped Japanese font support |
Marque as opções apropriadas para sua necessidade no libxslt 1.1.26_2:
1 2 | [ ] MEM_DEBUG Enable memory debugging [X] CRYPTO Enable crypto support for exslt |
Marque as opções apropriadas para sua necessidade no png 1.4.3:
1 | [ ] APNG Animated PNG support |
Marque as opções apropriadas para sua necessidade no php52-mbstring 5.2.14_1:
1 | [X] REGEX Enable multibyte regex support |
As configurações do PHP ficam guardados em “/usr/local/etc/php.ini”. É necessário criar o arquivo utilizando um dos samples existentes executando o comando:
1 | # cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini |
Agora vamos configurar o PHP no Apache. Edite o arquivo “/usr/local/etc/apache22/httpd.conf” e adicione as linhas abaixo:
1 | # ee /usr/local/etc/apache22/httpd.conf |
1 2 3 | # Dentro da sessão "ifmodule mime_module" AddType application/x-httpd-php .php .php3 .phtml AddType application/x-httpd-php-source .phps |
1 2 | # Dentro da sessão "ifmodule dir_module" DirectoryIndex index.html index.htm index.php |
Agora vamos alterar o arquivo “/usr/local/etc/php.ini”. Altere as opções conforme abaixo:
1 2 | # ee /usr/local/etc/php.ini short_open_tag = On |
Vamos agora testar o PHP. Crie o arquivo “index.php” e adicione o seguinte conteúdo nele:
1 2 | # touch /usr/local/www/apache22/data/index.php # echo "<? php phpinfo(); ?>" > /usr/local/www/apache22/data/index.php |
Feito isso vamos reiniciar o Apache com o seguinte comando:
1 2 | # /usr/local/etc/rc.d/apache22 restart # rehash |
Para acessar a pagina de teste use um browser para conectar a:
1 | # http:// "ip_do_servidor"/index.php |
Se tudo estiver certo será exibida as configurações do Apache e PHP.
4- Instalando alguns pacotes em PERL
Para instalar os pacotes do Perl acesse os diretórios e execute os comandos de instalação e compilação:
1 2 3 4 5 | # cd /usr/ports/devel/p5-Config-IniFiles # make install clean # cd /usr/ports/graphics/p5-GD # make install clean |
Marque as opções apropriadas para sua necessidade no gd 2.0.35_7,1:
1 2 3 4 | [ ] X11 X11 support [ ] XPM XPM color bitmap loading support (requires X11) [X] FONTCONFIG fontconfig library support (requires X11) [ ] ICONV iconv support |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # cd /usr/ports/databases/p5-DBD-mysql # make install clean # cd /usr/ports/security/p5-Crypt-DES # make install clean # cd /usr/ports/security/p5-Digest-HMAC # make install clean # cd /usr/ports/net/p5-IO-Socket-INET6 # make install clean # cd /usr/ports/net-mgmt/p5-Net-SNMP # make install clean |
5- Instalando o Bash
Para instalar o Bash acesse o diretório:
1 | # cd /usr/ports/shells/bash |
Execute o comando de compilação e instalação do Bash 4.1:
1 | # make install clean |
6- Instalando o SUDO
Para instalar o Sudo acesse o diretório:
1 | # cd /usr/ports/security/sudo |
Configure as opções de compilação do Sudo 1.7 com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no Sudo 1.7.4.4_1:
1 2 3 4 5 | [ ] LDAP With LDAP support [ ] INSULTS With all insults [ ] DISABLE_ROOT_SUDO Disable root sudo [ ] DISABLE_AUTH Disable authentication [ ] NOARGS_SHELL Enable no arguments shell |
Execute o comando de compilação e instalação do Sudo:
1 | # make batch=yes install clean |
7- Instalando o Net-SNMP
Para instalar o Net-SNMP acesse o diretório:
1 | # cd /usr/ports/net-mgmt/net-snmp |
Configure as opções de compilação do Net-SNMP 5 com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no net-snmp 5.5_4:
1 2 3 4 5 6 7 | [ ] IPV6 Build with IPv6 support [X] MFD_REWRITES Build with 64-bit Interface Counters [X] PERL Install additional perl modules [X] PERL_EMBEDDED Build embedded perl [X] DUMMY Enable dummy values as placeholders [ ] TKMIB Install graphical MIB browser [ ] DMALLOC Enable dmalloc debug memory allocator |
Execute o comando de compilação e instalação do Net-SNMP:
1 | # make install clean |
Depois de realizado a instalação, vamos habilitar para o Net-SNMP inicializar quando oFreeBSD for reiniciado. Editar o arquivo “rc.conf”.
1 | # ee /etc/rc.conf |
Adicionando ao final do arquivo as linhas abaixo, depois salve o arquivo e saia.
1 2 3 | # Net-SNMP snmpd_enable="YES" snmpd_conffile="/usr/local/etc/snmp/snmpd.conf" |
Agora vamos configurar o Net-SNMP:
1 2 3 | # mkdir /usr/local/etc/snmp # cp /usr/local/share/snmp/snmpd.conf.example /usr/local/etc/snmp/snmpd.conf # perl -p -i -e 's/com2sec local localhost COMMUNITY/com2sec local localhost public/g' /usr/local/etc/snmp/snmpd.conf |
Feito isso vamos iniciar o Net-SNMP com o seguinte comando:
1 2 | # /usr/local/etc/rc.d/snmpd start # rehash |
8- Instalando o Pear
Para instalar o Pear acesse o diretório:
1 | # cd /usr/ports/devel/pear |
Execute o comando de compilação e instalação do Pear 1.9.1:
1 | # make install clean |
9- Instalando alguns pacotes do Pear
Para instalar os pacotes do Pear acesse os diretórios e execute os comandos de instalação e compilação::
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | # cd /usr/ports/databases/pear-DB_DataObject # make BATCH=yes install clean # cd /usr/ports/databases/pear-DB_DataObject_FormBuilder # make BATCH=yes install clean # cd /usr/ports/databases/pear-MDB2 # make install clean # cd /usr/ports/textproc/pear-Numbers_Roman # make install clean # cd /usr/ports/textproc/pear-Numbers_Words # make install clean # cd /usr/ports/devel/pear-HTML_QuickForm2 # make install clean # cd /usr/ports/devel/pear-HTML_QuickForm_advmultiselect # make install clean # /usr/local/bin/pear uninstall HTML_QuickForm_advmultiselect # /usr/local/bin/pear install -f pear/HTML_QuickForm_advmultiselect-1.2.0 # cd /usr/ports/net/pear-Net_Traceroute # make install clean # cd /usr/ports/net/pear-Net_Ping # make install clean # cd /usr/ports/devel/pear-Validate # make install clean # cd /usr/ports/net/pear-XML_RPC # make install clean # cd /usr/ports/mail/pear-Mail # make BATCH=yes install clean # cd /usr/ports/mail/pear-Mail_Mime # make install clean # cd /usr/ports/www/pear-HTTP # make install clean # cd /usr/ports/net/pear-SOAP # make BATCH="" install clean # cd /usr/ports/devel/pear-HTML_Table # make install clean # cd /usr/ports/security/pear-Auth_SASL # make BATCH=yes install clean # cd /usr/ports/graphics/pear-Image_Canvas # make install clean # cd /usr/ports/graphics/pear-Image_Graph # make BATCH=yes install clean # cd /usr/ports/graphics/pear-Image_GraphViz # make BATCH=yes install clean # cd /usr/ports/net/pear-Net_SMTP # make BATCH=yes install clean |
10- Instalando o RRDTOOL
Para instalar o RRDTOOL acesse o diretório:
1 | # cd /usr/ports/databases/rrdtool |
Execute o comando de compilação e instalação do RRDTOOL 1.4.4:
1 | # make BATCH=yes install clean |
11- Instalando o Nagios
Para instalar o Nagios acesse o diretório:
1 | # cd /usr/ports/net-mgmt/nagios/ |
Configure as opções de compilação do Nagios 3.2.3 com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no Nagios 3.2.2_1:
1 2 3 4 | [X] EMBEDDED_PERL Enable embedded Perl [requires Perl 5.8.0+] [X] NANOSLEEP Use nanosleep in event timing [X] EVENT_BROKER Enable event broker functionality [ ] UNHANDLED_HACK Display passive checks in unhandled queries |
Execute o comando de compilação e instalação do Nagios:
1 | # make install clean |
Marque as opções apropriadas para sua necessidade no nagios-plugins 1.4.15_1,1:
1 2 3 4 5 6 7 8 9 10 | [ ] QSTAT Game server query support (check_game) [X] FPING Support for non-flooding fast ping (check_fping) [X] NETSNMP SNMP support (check_snmp) [ ] RADIUS Radius support (check_radius) [X] MYSQL MySQL support (check_mysql) [ ] PGSQL PostgreSQL support (check_pgsql) [ ] LDAP OpenLDAP support (check_ldap) [ ] IPV6 IPv6 support [ ] JAIL Compilation within jail(8) (see Makefile) [ ] DMALLOC Enable dmalloc debug memory allocator |
Marque as opções apropriadas:
1 2 3 4 5 6 7 | # pw: unknown group `nagios' # You need a "nagios" group. # Would you like me to create it [YES]? Yes # Done. # pw: no such user `nagios' #You need a "nagios" user. # Would you like me to create it [YES]? Yes |
Depois de realizado a instalação, vamos habilitar para o Nagios inicializar quando o FreeBSDfor reiniciado. Editar o arquivo “rc.conf”.
1 | # ee /etc/rc.conf |
Adicionando ao final do arquivo as linhas abaixo, depois salve o arquivo e saia.
1 2 | # Nagios nagios_enable="YES" |
Agora vamos configurar o “http.conf” do Apache:
1 | # ee /usr/local/etc/apache22/httpd.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ScriptAlias /nagios/cgi-bin /usr/local/www/nagios/cgi-bin < directory "/usr/local/www/nagios/cgi-bin"> AllowOverride AuthConfig Options ExecCGI Order allow,deny Allow from all </ Directory > Alias /nagios /usr/local/www/nagios < directory "/usr/local/www/nagios"> Options None AllowOverride AuthConfig Order allow,deny Allow from all </ Directory > |
Feito isso vamos reiniciar o Apache com o seguinte comando:
1 | # /usr/local/etc/rc.d/apache22 restart |
Vamos agora testar o Nagios. Use um browser para conectar a:
1 | # http:// "ip_do_servidor"/nagios |
Se tudo estiver certo será mostrado à tela inicial do Nagios.
12- Configurando o Nagios
Primeiramente vamos a pasta que contem os arquivos de configuração do Nagios:
1 | # cd /usr/local/etc/nagios/ |
Feito isso vamos criar um backup dos arquivos samples de configuração:
1 2 | # mkdir samples # mv *.cfg-sample samples |
Agora vamos criar os arquivos de configuração:
1 2 3 | # cp samples/cgi.cfg-sample cgi.cfg # cp samples/nagios.cfg-sample nagios.cfg # cp samples/resource.cfg-sample resource.cfg |
Depois faça o mesmo para os objetos:
1 2 3 | # cd objects # mkdir samples # mv *.cfg-sample samples |
Agora vamos criar os arquivos de configuração:
1 2 3 4 5 6 7 | # cp samples/commands.cfg-sample commands.cfg # cp samples/contacts.cfg-sample contacts.cfg # cp samples/localhost.cfg-sample localhost.cfg # cp samples/printer.cfg-sample printer.cfg # cp samples/switch.cfg-sample switch.cfg # cp samples/templates.cfg-sample templates.cfg # cp samples/timeperiods.cfg-sample timeperiods.cfg |
Feito isso vamos iniciar o Nagios com o seguinte comando:
1 | # /usr/local/etc/rc.d/nagios start |
13- Instalando o pacote de figuras do Nagios
Para instalar as figuras do Nagios acesse o diretório:
1 | # cd /usr/ports/misc/nagios-base-logos |
Execute o comando de compilação e instalação do nagios-base-logos-1.0:
1 | # make install clean |
14- Instalando o NDO-Utils
Para instalar as figuras do NDO-Utils acesse o diretório:
1 | # cd /usr/ports/net-mgmt/ndoutils/ |
Configure as opções de compilação do NDO-Utils com o comando:
1 | # make config |
Marque as opções apropriadas para sua necessidade no ndoutils 1.4b8_3:
1 2 | [X] MYSQL MySQL Backend [ ] PGSQL Postgresql Backend |
Execute o comando de compilação e instalação do NDO-Utils:
1 | # make install clean |
15- Instalando o Centreon
Para instalar o Centreon primeiramente vamos baixar o pacote de instalação e descompactá-lo em um diretório:
1 2 3 4 | # cd /usr/ports/distfiles # tar zxf centreon-2.1.10.tar.gz # cd centreon-2.1.10 |
Vamos realizar algums acertos no sistema:
1 2 3 4 | # perl -p -i -e 's/\/bin\/bash/\/usr\/local\/bin\/bash/g' install.sh # perl -p -i -e 's/\/bin\/bash/\/usr\/local\/bin\/bash/g' libinstall/* # mkdir /usr/local/etc/cron.d # cd /usr/ports/distfiles/centreon-2.1.10/tmpl/vardistrib |
Crei o arquivo abaixo com o seguinte conteúdo
1 | # ee freebsd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | # -*-Shell-script-*- # # This file contain reconfigured variables used in install scripts # By default, when you use ./install.sh -f freebsd, you'll accept GPL licence. ##################################################################### ## Begin: Install modules ##################################################################### ## What do you want to install ? ## 0 = no, 1 = yes ## CentWeb: Web front Centreon for Nagios PROCESS_CENTREON_WWW=1 ## CentStorage: Log and charts archiving. PROCESS_CENTSTORAGE=1 ## CentCore: Distributed Monitoring engine. PROCESS_CENTCORE=1 ## CentPlugins: Centreon Plugins for nagios PROCESS_CENTREON_PLUGINS=1 ## CentTraps: Centreon Snmp traps process for nagios PROCESS_CENTREON_SNMP_TRAPS=1 ##################################################################### ## End: Install modules ##################################################################### ##################################################################### ## Begin: Default variables ##################################################################### ## Your default variables ## $BASE_DIR is the centreon source directory LOG_DIR="$BASE_DIR/log" LOG_FILE="$LOG_DIR/install_centreon.log" ## Don't change values above unless you perfectly understand ## what you are doing. ## Centreon temporary directory to work TMP_DIR="/tmp/centreon-setup" ## default snmp config directory SNMP_ETC="/usr/local/etc/snmp/" ## a list of pear modules require by Centreon PEAR_MODULES_LIST="pear.lst" ##################################################################### ## End: Default variables ##################################################################### ##################################################################### ## Begin: Centreon preferences ##################################################################### ## Above variables are necessary to run a silent install ## Where you want to install Centreon (Centreon root directory) INSTALL_DIR_CENTREON="/usr/local/centreon" ## Centreon log files directory CENTREON_LOG="/var/log/centreon" ## Centreon config files CENTREON_ETC="/usr/local/etc/centreon" ## Centreon run dir (all .pid, .run, .lock) CENTREON_RUNDIR="/var/run/centreon" ## Centreon generation config directory ## filesGeneration and filesUpload CENTREON_GENDIR="/var/cache/centreon" ## CentStorage RRDs directory (where .rrd files go) CENTSTORAGE_RRD="/var/lib/centreon" ## path to centstorage binary CENTSTORAGE_BINDIR="/usr/local/centreon/bin" ## path to centcore binary CENTCORE_BINDIR="/usr/local/centreon/bin" ## libraries temporary files directory CENTREON_VARLIB="/var/lib/centreon" ## Some plugins require temporary datas to process output. ## These temp datas are store in the CENTPLUGINS_TMP path. CENTPLUGINS_TMP="/var/lib/centreon/centplugins" ## path to centpluginsTraps binaries CENTPLUGINSTRAPS_BINDIR="/usr/local/centreon/bin" ## path for snmptt installation SNMPTT_BINDIR="/usr/local/centreon/bin/" ## force install init script (install in init.d) ## Set to "1" to enable CENTCORE_INSTALL_INIT=1 CENTSTORAGE_INSTALL_INIT=1 ## force install run level for init script (add all link on rcX.d) ## Set to "1" to enable CENTCORE_INSTALL_RUNLVL=1 CENTSTORAGE_INSTALL_RUNLVL=1 ##################################################################### ## End: Centreon preferences ##################################################################### ##################################################################### ## Begin: Nagios preferences ##################################################################### ## Install directory INSTALL_DIR_NAGIOS="/usr/local" ## Configuration directory NAGIOS_ETC="/usr/local/etc/nagios/" ## Plugins directory NAGIOS_PLUGIN="/usr/local/libexec/nagios" ## Images (logos) directory NAGIOS_IMG="/usr/local/www/nagios/images/logos" ## The nagios binary (optional) #NAGIOS_BINARY="/usr/local/bin/nagios" ## The nagiostats binary (optional) #NAGIOSTATS_BINARY="" ## Logging directory NAGIOS_VAR="/var/spool/nagios/" ## Nagios user (optional) NAGIOS_USER="nagios" ## Nagios group (optional) NAGIOS_GROUP="nagios" ##################################################################### ## End: Nagios preferences ##################################################################### ##################################################################### ## Begin: Apache preferences ##################################################################### ## Apache configuration directory (optional) #DIR_APACHE="/usr/local/etc/apache20" ## Apache local specific configuration directory (optional) #DIR_APACHE_CONF="/etc/apache/conf.d" ## Apache configuration file. Only file name. (optional) #APACHE_CONF="apache.conf" ## Apache user (optional) WEB_USER="www" ## Apache group (optional) WEB_GROUP="www" ## Force apache reload (optional): set APACHE_RELOAD to 1 #APACHE_RELOAD=0 ##################################################################### ## End: Apache preferences ##################################################################### ##################################################################### ## Begin: Other binary ##################################################################### ## RRDTOOL (optional) #BIN_RRDTOOL="/usr/bin/rrdtool" ## Mail (optional) #BIN_MAIL="/bin/mail" ## SSH (optional) #BIN_SSH="/usr/bin/ssh" ## SCP (optional) #BIN_SCP="/usr/bin/scp" ## PHP (optional) #PHP_BIN="/usr/bin/php" #PHP_BIN="/usr/bin/php" ## GREP (optional) #GREP="" ## CAT (optional) #CAT="" ## SED (optional) GSED="/usr/local/bin/gsed" ## CHMOD (optional) #CHMOD="" ## CHOWN (optional) #CHOWN ##################################################################### ## End: Other binary ##################################################################### ##################################################################### ## Begin: Others ##################################################################### ## Perl path for RRDs.pm file RRD_PERL="/usr/local/lib/perl5/site_perl/5.10.1/mach/" ## Path to sudoers file (optional) SUDO_FILE="/usr/local/etc/sudoers" ## Apache user (optional) WEB_USER="www" ## Apache group (optional) WEB_GROUP="www" ## init script directory (optional) INIT_D="/usr/local/etc/rc.d" ## cron config script directory (optional) CRON_D="/usr/local/etc/cron.d" ## Path for PEAR.php file PEAR_PATH="/usr/local/share/pear/" ##################################################################### ## End: Others ##################################################################### |
Agora vamos executar o comando de compilação e instalação do Centreon:
1 2 3 4 5 6 7 8 9 10 | # cd ../.. # bash ./install.sh -f tmpl/vardistrib/freebsd Do you want me to configure your sudo ? (WARNING) [y/n], default to [n]: > y Do you want to reload your Apache ? [y/n], default to [n]: > n |
Feito isso vamos reiniciar o Apache e o MYSQL com o seguinte comando:
1 2 | # /usr/local/etc/rc.d/apache22 restart # /usr/local/etc/rc.d/mysql-server restart |
Vamos acertar uma permissão não realizada:
1 | # chown -R www:www /usr/local/etc/centreon/ |
Vamos agora testar o Centreon. Use um browser para conectar a:
1 | # http:// "ip_do_servidor"/centreon |
20- Configurando o Centreon
Siga as etapas a seguir para a configuração do Centreon:
Agora precisamos exportar os arquivos de configuração para que nosso NDO-Utils possa funcionar:
Acesse a guia Configuration
Agora Nagios
Marque todas as opções e clique em Export
Feito isso, podemos inicializar o NDO:
1 | # ee /etc/rc.conf |
Adicionando ao final do arquivo as linhas abaixo, depois salve o arquivo e saia:
1 2 | # NDO2DB ndo2db_enable="YES" |
Agora vamos iniciar o MySQL com o seguinte comando:
1 | # /usr/local/etc/rc.d/ndo2db start |
Agora, vamos iniciar os processos do Centreon:
1 2 3 | # pw user mod nagios -s /bin/sh # /usr/local/etc/rc.d/centcore start # /usr/local/etc/rc.d/centstorage start |
Vamos acertar um path dentro do SUDO:
1 | # perl -p -i -e 's/\/etc\/init\.d\/nagios/\/usr\/local\/etc\/rc\.d\/nagios/g' /usr/local/etc/sudoers |
Acertar a parte da CRON para o FreeBSD:
1 | # cat /usr/local/etc/cron.d/* >> /etc/crontab |
Reiniciar o CRON
1 | # /etc/rc.d/cron restart |
E agora o Nagios:
1 | # /usr/local/etc/rc.d/nagios restart |
21- Referências
www.fug.com.br
www.bsdux.com.br
http://www.fug.com.br/content/view/505/60/
http://nagios.sourceforge.net/docs/3_0/quickstart.html
http://www.nagiosbook.org/PRE-RELEASE_The_Nagios_Book-05012006.pdf
http://ws.edu.isoc.org/workshops/2008/apricot2008/netmanage/presos/nagios/
http://www.luizgustavo.pro.br/blog/2010/02/15/centreon-2-1-4-no-freebsd/
http://wiki.monitoring-fr.org/powered/centreon/start
http://en.doc.centreon.com/CentreonArchitecture
http://silverwraith.com/papers/freebsd-snmp.php
http://www.remontti.com.br/blog/archives/648
http://dev.mysql.com/doc/refman/5.5/en/freebsd.html
http://www.fug.com.br/content/view/360/77/
http://tuxtraining.com/2009/04/22/how-to-setup-a-famp-freebsd-apache-mysql-php-server
http://www.georgemendonca.com.br/middlecore-introducao-ao-desenvolvimento-de-a
Nenhum comentário:
Postar um comentário