CentOS 4.2 ServerCD 安裝 ← 後面將透過 yum update 升級至 CentOS 4 的最新版
1)
Language Selection : Chinese(Traditional) 繁體中文
鍵盤設定 : 美式英文
安裝類型 : 伺服器(S)
選擇磁碟分割方式 : 自動分割磁碟(A)
網路設定 :
開機時立即啟動 [v]
指定 IP/netmask
防火牆設定 :
啟用防火牆(E)
[v] 遠端登入(SSH)
[v] 網頁伺服器 (HTTP, HTTPS)
啟用 SELinux
警告(安裝之後如果要更改 SELinux 的設定, 可編輯 /etc/selinux/config 然後 reboot 讓設定生效)
時區選擇 : 亞洲/台北
選擇最小化安裝
安裝完成後會自動退出 CD, 然後重新啟動進入 CentOS
啟用 SELinux : 警告 並非預設值, 所以常常會出現這部份沒設正確的狀況!!!
建立備援 root 帳號(Exp. misadm)
建立登入帳號 (Exp. jonathan)
網路可否正常運作 (ssh 到外部主機, 然後再 ssh 回來)
使用 root 身分登入主機
安裝 yum 更新套件
使用 yum 更新到最新版本
重新啟動電腦讓新版的 kernel 生效
實際執行語法
export LANG=C
yum install -y yum-plugin-fastestmirror
yum -y update
sync
sync
sync
reboot
如果之後要直接升級成 CentOS 5 記得
先將 yum-plugin-fastestmirror 移除
rpm -e yum-plugin-fastestmirror
如果安裝 32bit 版本, 雖然主機記憶體安裝超過 4G, 實際抓到記憶體會出現大概 3G 多..
所以必須安裝 kernel-PAE 的 Kernel 版本 (就是之前的 kernel-hugemem)
yum install kernel-PAE
安裝之後, 再更改 /etc/grub.conf 內的開機預設版本 default 值. Exp.
:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-53.1.14.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.1.14.el5PAE ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.1.14.el5PAE.img
title CentOS (2.6.18-53.1.14.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.1.14.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-53.1.14.el5.img
title CentOS (2.6.18-53.el5)
:
yum install -y iptraf sysstat net-snmp mrtg
su - root
cd /etc/snmp
vi snmpd.conf
編輯 snmpd.conf
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.2
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1.3.6.1.2.1.2.2.1
access notConfigGroup "" any noauth exact systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
啟動 snmpd 並設定開機可自動啟動
service snmpd start
chkconfig snmpd on
chkconfig --list | grep snmpd
[root@ed2 snmp]# chkconfig --list | grep snmpd
snmpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
su - root
yum -y install ntp
cd /etc
vi ntp.conf
編輯 ntp.conf
:
:
# --- OUR TIMESERVERS -----
server 210.59.157.30
server tick.stdtime.gov.tw prefer
server mizbeaver.udel.edu prefer
server ntps1-0.cs.tu-berlin.de
server ntps1.pads.ufrj.br
server time1.one4vision.de
server watch.stdtime.gov.tw
server time.stdtime.gov.tw
server tock.stdtime.gov.tw
server clock.stdtime.gov.tw
server 192.43.244.18 # time.nist.gov (ACTS)
server 192.5.41.40 # tick.usno.navy.mil
:
:
第一次網路校時
[root@tryboxap1 etc]# ntpdate -u tick.stdtime.gov.tw
23 Mar 17:22:58 ntpdate[3552]: adjust time server 220.130.158.51 offset -0.225961 sec
[root@tryboxap1 etc]# date
Thu Mar 23 17:23:33 CST 2006
啟動 ntpd
service ntpd start
chkconfig ntpd on
chkconfig --list | grep ntpd
ntpq -p
[root@tryboxap1 etc]# chkconfig --list | grep ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@tryboxap1 etc]# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
210.59.157.30 .INIT. 16 u - 64 0 0.000 0.000 4000.00
220-130-158-51. 220.130.158.50 2 u 30 64 1 16.261 -104.84 0.001
mizbeaver.udel. .GPS. 1 u 29 64 1 228.213 -109.85 0.001
ntps1-0.cs.tu-b .PPS. 1 u 32 64 1 371.710 -142.98 0.001
ns2.pads.ufrj.b .GPS. 1 u 31 64 1 471.069 -166.67 0.001
212-82-32-15.ip .PPS. 1 u 31 64 1 456.025 -158.71 0.001
210.241.22.10 .INIT. 16 u - 64 0 0.000 0.000 4000.00
220-130-158-54. 220.130.158.50 2 u 30 64 1 159.259 -168.66 0.001
220-130-158-52. 220.130.158.50 2 u 29 64 1 161.984 -169.12 0.001
220-130-158-71. 220.130.158.50 2 u 28 64 1 146.384 -164.47 0.001
220-130-158-72. 220.130.158.50 2 u 27 64 1 226.089 -205.19 0.001
time.nist.gov .ACTS. 1 u 25 64 1 577.621 -231.61 0.001
ntp0.usno.navy. .USNO. 1 u 24 64 1 520.448 -175.86 0.001
LOCAL(0) LOCAL(0) 10 l 24 64 1 0.000 0.000 0.001
su - root
yum -y install httpd mod_ssl
依據實際狀況設定 httpd.conf 參數檔
cd /etc/httpd/conf
vi httpd.conf
httpd.conf
:
KeepAlive Off
:
ServerAdmin tryweb@ichiayi.com
:
ServerName tryboxap.ichiayi.com:80
:
DocumentRoot "/var/www/html"
:
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
# Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
:
# End of proxy directives.
<ifmodule mod_deflate.c>
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE js css
</ifmodule>
### Section 3: Virtual Hosts
:
啟動 httpd
設定每次開機自動啟動 httpd
chkconfig httpd on
chkconfig --list | grep httpd
su - root
yum -y install mysql-server mysql-devel
service mysqld start
chkconfig mysqld on
chkconfig --list | grep mysqld
/usr/bin/mysqladmin -u root password 'newpassword'
mysql -u root -p
如果是安裝 CentOS5 x86_64, 可以直接使用 yum 來下載安裝 8.1.xx 的版本
yum install postgresql-server postgresql-devel.x86_64
確認是否有安裝之前版本, 如果有的話要移除
rpm -qa | grep postgresql
結果訊息
[root@ed ~]# rpm -qa | grep postgresql
postgresql-python-7.4.13-2.RHEL4.1
postgresql-odbc-7.3-8.RHEL4.1
postgresql-jdbc-7.4.13-2.RHEL4.1
postgresql-libs-7.4.13-2.RHEL4.1
postgresql-server-7.4.13-2.RHEL4.1
postgresql-pl-7.4.13-2.RHEL4.1
postgresql-7.4.13-2.RHEL4.1
postgresql-tcl-7.4.13-2.RHEL4.1
postgresql-contrib-7.4.13-2.RHEL4.1
postgresql-libs-7.4.13-2.RHEL4.1 因為有其他 rpm 相依性, 所以不能移除.
結果訊息
rpm -e postgresql-python-7.4.13-2.RHEL4.1 postgresql-odbc-7.3-8.RHEL4.1 postgresql-jdbc-7.4.13-2.RHEL4.1 postgresql-server-7.4.13-2.RHEL4.1 postgresql-pl-7.4.13-2.RHEL4.1 postgresql-7.4.13-2.RHEL4.1 postgresql-tcl-7.4.13-2.RHEL4.1 postgresql-contrib-7.4.13-2.RHEL4.1
要依照目前安裝的 CentOS 是 32 或 64 版本來決定下載哪個版本
su - root
mkdir pgsql
cd pgsql
64 Bit 版本
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-8.2.4-1PGDG.x86_64.rpm &
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-contrib-8.2.4-1PGDG.x86_64.rpm &
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-devel-8.2.4-1PGDG.x86_64.rpm &
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-libs-8.2.4-1PGDG.x86_64.rpm &
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-plperl-8.2.4-1PGDG.x86_64.rpm &
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-server-8.2.4-1PGDG.x86_64.rpm &
wget ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.4/linux/rpms/redhat/rhel-as-4-x86_64/postgresql-test-8.2.4-1PGDG.x86_64.rpm &
32 Bit 版本
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-8.2.5-1PGDG.rhel4.i686.rpm &
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-devel-8.2.5-1PGDG.rhel4.i686.rpm &
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-libs-8.2.5-1PGDG.rhel4.i686.rpm &
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-server-8.2.5-1PGDG.rhel4.i686.rpm &
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-contrib-8.2.5-1PGDG.rhel4.i686.rpm &
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-plperl-8.2.5-1PGDG.rhel4.i686.rpm &
wget http://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/v8.2.5/linux/rpms/redhat/rhel-as-4/postgresql-test-8.2.5-1PGDG.rhel4.i686.rpm &
yum install -y tcl
rpm -ivh postgresql*
升級處理方式
下載最新版的 PostgreSQL
網址 : ftp://ftp3.tw.postgresql.org/pub/Unix/Database/postgresql/binary/
直接下 rpm -Uvh 會出現 php-pgsql-xxx 相依性問題, 所以要改下
rpm --nodeps -Uvh postgresql-*
升級後原本 CentOS 附的 postgresql-libs-7 就不見了, 所以還要下載安裝回去
wget http://ftp.isu.edu.tw/pub/Linux/CentOS/4.5/updates/i386/RPMS/postgresql-libs-7.4.17-1.RHEL4.1.i386.rpm
rpm --force -ivh postgresql-libs-7.*
第一次建立 PostgreSQL 資料目錄|
service postgresql initdb
檢查 PostgreSQL 參數檔是否已產生
cd /var/lib/pgsql/data
ls -lt
看結果內容
[root@tryboxap07 data]# ls -lt
total 116
drwx------ 5 postgres postgres 4096 Jan 25 03:29 base
drwx------ 2 postgres postgres 4096 Jan 25 03:29 global
drwx------ 2 postgres postgres 4096 Jan 25 03:29 pg_log
drwx------ 2 postgres postgres 4096 Jan 25 03:29 pg_clog
-rw------- 1 postgres postgres 3200 Jan 25 03:29 pg_hba.conf
-rw------- 1 postgres postgres 1460 Jan 25 03:29 pg_ident.conf
drwx------ 2 postgres postgres 4096 Jan 25 03:29 pg_subtrans
drwx------ 3 postgres postgres 4096 Jan 25 03:29 pg_xlog
-rw------- 1 postgres postgres 15201 Jan 25 03:29 postgresql.conf
drwx------ 4 postgres postgres 4096 Jan 25 03:29 pg_multixact
drwx------ 2 postgres postgres 4096 Jan 25 03:29 pg_tblspc
drwx------ 2 postgres postgres 4096 Jan 25 03:29 pg_twophase
-rw------- 1 postgres postgres 4 Jan 25 03:29 PG_VERSION
設定 PostgreSQL 參數檔 postgresql.conf 內容
vi postgresql.conf
:
listen_addresses = '*'
port = 5432
max_connections = 750
:
shared_buffers = 24MB
:
stats_start_collector = on
stats_command_string = on
stats_block_level = on
stats_row_level = on
:
autovacuum = on
:
依據實際需要來修改 postgresql 登入權限檔 pg_hba.conf
vi pg_hba.conf
# IPv4 local connections:
local all all ident sameuser
host all all 127.0.0.1/32 md5
啟動 PostgreSQL
service postgresql start
如果無法成功啟動, 可能需要調整 Kernel 的參數
vi /etc/sysctl.conf
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
/sbin/sysctl -p
設定每次開機自動啟動 postgresql
su - root
chkconfig postgresql on
chkconfig --list | grep postgresql
看結果內容
[root@trybox-03 data]# chkconfig --list | grep postgresql
postgresql 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@trybox-03 data]#
如果之前未安裝 postgresql-libs-7.4.xx, 就必須依照以下方式強制安裝上去.
強制安裝 postgresql-libs-7.4.xx 程序
su - root
cd pgsql
# x86_64 (64 bit)
wget http://ftp.isu.edu.tw/pub/Linux/CentOS/4.5/updates/x86_64/RPMS/postgresql-libs-7.4.17-1.RHEL4.1.x86_64.rpm
# i386 (32 bit)
wget http://ftp.isu.edu.tw/pub/Linux/CentOS/4.5/updates/i386/RPMS/postgresql-libs-7.4.17-1.RHEL4.1.i386.rpm
rpm -ivh --force postgresql-libs-7.4.*
安裝 php 與 php-mysql / php-pgsql 模組
yum install -y php php-mysql php-pgsql
設定 php
原則上 php 已經隨 apache 安裝上去, 所以只要驗證是否沒問題
cd /var/www/html/
vi php.php
service httpd restart
然後輸入網址, 應該可以看到 php 資訊網頁
http://trybox-server-url/php.php
安裝 gcc
yum install -y compat-gcc-32 gcc
使用 perl -MCPAN -e shell 來安裝與更新 Perl Module
export LANG=C
perl -MCPAN -e shell
如果以下沒有提到的詢問設定一律採用預設值
Policy on building prerequisites (follow, ask or ignore)? [ask] follow
Typical frequently used setting: -j3
Typical frequently used setting:
-j3 dual processor system
Your choice: [] -j3
Select your continent (or several nearby continents) [] 2
:
(1) Africa
(2) Asia
(3) Central America
:
(7) South America
Select your continent (or several nearby continents) [] 2
Select your country (or several nearby countries) [] 14
:
(12) Saudi Arabia
(13) Singapore
(14) Taiwan
(15) Thailand
(16) Turkey
Select your country (or several nearby countries) [] 14
put them on one line, separated by blanks, e.g. '1 4 5' [] 5 4 1 2 3 6 7 8
:
(1) ftp://cpan.cdpa.nsysu.edu.tw/Unix/Lang/CPAN/
(2) ftp://cpan.cs.pu.edu.tw/pub/CPAN
(3) ftp://ftp.cgu.edu.tw/Mirror/CPAN
(4) ftp://ftp.isu.edu.tw/pub/CPAN
(5) ftp://ftp.nctu.edu.tw/UNIX/perl/CPAN
(6) ftp://ftp.stu.edu.tw/CPAN
(7) ftp://ftp.stu.edu.tw/pub/CPAN
(8) ftp://ftp.tku.edu.tw/pub/CPAN/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 5 4 1 2 3 6 7 8
Enter another URL or RETURN to quit: []
更新 Bundle::CPAN
:
ReadLine support available (try 'install Bundle::CPAN')
cpan> install Bundle::CPAN
更新完成 Bundle::CPAN 要先離開在登入重新設定時輸入 no
cpan> exit
Lockfile removed.
[root@trybox-03 html]# perl -MCPAN -e shell
CPAN: File::HomeDir loaded ok
:
:
Are you ready for manual configuration? [yes] no
再離開與重新登入一次
cpan> exit
Lockfile removed.
[root@trybox-03 html]# perl -MCPAN -e shell
CPAN: File::HomeDir loaded ok
cpan shell -- CPAN exploration and modules installation (v1.87)
ReadLine support enabled
cpan>
需要再額外安裝 Module
install Text::Iconv
install Digest::Perl::MD5
install DBI
install DBD::Pg
install Mail::Sendmail
install MIME::Base64
install LWP
force install DBD::mysql
安裝完成之後, 可以再執行一次, 確認是否安裝正確
install Text::Iconv
install Digest::Perl::MD5
install DBI
install DBD::Pg
install Mail::Sendmail
install MIME::Base64
install LWP
install DBD::mysql
cpan[8]> install Text::Iconv
Text::Iconv is up to date (1.7).
cpan[9]> install Digest::Perl::MD5
Digest::Perl::MD5 is up to date (1.8).
cpan[10]> install DBI
DBI is up to date (1.601).
cpan[11]> install DBD::Pg
DBD::Pg is up to date (1.49).
cpan[12]> install Mail::Sendmail
Mail::Sendmail is up to date (0.79).
cpan[13]> install MIME::Base64
MIME::Base64 is up to date (3.07).
cpan[14]> install LWP
LWP is up to date (5.808).
cpan[15]> install DBD::mysql
DBD::mysql is up to date (4.006).
這部份是當無法經由 CPAN 的方式安裝才需要透過這方式處理
su - root
mkdir perl
cd perl
Text::Iconv
wget http://search.cpan.org/CPAN/authors/id/M/MP/MPIOTR/Text-Iconv-1.5.tar.gz
tar -zxvf Text-Iconv-1.5.tar.gz
cd Text-Iconv-1.5
perl Makefile.PL
make
make install
cd ..
Digest::Perl::MD5
wget http://search.cpan.org/CPAN/authors/id/D/DE/DELTA/Digest-Perl-MD5-1.8.tar.gz
tar -zxvf Digest-Perl-MD5-1.8.tar.gz
cd Digest-Perl-MD5-1.8
perl Makefile.PL
make
make install
cd ..
DBI
wget http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.59.tar.gz
tar -zxvf DBI-1.59.tar.gz
cd DBI-1.59
perl Makefile.PL
make
make install
cd ..
DBD::Pg
wget http://search.cpan.org/CPAN/authors/id/D/DB/DBDPG/DBD-Pg-1.49.tar.gz
tar -zxvf DBD-Pg-1.49.tar.gz
cd DBD-Pg-1.49
perl Makefile.PL
make
make install
cd ..
Mail::Sendmail
wget http://search.cpan.org/CPAN/authors/id/M/MI/MIVKOVIC/Mail-Sendmail-0.79.tar.gz
tar -zxvf Mail-Sendmail-0.79.tar.gz
cd Mail-Sendmail-0.79
perl Makefile.PL
make
make install
cd ..
MIME::Base64
wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/MIME-Base64-3.07.tar.gz
tar -zxvf MIME-Base64-3.07.tar.gz
cd MIME-Base64-3.07
perl Makefile.PL
make
make install
cd ..
LWP
wget http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/Compress-Raw-Zlib-2.006.tar.gz
wget http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/IO-Compress-Base-2.006.tar.gz
wget http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/IO-Compress-Zlib-2.006.tar.gz
wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/HTML-Parser-3.56.tar.gz
wget http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/Compress-Zlib-2.006.tar.gz
wget http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/HTML-Tagset-3.10.tar.gz
wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/libwww-perl-5.808.tar.gz
tar -zxvf Compress-Raw-Zlib-2.006.tar.gz
tar -zxvf IO-Compress-Base-2.006.tar.gz
tar -zxvf IO-Compress-Zlib-2.006.tar.gz
tar -zxvf HTML-Tagset-3.10.tar.gz
tar -zxvf HTML-Parser-3.56.tar.gz
tar -zxvf Compress-Zlib-2.006.tar.gz
tar -zxvf libwww-perl-5.808.tar.gz
cd Compress-Raw-Zlib-2.006
perl Makefile.PL
make
make install
cd ..
cd IO-Compress-Base-2.006
perl Makefile.PL
make
make install
cd ..
cd IO-Compress-Zlib-2.006
perl Makefile.PL
make
make install
cd ..
cd HTML-Tagset-3.10
perl Makefile.PL
make
make install
cd ..
cd HTML-Parser-3.56
perl Makefile.PL
make
make install
cd ..
cd Compress-Zlib-2.006
perl Makefile.PL
make
make install
cd ..
cd libwww-perl-5.808
perl Makefile.PL
make
make install
cd ..
至 www.sf.net 找 phpMyAdmin
cd /var/www/html
wget http://nchc.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.gz
tar -zxvf phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.gz
rm -rf phpMyAdmin-2.11.9-all-languages-utf-8-only.tar.gz
mv phpMyAdmin-2.11.9-all-languages-utf-8-only phpMyAdmin
設定 config.inc.php 參數檔
cd /var/www/html/phpMyAdmin
cp config.sample.inc.php config.inc.php
vi config.inc.php
:
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
/* Server parameters */
:
:
至 www.sf.net 找 phpPgAdmin
網址 : http://sourceforge.net/projects/phppgadmin
cd /var/www/html
wget http://nchc.dl.sourceforge.net/sourceforge/phppgadmin/phpPgAdmin-3.5.6.tar.gz
tar -zxvf phpPgAdmin-3.5.6.tar.gz
rm -rf phpPgAdmin-3.5.6.tar.gz
設定參數檔 conf/config.inc.php
cd phpPgAdmin/conf
cp config.inc.php-dist config.inc.php
vi config.inc.php
:
// Hostname or IP address for server. Use '' for UNIX domain socket.
$conf['servers'][0]['desc'] = 'PostgreSQL';
$conf['servers'][0]['host'] = 'localhost';
:
驗證 phpPgAdmin 安裝是否正確
建立 Reports 資料庫
su - postgres
export LANG=C
cd /var/www/html/phpPgAdmin/sql
psql template1 < reports-pgsql.sql
-bash-3.00$ psql template1 < reports-pgsql.sql
CREATE DATABASE
You are now connected to database "phppgadmin".
NOTICE: CREATE TABLE will create implicit sequence "ppa_reports_report_id_seq" for "serial" column "ppa_reports.report_id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "ppa_reports_pkey" for table "ppa_reports"
CREATE TABLE
GRANT
GRANT
-bash-3.00$
CentOS 內附的 SubVersion 並非最新版本, 壓力測試發現在同時 svnadmin export 與 svn update 時會出現 db 異常問題, 導致無法運作, 必須執行 svnadmin recover svndir 修復, 以下就是針對 trybox 所修復的範例:
cd /var/www/svn
svnadmin recover trybox
chown -R apache:apache trybox
實際安裝程序
su - root
mkdir subversion
cd subversion/
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/apr-0.9.12-2.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/apr-debuginfo-0.9.12-2.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/apr-devel-0.9.12-2.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/apr-util-0.9.12-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/apr-util-devel-0.9.12-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/mod_dav_svn-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/subversion-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/subversion-debuginfo-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/subversion-devel-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/subversion-perl-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/subversion-python-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/subversion-tools-1.4.6-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/swig-1.3.25-1.i386.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/apr-0.9.12-2.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/apr-debuginfo-0.9.12-2.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/apr-devel-0.9.12-2.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/apr-util-0.9.12-1.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/apr-util-debuginfo-0.9.12-1.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/apr-util-devel-0.9.12-1.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/mod_dav_svn-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/subversion-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/subversion-debuginfo-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/subversion-devel-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/subversion-perl-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/subversion-python-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/subversion-tools-1.4.4-1.rhel4.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/swig-1.3.25-1.x86_64.rpm &
wget http://summersoft.fay.ar.us/pub/subversion/latest/rhel-4/x86_64/swig-debuginfo-1.3.25-1.x86_64.rpm &
yum install -y db4-devel expat-devel openldap-devel libneon.so.24 neon
rpm -Uvh *.rpm
cd /etc/httpd/conf.d/
vi subversion.conf
vi subversion.conf
# Needed to do Subversion Apache server.
LoadModule dav_svn_module modules/mod_dav_svn.so
# Only needed if you decide to do "per-directory" access control.
#LoadModule authz_svn_module modules/mod_authz_svn.so
:
:
:
<Location /repos>
DAV svn
SVNParentPath /var/www/svn
# Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# Require SSL connection for password protection.
# SSLRequireSSL
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /var/www/passwdfile
Require valid-user
# </LimitExcept>
</Location>
mkdir /var/www/svn
cd /var/www/svn
svnadmin create trybox
chown -R apache:apache trybox
htpasswd -c /var/www/passwdfile jonathan
htpasswd /var/www/passwdfile trybox
[root@tryboxap1 svn]# htpasswd -c /var/www/passwdfile jonathan
New password:
Re-type new password:
Adding password for user jonathan
[root@tryboxap1 svn]# htpasswd /var/www/passwdfile trybox
New password:
Re-type new password:
Adding password for user jonathan
wget http://cronolog.org/download/cronolog-1.6.2.tar.gz
tar -zxvf cronolog-1.6.2.tar.gz
cd cronolog-1.6.2
./configure
make
make install
cd ..
rm -rf cronolog-1.6.2*
實際安裝程序
su - root
mkdir rrdtool
cd rrdtool
yum -y install freetype-2.1.9 freetype-devel-2.1.9 libpng-devel-1.2.7 libart_lgpl-devel-2.3.16 perl-Time-HiRes
wget http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.2.23-1.el4.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.2.23-1.el4.rf.i386.rpm
rpm -ivh perl-rrdtool-1.2.23-1.el4.rf.i386.rpm rrdtool-1.2.23-1.el4.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/rrdtool/perl-rrdtool-1.2.23-1.el4.rf.x86_64.rpm
wget http://dag.wieers.com/rpm/packages/rrdtool/rrdtool-1.2.23-1.el4.rf.x86_64.rpm
rpm -ivh perl-rrdtool-1.2.23-1.el4.rf.x86_64.rpm rrdtool-1.2.23-1.el4.rf.x86_64.rpm
su - root
vi /etc/sysconfig/iptables
/etc/sysconfig/iptables
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
service iptables restart