歡迎你
各類文章如有侵犯智慧財產權請來信告知--------607@dlps.tp.edu.tw
freebsd7.0軟體安裝
作者:tseng 日期:2009-05-08
沒有的話使用 /stand/sysinstall 來安裝 ports 的目錄
以 root 執行 /stand/sysinstall
選擇 Configure 後按 Enter
選擇 Distributions 後按 Enter
選擇 ports 後按空白鍵
選擇 Exit 後按 Enter
選擇你要從 CDROM 或 FTP 安裝等
跟著選單照做,最後離開 sysinstall
2、cd /usr/ports/net/cvsup-without-gui
make install clean
cp /usr/share/examples/cvsup/ports-supfile /root/
cvsup -g -L 2 /root/ports-supfile
nagios
作者:tseng 日期:2009-05-01
Gcc編譯器 yum install gcc
Glibc函式庫 yum install glibc glibc-common
GD函式庫 yum install gd gd-devel
yum install nagios nagios-plugins-all nrpe
下載Nagios及其Plugins,目前最新穩定版本分別為3.0.6與1.4.13
為了讓Nagios伺服器可以監看遠端Linux主機,需要額外安裝NRPE套件
測試設定檔無誤
nagios -v /etc/nagios/nagios.cfg
啟動 nagios
service nagios start
查看狀態
nagiostats
Web 界面
vi /etc/httpd/conf.d/nagios.conf
ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi"
<Directory "/usr/lib/nagios/cgi">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
order allow,deny
Allow from all
# order deny,allow
# Deny from all
Allow from 127.0.0.1 192.168.1.0/24
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd
Require valid-user
</Directory>
Alias /nagios "/usr/share/nagios"
<Directory "/usr/share/nagios&...
Tags: nagios安裝
big5------>utf-8
作者:tseng 日期:2009-05-01
ostube---->fiv
作者:tseng 日期:2009-04-28
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
tar jxvf all-20071007.tar.bz2
mkdir -p /usr/local/lib/codecs
cd all-20071007
cp -f *.* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/
ls -l /usr/local/lib/codecs/
ln -sf /usr/local/lib/codecs /usr/lib/codecs
ln -sf /usr/local/lib/codecs /usr/local/lib/win32
ln -sf /usr/local/lib/codecs /usr/lib/win32
cd /usr/local/src
ldconfig
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd mplayer
make clean && make distclean
./configure --prefix=/usr --codecsdir=/usr/local/lib/codecs/
make && make install
yum使用
作者:tseng 日期:2009-04-26
安裝:yum install xxx
移除:yum remove xxx
清除已經安裝過的檔案(/var/cache/yum/):yum clean all
搜尋:yum search xxx
列出所有檔案:yum list
查詢檔案訊息:yum info xxx
yum grouplist
yum groupinstall "Web Server"
yum check-update;yum -y update;yum clean all
另外,我們在安裝一些要用到的一些工具時,或許它並不存在於 CentOS yum 的官方資料庫中。所以我們還要另外定義非官方資料庫文件,讓一些實用的工具也能透過 yum 來安裝。
# vi /etc/yum.repos.d/dag.repo
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
匯入非官方資料庫的GPG
# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
一、強化yum功能
yum install yum-fastestmirror(加快yum下載速度)
yum install yum-priorities
vi /etc/yum/pluginconf.d/priorities.conf
在 [main]下新增enabled=1 (預設已寫上)
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
vim /etc/yum.repos.d/CentOS-Base.repo
在[base], [addons], [updates], [extras]項目下新增 priority=1
在[centosplus],[contrib]項目下新增 priority=2
/etc/init.d/yum-updatesd restart
二、下載相關套件並安裝(請自行對應)
i386 wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64 wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
安裝金鑰
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt (備份檔案)
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i38...
ostube
作者:tseng 日期:2009-04-26
yum install httpd mysql php php-mysql php-gd php-mbstring gd libjpeg-devel gcc
yum -y install subversion
yum install ruby ruby-libs
FLVTool2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
tar zxvf flvtool2-1.0.6.tgz
cd flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
Mplayer Source Code
# wget ftp://ftp4.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2
# tar xvjf MPlayer-1.0rc2.tar.bz2
# cd MPlayer-1.0rc2
# ./configure --prefix=/usr
# make;make install
2修改參數
memory_limit > post_max_size > upload_max_filesize
php.ini
upload_max_filesiz=100M
post_max_size:110M
/ostube/cgi-bin/uu_default_config.pm
max_upload => 509715200----->1073741824
# cd ostube
# chmod -R 777 templates_c
# chmod -R 777 media
# chmod -R 777 ostube.log
# chmod -R 777 conversion.log
# chmod -R 777 includes/config.php
# cd cgi-bin
# chmod +x *
# cp * /var/www/cgi-bin
3下載ostube
安裝完刪除 /var/www/html/osTube/install 目錄
LAMP
作者:tseng 日期:2009-04-24
yum 修改
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://ftp2.tnc.edu.tw/pub1/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://ftp2.tnc.edu.tw/pub1/centos/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://ftp2.tnc.edu.tw/pub1/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp2.tnc.edu.tw/pub1/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://ftp2.tnc.edu.tw/pub1/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://ftp2.tnc.edu.tw/pub1/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://ftp2.tnc.edu.tw/pub1/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://ftp2.tnc.edu.tw/pub1/centos/RPM-GPG-KEY-CentOS-5
apache-php-mysql
作者:tseng 日期:2009-04-23
修改環境
作者:tseng 日期:2009-04-23
cd /usr/ports/misc/gnuls
make install
修改root環境
vi /root/.cshrc
alias ls 'gnuls -ah --color --show-control-chars'
alias ping 'ping -t 4'
kbdcontrol -r fast
set prompt = "`hostname -s`# "-------->set prompt = "%B%n@%m [%/] # "
修改user環境
vi /etc/csh.cshrc
setenv LC_CTYPE en_US.ISO_8859-1
alias ls 'gnuls -ah --color --show-control-chars'
set prompt = "%B%n@%m [%/] $ "
set autolist
主機規劃
作者:tseng 日期:2009-04-17
電腦當機!!!
作者:tseng 日期:2009-04-14
禁用P2P分享軟體
作者:tseng 日期:2009-04-09
設定snmpd.conf
作者:tseng 日期:2009-03-31
# Here is a commented out example configuration that allows less
# restrictive access.
# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
## sec.name source community
com2sec local localhost public
com2sec mynetwork 192.168.100.0/24 public
# 註﹕請將 192.168.100.0/24 改為您機器目前所在的 network 範圍。
## group.name sec.model sec.name
group MyRWGroup v1 local
group MyROGroup v2c mynetwork
#
#group MyRWGroup any otherv3user
#...
## incl/excl subtree mask
view all included .1 80
## -or just the mib2 tree-
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
## context sec.model sec.level prefix read write notif
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none
cacti install centos5.2
作者:tseng 日期:2009-03-30
httpd-2.2.3-11、php-5.1.6-15、mysql-5.0.22-2.2
cacti-0.8.7b-2、net-snmp-5.3.1-19、rrdtool-1.2.23-1
rpm -ivh cacti-0.8.7b-2.el5.rf.noarch.rpm
rpm -ivh cacti-docs-0.8.7b-2.el5.rf.noarch.rpm
以上套件用rpm或yum安裝
2.安裝與設定 Cacti
mysqladmin -u root -p create cacti
mysql -u root -p -A cacti < /var/www/html/cacti/cacti.sql
編輯 cacti 設定檔
vi /var/www/cacti/include/config.php
修改以下四行
$database_default = "cacti"; //資料庫名稱
$database_hostname = "localhost"; //資料庫位置
$database_username = "cactiuser"; //資料庫使用者名稱
$database_password = "cactiuser"; //資料庫使用者密碼
設定資料庫
mysql> grant all privileges on cacti.* to cactiuser@localhost identified by ‘cactiuser’;
mysql> flush privileges;
mysql> exit
設定apache
vi /etc/httpd/conf.d/cacti.conf
vi /etc/httpd/conf/http.conf
Alias /cacti/ /var/www/cacti/
<Directory /var/www/cacti/>
DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
deny from all
allow from 127.0.0.1
allow from 192.168 <= 追加
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
</Directory>
cacti定期執行
/etc/cron.d/cacti
*/5 * * * * cacti php /var/www/cacti/poller.ph...
錯誤訊息
作者:tseng 日期:2009-03-28
1.
checking for pcap_lookupdev in -lpcap... no
*** FATAL ERROR ***
It looks that you don't have the libpcap distribution installed.
Download, compile and, optionally, install it.
When finished please re-run this program.
You can download the latest source tarball at http://www.tcpdump.org/
configure: error: The LBL Packet Capture Library, libpcap, was not found!
error: Bad exit status from /var/tmp/rpm-tmp.85176 (%build)
ntop安裝用rpm較為簡單,或用YUM
rrdtool
ntop
作者:tseng 日期:2009-03-27
1. yum install cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-deve libpcap-devel
2.install RRDtool
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.5.tar.gz
3.Install Ntop
cd /usr/local/src/
tar -zxvf ntop-3.3.9.tar.gz
cd ntop-3.3.9
./autogen.sh --prefix=/usr/local/ntop-3.3.9
make
make installuseradd -M -s /sbin/nologin -r ntop
chown -R ntop.ntop /usr/local/ntop-3.3.9/share/ntop
cd /usr/local/
ln -s ntop-3.3.9 ntop
4.Start Ntop
簡易版本
samba
作者:tseng 日期:2009-03-13
[global]
dos charset = cp950
unix charset = utf8
display charset = utf8
workgroup = CC1
server string = Samba %v
passdb backend = tdbsam
log file = /var/log/samba/%m.log
max log size = 50
cups options = raw
[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0664
directory mask = 0775
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
[public]
comment = Public Stuff
path = /home/public
valid users = @users
read only = No
guest ok = Yes