Chinaunix首页 | 论坛 | 博客
  • 博客访问: 72903
  • 博文数量: 14
  • 博客积分: 1536
  • 博客等级: 上尉
  • 技术积分: 135
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 16:21
文章分类
文章存档

2012年(1)

2011年(4)

2010年(2)

2008年(7)

分类: 系统运维

2008-04-11 09:55:18

--mysql
tar zxvf mysql-5.0.37.tar.gz
cd mysql-5.0.37
more INSTALL-SOURCE
groupadd mysql
useradd -g mysql mysql
passwd mysql
./configure --prefix=/usr/local/mysql --with-charset=gbk --with-extra-charsets=gb2312,latin1,utf8 --enable-largefile --with-big-tables --localstatedir=/usr/local/mysql/data --without-debug --with-max-indexes=64 --without-ndbcluster
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cp /root/mysql-5.0.37/support-files/mysql.server /usr/local/mysql/mysql
chmod +x /usr/local/mysql/mysql
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R root  .
chown -R mysql .
chgrp -R mysql .
chown mysql.mysql -R data
bin/mysqld_safe --user=mysql &
./bin/mysqladmin -u root password 111111
/usr/local/mysql/mysql restart
/usr/local/mysql/bin/mysql -uroot -p111111   登入mysql控制台看看是不是正常

--apache
emerge gd
emerge jpeg
emerge zlib
emerge libpng
emerge freetype
tar zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/httpd --enable-so --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr -with-zlib-dir=/usr --with-freetype-dir=/usr
make
make install
/usr/local/httpd/bin/apachectl start 如果没起来,看看日志:
more /usr/local/httpd/logs/error_log,
 /usr/local/httpd/bin/apachectl start  试试,应该就能访问了: 了
cd..

--PHP
emerge dev-libs/libxml
emerge dev-libs/libxml2
emerge curl
emerge mm
tar zxvf php-5.2.1.tar.gz
cd php-5.2.1
./configure --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr -with-zlib-dir=/usr --with-freetype-dir=/usr --enable-sockets
 
'./configure' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-mod_charset' '--enable-cli' '--enable-safe-mode' '--enable-sigchild' '--enable-magic-quotes' '--enable-rpath' '--enable-short-tags' '--enable-libgcc' '--enable-versioning' '--enable-ipv6' '--with-pcre-regex' '--with-zlib' '--with-bz2' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dba' '--with-curl' '--enable-dio' '--with-regex' '--enable-zend-multibyte' '--enable-zend-memory-manager' '--enable-memory-limit' '--enable-inline-optimization' '--enable-xml' '--enable-wddx' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-sockets' '--with-mm' '--enable-shmop' '--enable-session' '--with-qtdom' '--enable-pcntl' '--with-ncurses' '--with-mysql' '--with-mcrypt' '--enable-mbstring' '--enable-mbregex' '--enable-java' '--with-iconv' '--with-gd' '--enable-ftp' '--with-dom' '--with-mod_charset' '--with-libmbfl'
 
'--with-readline' '--with-libedit'  '--with-mime-magic'
Extract the distribution tarball.
shell> tar xzvf cacti-version.tar.gz
Create the MySQL database:
shell> mysqladmin --user=root create cacti
Import the default cacti database:
shell> mysql cacti < cacti.sql
Optional: Create a MySQL username and password for Cacti.
shell> mysql --user=root mysql
mysql> GRANT ALL ON cacti.* TO IDENTIFIED BY 'somepassword';
mysql> flush privileges;
Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration.
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cacti";
Set the appropriate permissions on cacti's directories for graph/log generation. You should execute these commands from inside cacti's directory to change the permissions.
shell> chown -R cactiuser rra/ log/
(Enter a valid username for cactiuser, this user will also be used in the next step for data gathering.)
Add a line to your /etc/crontab file similar to:
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1
Replace cactiuser with the valid user specified in the previous step.
Replace /var/www/html/cacti/ with your full Cacti path.
Point your web browser to:
Log in the with a username/password of admin. You will be required to change this password immediately. Make sure to fill in all of the path variables carefully and correctly on the following screen.
 
下载rrdtool,及cactid,放到cacti目录下
打开默认的/etc/snmp/snmp.conf文件,更改如下配置:
1、查找以下字段:
[Copy to clipboard] [ - ]CODE:
#       sec.name  source          community
com2sec notConfigUser  default       public
将"comunity"字段改为你要设置的密码.比如"public".                                   
将“default”改为你想哪台机器可以看到你的snmp信息,如10.10.10.10。
3、查找以下字段:
[Copy to clipboard] [ - ]CODE:
####
# Finally, grant the group read-only access to the systemview view.
#       group          context sec.model sec.level prefix read   write  notif
access  notConfigGroup ""      any       noauth    exact  mib2 none none
将"read"字段改为mib2.
[Copy to clipboard] [ - ]CODE:
#access  notConfigGroup ""      any       noauth    exact  systemview none none
3、查找以下字段:
[Copy to clipboard] [ - ]CODE:
## -or just the mib2 tree-
view mib2   included  .iso.org.dod.internet.mgmt.mib-2 fc 
将该行前面的"#"去掉.
保存关闭.
4、运行/etc/init.d/snmpd start命令运行snmpd.
最后运行netstat -ln查看161端口是否打开了.
二、FreeBSD
如果使用port安装net-snmp,默认的配置文件应该是在/usr/local/share/snmp/snmpd.conf(没有默认的文件)。
可以建立一个简单的配置文件,如:
[Copy to clipboard] [ - ]CODE:
syslocation  YourDefineName
syscontact  YourEmailAddress
sysservices 77
rocommunity  public  (请更改)
load  12 12 12
然后运行snmpd,netstat 看是否打开了161端口。
上述用法只针对默认的安装,如果你是自定义的安装请依照你的安装目录来设置。
 
 
阅读(1730) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~