Вы находитесь на странице: 1из 11

Apagar usurio #userdel -r nome_do_usuario Apagar grupo groupdel nome_do_grupo Lista usurios criados no final do arquivo grep "nome_do_usuario"

/etc/passwd pode usar cat ou less para ver o arquivo Lista grupos criados no final do arquivo less /etc/group

[root@genius /]# groupadd mysql [root@genius /]# useradd -g mysql -s /bin/false -mk /dev/null mysql

[root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius [root@genius

src]# tar zxvf /root/mysql-5.0.41.tar.gz src]# cd mysql-5.0.41 mysql-5.0.41]# ./configure --prefix=/usr/local/mysql mysql-5.0.41]# make mysql-5.0.41]# make install mysql-5.0.41]# cp support-files/my-medium.cnf /etc/my.cnf mysql-5.0.41]# cd /usr/local/mysql/ mysql-5.0.41]# chown -R mysql . mysql-5.0.41]# chgrp -R mysql . mysql-5.0.41]# bin/mysql_install_db --user=mysql mysql-5.0.41]# chown -R root . mysql-5.0.41]# chown -R mysql var/ mysql-5.0.41]# bin/mysqld_safe --user=mysql &

cp support-files/my-medium.cnf /etc/my.cnf cd /usr/local/mysql chown -R mysql . chgrp -R mysql . bin/mysql_install_db --user=mysql chown -R root . chown -R mysql var bin/mysqld_safe --user=mysql &

[root@genius mysql]# cd /usr/local/mysql/share/mysql/ [root@genius mysql]# cp my-medium.cnf /etc/my.cnf [root@genius mysql]# vi /etc/my.cnf

# The MySQL server [mysqld] port socket

= 3306 = /tmp/mysql.sock

skip-locking key_buffer max_allowed_packet table_cache sort_buffer_size net_buffer_length read_buffer_size read_rnd_buffer_size myisam_sort_buffer_size log

= = = = = = = = =

16M 1M 64 512K 8K 256K 512K 8M /var/log/mysql/mysqld.log

[root@genius ~]# mkdir /var/log/mysql [root@genius ~]# touch /var/log/mysql/mysqld.log [root@genius ~]# chown -R mysql /var/log/mysql/

[root@genius ~]# cd /usr/local/src/mysql-5.1.54/ [root@genius mysql-5.0.41]# cp support-files/mysql.server /etc/init.d/mysqld [root@genius mysql-5.0.41]# chmod 755 /etc/init.d/mysqld

/usr/local/mysql/bin

[root@genius ~]# vi /etc/profile Para dar um reload no PATH $ source ~/.profile $ source /etc/profile

# Path manipulation if [ "$EUID" = "0" ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin pathmunge /usr/local/mysql/bin pathmunge /etc/apache/bin fi # No core files by default ulimit -S -c 0 > /dev/null 2>&1 if [ -x /usr/bin/id ]; then USER="`id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER"

fi HOSTNAME=`/bin/hostname` HISTSIZE=1000 MYSQL=/usr/local/mysql/bin APACHE=/etc/apache/bin if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then INPUTRC=/etc/inputrc fi export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC MYSQL APACHE

[root@genius ~]# ln -s /usr/local/mysql/lib/mysql/* /usr/lib [root@genius ~]# ldconfig [root@genius init.d]# service mysqld start [root@genius init.d]# mysqladmin -u root password 'sptsap1' chkconfig --add mysqld chkconfig --level 345 mysqld on

------------------------------------------------------------------------------------[root@genius /]# groupadd www-data [root@genius /]# useradd -g www-data -s /bin/false -mk /dev/null www-data [root@genius /]# cd /usr/local/src/ [root@genius src]# tar zxvf /root/apache-1.3.37.tar.gz [root@genius src]# cd apache_1.3.37

[root@genius apache_1.3.37]# ./configure --prefix=/etc/apache \ > --htdocsdir=/var/www \ --with-port=80 \ > --sysconfdir=/etc/httpd/conf \ > --cgidir=/usr/lib/cgi-bin \ > --logfiledir=/var/log/apache \ > --enable-module=so \ > --enable-module=rewrite \ > --enable-shared=rewrite \ > --server-uid=www-data \ > --server-gid=www-data ./configure --prefix=/etc/apache --htmldir=/var/www --sysconfdir=/etc/apache --e nable-cgi --logfiledir=/var/log/apache --enable-module=so --enable-module=rewrit e --enable-shared=rewrite --server-uid=www-data --server-gid=www-data

-------------------------------------------------------------------------------[root@genius httpd-2.0.64]# ./configure --prefix=/etc/apache \ > --with-port=80 \ > --sysconfdir=/etc/httpd/conf \ > --enable-cgi \ > --enable-so \ > --enable-rewrite \ > --enable-ssl \ > --enable-actions \ > --enable-alias \ > --enable-autoindex \ > --enable-dir \ > --enable-env \ > --enable-mime \ > --enable-setenvif \ > --enable-expires \ > --enable-status \ > --enable-negotiation \ > --enable-deflate \ > --enable-headers

[root@genius apache_1.3.37]# make [root@genius apache_1.3.37]# make install [root@genius /]# cd etc/apache/bin/ [root@genius bin]# cp apachectl /etc/init.d/apached [root@genius bin]# chmod 755 /etc/init.d/apached pathmunge /etc/apache/bin APACHE=/etc/apache/bin export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC MYSQL APACHE [root@genius ~]# httpd -v Server version: Apache/1.3.37 (Unix) Server built: Jul 29 2011 21:55:35 [root@genius init.d]# service apached start /etc/init.d/apached start: httpd started --------------------------------------------------------------------------[root@genius /]# cd /usr/local/src [root@genius src]# tar -zxvf /root/php-5.2.17.tar.gz [root@genius src]# cd php-5.2.17/

[root@genius php-5.2.17]# ./configure -with-mysql=/usr/local/mysql \ -with-apxs2=/etc/apache/bin/apxs \ -enable-inline-optimization \ -with-gd \ -with-gdbm=/usr/include \ -with-gettext=/usr/lib \ -with-libxml-dir=/usr/lib \

-with-jpeg-dir=/usr/lib \ -with-png-dir=/usr/lib \ -with-zlib-dir=/usr/lib \ -with-xpm-dir=/usr/lib \ -with-freetype-dir=/usr/lib Arquivos gerados apos a instalao Generating files updating cache ./config.cache creating ./config.status creating php5.spec creating main/build-defs.h creating scripts/phpize creating scripts/man1/phpize.1 creating scripts/php-config creating scripts/man1/php-config.1 creating sapi/cli/php.1 creating main/php_config.h creating main/internal_functions.c creating main/internal_functions_cli.c [root@genius php-5.1.4]# make install Installing PHP SAPI module: apache [activating module `php5' in /etc/apache/httpd.conf] cp libs/libphp5.so /etc/apache/libexec/libphp5.so chmod 755 /etc/apache/libexec/libphp5.so cp /etc/apache/httpd.conf /etc/apache/httpd.conf.bak cp /etc/apache/httpd.conf.new /etc/apache/httpd.conf rm /etc/apache/httpd.conf.new Installing PHP CLI binary: /usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing build environment: /usr/local/lib/php/build/ Installing header files: /usr/local/include/php/ Installing helper programs: /usr/local/bin/ program: phpize program: php-config Installing man pages: /usr/local/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/lib/php/ [PEAR] Archive_Tar - already installed: 1.3.7 [PEAR] Console_Getopt - already installed: 1.2.3 [PEAR] PEAR - already installed: 1.9.1 Wrote PEAR system config file at: /usr/local/etc/pear.conf You may want to add: /usr/local/lib/php to your php.ini include_path Installing PDO headers: /usr/local/include/php/ext/pdo/

[root@genius php-5.2.17]# cp php.ini-dist /usr/local/lib/php.ini [root@genius php-5.2.17]# vi /usr/local/lib/php.ini Trecho do arquivo: Inicio ; Log errors into a log file (server-specific log, stderr, or error_log (below)) ; As stated above, you're strongly advised to use error logging in place of

; error displaying on production web sites. log_errors = on ; Log errors to specified file. ;error_log = /var/log/apache/php_error.log Trecho do arquivo: Fim [root@genius /]# chown -R root.www-data /usr/local/lib/php [root@genius /]# chmod -R g+w,o+rwx /usr/local/lib/php [root@genius /]# vi /etc/apache/httpd.conf

LoadModule php5_module AddModule mod_php5.c

libexec/libphp5.so

#Ativa o Suporte ao WebServer Apache AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps drwxr-xr-x 2 root root 4096 Jul 30 21:10 libexec

//////// A pgina 94 eu pulei no decidi o momento de colocar o procedimento dos ar quivos useradd -g www-data -s /bin/false -mk /dev/null www-data ------------------------------------------------------------------------[root@localhost [root@localhost [root@localhost [root@localhost [root@localhost [root@localhost ~]# cd /usr/local/src/ src]# tar -zxvf /root/phpMyAdmin-3.4.3.2-all-languages.tar.gz src]# mv phpMyAdmin-3.4.3.2-all-languages/ phpmyadmin src]# cp -R phpmyadmin /var/www/ src]# cd /var/www/phpmyadmin/ phpmyadmin]# chown -R www-data.www-data *

Update phpMyAdmin config.inc from Wizard You need to setup the config.inc file properly for phpMyAdmin to work. You can e ither create and edit this file manually, or use the config phpMyAdmin installer setup wizard. I recommend that you use the setup wizard, as it is very straight forward. To do that, you should create the following dummy config.inc with prop er permission. # cd /var/www/phpmyadmin/ # mkdir config chown -R www-data.www-data config # chmod 775 config

# cp config.sample.inc.php config/config.inc.php # chmod o+w config/config.inc.phpNow, invoke the phpMyAdmin setup wizard from th e browser using the URL: http://{your-ip-address}/phpmyadmin/setup/index.php . T his will show the following setup wizard.

Para configurar http://192.168.1.30/phpmyadmin/setup/index.php # The index.html.var file (a type-map) is used to deliver content# negotiated documents. The MultiViews Option can be used for the # same purpose, but it is much slower. # DirectoryIndex index.html index.html.var index.php ai no precisa digitar o endereo interito s isso aqui. http://192.168.1.30/phpmyadmin ----------------------------------------------------------------Monografia\Pacotes\nova Instalao do nagios [root@genius /]# groupadd nagios [root@genius /]# useradd -g nagios -s /bin/false -mk /home/nagios nagios Adicionando uma senha ao usurio nagios #passwd nagios Adicionando usurio apache ao grupo nagcmd #usermod -G nagcmd www-data [root@localhost ~]# cd /usr/local/src/ [root@localhost src]# tar -zxvf /root/nagios-3.3.1.tar.gz [root@localhost nagios]# ./configure -prefix=/usr/local/nagios \ --with-cgiurl=/nagios/cgi-bin \ --with-htmlurl=/nagios \ --with-nagios-user=nagios \ --with-nagios-group=nagios \ --with-command-group=nagcmd [root@localhost [root@localhost [root@localhost [root@localhost [root@localhost nagios]# nagios]# nagios]# nagios]# nagios]# make make make make make all install install-init install-commandmode install-config

vi /etc/httpd/conf/httpd.conf

############################################################################### # HTML (http://localhost/nagios) AND CGI APACHE AUTHENTICATION ############################################################################### ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" <Directory "/usr/local/nagios/sbin"> AllowOverride AuthConfig Options ExecCGI Order allow,deny Allow from all AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user </Directory> Alias /nagios "/usr/local/nagios/share" <Directory "/usr/local/nagios/share"> AllowOverride AuthConfig Options None Order allow,deny Allow from all AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user </Directory> ############################################################################### [root@localhost nagios]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagios admin ###############################################################################

Mudar a visualizao da pgina inicial do Nagioscd As verses do Ngios disponveis vem com a pgina inicial de navegao em ingls, caso o us queira passar para o portugus, basta editar os arquivos: /usr/local/nagios/share/side.html /usr/local/nagios/share/main.html Modifique os termos em ingls para o portugus. Onde side.html a tela lateral de nav egao e main.html a tela principal. Servios >Documenta&ccedil;&atilde;o ./check_nt -H 192.168.1.40 -p 1248 -v SERVICESTATE -d SHOWALL -l LanmanServer,Sc hedule ./check_nt -H 192.168.1.40 -p 1248 -v MEMUSE -w 80 -c 90 ./check_nt -H 192.168.1.40 -p 1248 -v USEDDISKSPACE -l C -w 80 -c 90 ---------------------------------------------------------------------Nagios plugins ./configure --prefix=/usr/local/nagios \

--with-nagios-user=nagios \ --with-nagios-group=nagios ----------------------------------------------------------------------Nagios NSClient++ Para testar ./check_nt -H 192.168.1.40 -p 1248 -v USEDDISKSPACE -l C -w 80 -c 90 ------------------------------------------------------------------define service{ use host_name service_description check_command } generic-service winserver NSClient++ Version check_nt!CLIENTVERSION

'Whats New' section to find out what has changed. [root@localhost objects]# vi /usr/local/nagios/etc/objects/servers/linux/service s.cfg define service{ use generic-service host_name servermonitor service_description SSH is_volatile 0 check_period 24x7 max_check_attempts 4 normal_check_interval 5 retry_check_interval 1 contact_groups admins notification_options w,u,c,r notification_interval 960 notification_period 24x7 check_command check_ssh } cfg_dir=/usr/local/nagios/etc/objects/printers cfg_dir=/usr/local/nagios/etc/objects/switches cfg_dir=/usr/local/nagios/etc/objects/routers cfg_dir=/usr/local/nagios/etc/objects/cameras Testar arquivos de configuraes debugar /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg -----------------------------------------------------------Instalao do nagiosQL [root@localhost src]# tar -xvzf /root/nagiosql_311.tar.gz

[root@localhost src]# pear install HTML_Template_IT [root@localhost nagiosql]# cp -r nagiosql/ /var/www/ shell# shell# shell# shell# shell# shell# mkdir mkdir mkdir mkdir mkdir mkdir /etc/nagiosql /etc/nagiosql/hosts /etc/nagiosql/services /etc/nagiosql/backup /etc/nagiosql/backup/hosts /etc/nagiosql/backup/services

[root@localhost etc]# chown -R www-data.nagios nagiosql/ :q [root@localhost etc]# chmod -R 6755 nagiosql/

php -m shows that everything is loaded: [PHP Modules] date gd gettext libxml mysql pcre Reflection session standard xml

Mdulo php5-gd apt-get install php5-gd Os mdulos php5-gettext, php5-mbstring, php5-session e php5-json fazem parte do pa cote php5-common apt-get install php5-common Mdulo pdo_sqlite apt-get install php5-sqlite Se est tentando instalar o Nagvis, instale tambm: mk-livestatus (vide documentao oficial do nagvis. L diz como instalar) php-pear php-net-socket php5-dev graphviz

Dynamic Extensions

tive que compilar tudo novamente do php para que o modulo gettext fosse adiciona do [root@localhost php-5.2.17]# ./configure -with-mysql=/usr/local/mysql -with-apxs 2=/etc/apache/bin/apxs -enable-inline-optimization -with-gd -with-gdbm=/usr/incl ude -with-gettext=/usr/lib -with-libxml-dir=/usr/lib -with-jpeg-dir=/usr/lib -wi th-png-dir=/usr/lib -with-zlib-dir=/usr/lib -with-xpm-dir=/usr/lib -with-freetyp e-dir=/usr/lib para confirir s usar o comando

php -m

Verifica as nao conformidades ldd -r /etc/apache/modules/libphp5.so

Вам также может понравиться