Cacti+nagios Monitoring System (i): preparatory work

Source: Internet
Author: User
Tags ftp file ftp file transfer

First, the system environment

1. Set Yum source

(1) using local source

Mount the optical drive ISO file

Confirm Path/media/centos_6.5_final/

CD/ETC/YUM.REPOS.D

MV Centos-base.repo Centos-base.repo.bak

VI Centos-base.repo

[Base]

Name=base
baseurl=file:///media/centos_6.5_final/
Gpgcheck=0

# (1 Detection 0 not detected)
Enabled=1

# (1 Boot 0 does not start)

(2) Use 163 of the source

CD/ETC/YUM.REPOS.D

wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo

MV Centos-base.repo CENTOS-BASE.REPO.BAK2

MV Centos6-base-163.repo Centos-base.repo

(3) Update list

Yum Clean All

Yum List

2. Install the graphical interface

To see if the components of the desktop environment are installed

Yum grouplist | more

Yum groupinstall-y "desktop" "Desktop Platform" "Desktop Platform Development" "Fonts" "General Purpose Desktop" "Graphical administration Tools" "Graphics Creation Tools" "Input Methods" "X Window System" "Chinese support [zh]" " Internet Browser "

Vi/etc/inittab

Modify the start level to 5

Reboot Restart

3. Set up and enable the NIC

ifconfig-a

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Set the network card static IP address, automatically start to on

ifup eth0

echo "NameServer 202.101.224.68" >>/etc/resolv.conf

4. Configure VNC Remote Desktop

Yum install-y tigervnc-server

Vncserver:1

Password 123456

Vi/root/.vnc/xstartup

Unset Session_manager
Exec/etc/x11/xinit/xinitrc
#twm &
Gnome-session

vncserver-kill:1

Vncserver:1

set up auto-start

vi/etc/sysconfig/vncservers

Vncservers= "1:user1"
vncserverargs[1]= "-geometry 800x600-alwaysshared"

chkconfig vncserver on

5. Turn off SELinux

Vi/etc/selinux/config

selinux=disabled

Restart the server to

Do not want to restart executable Setenforce 0

6, Ntpupdate synchronization time

crontab-e

Ten * * * */usr/sbin/ntpdate-s 65.55.56.206

Service Crond Restart

Ntpdate 65.55.56.206

7. Setup Self-starter

Configure system auto-start items

httpd mysqld snmpd nagios vncserver Network

8. ftp File Transfer

Yum install-y vsftpd

Vi/etc/vsftpd/vsftpd.conf

Anonymous_enable=no #禁止匿名访问
Userlist_deny=no # (manually added) using the FTP user table

Useradd Ywzhou

passwd Ywzhou

123456

vi/etc/vsftpd/user_list

Ywzhou

/etc/init.d/vsftpd Start

Chkconfig vsftpd on

9. Firewall

iptables-i input-p tcp--dports 21,80,5901-j ACCEPT

Service Iptables Save

Or

Vi/etc/sysconfig/iptables

-A Input-p TCP--dport 21-j ACCEPT

-A Input-p TCP--dport 80-j ACCEPT

-A Input-p TCP--dport 5901-j ACCEPT

Service iptables Restart

Second, the compilation environment

1. Installing GCC

Yum Install gcc

2, Installation glibc

Yum Install glibc Glibc-common

3. Installing GD

Yum Install GD gd-devel

4, Installation Pcap

Yum Install libtool libpcap libpcap-devel gdbm gdbm-devel zlib zlib-devel

Note: When using the local Yum source installation, individual packages do not have to be replaced with 163 source online installation.

Second, lamp environment

1. Installing Apache

Yum install-y httpd

vi/etc/httpd/conf/httpd.conf

DirectoryIndex index.php index.html
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps

Service httpd Start

Chkconfig httpd on

Vi/etc/sysconfig/iptables

-A input-p tcp--dport 80-j ACCEPT

Service iptables Restart

2. Install PHP

Yum install-y php php-mysql php-devel php-snmp php-gd

vim/var/www/html/index.php

<?php phpinfo ();?>

http://localhost

3. Install MySQL

yum install-y MySQL mysql-server mysql-devel

Service mysqld Start

Chkconfig mysqld on

mysqladmin-u root password ' 123456 '

A power outage caused mysqld to fail to start the problem:

Service MySQL Restart

Another MySQL daemon already running with the same UNIX socket

Mv/var/lib/mysql/mysql.sock/var/lib/mysql/mysql.sock.bak

Service mysqld Restart


This article is from the "Moon Ching Xing Fei" blog, please be sure to keep this source http://ywzhou.blog.51cto.com/2785388/1531480

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.