環境說明:
[root@itflow~]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
DistributorID: CentOS
Description: CentOS release 5.6 (Final)
Release: 5.6
Codename: Final
一、下載
[root@itflow~]# wget https://sourceforge.net/projects/racktables/files/RackTables-0.20.8.tar.gz/download--no-check-certificate
[root@itflow~]# tar -xvf RackTables-0.20.8.tar.gz
[root@itflow~]# mv RackTables-0.20.8/wwwroot /var/www/html/racktables
二、配置數據庫(已經安裝mysql服務)
注:如果不在這裏配置,後面網頁安裝時也會有提示,那時候再按提示操作也OK。
[root@itflow~]# mysql -V
mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu(x86_64) using readline 5.1
[root@itflow~]# mysql -uroot -p
mysql> create database racktables; mysql> grant all on racktables.* toroot; mysql> grant all on racktables.* toroot@localhost; mysql> grant all on racktables.* torackuser; mysql> grant all on racktables.* torackuser@localhost; mysql> set password forrackuser@localhost=password('YOURPASSWORD'); mysql> grant all privileges on *.*to 'rackuser'@'172.21.4.%' identified by 'YOURPASSWORD'; mysql> exit
三、配置Web設置(已經安裝httpd服務)
[root@itflow~]# /usr/sbin/apachectl -v
Serverversion: Apache/2.2.3
Serverbuilt: Jan 31 2011 17:50:30
[root@itflow~]# vi /etc/httpd/conf/httpd.conf
進行如下配置(如果要進行SSL安裝請參考後面的SSL部分的配置):
Listen80
ServerName tables.uki.com:80
DocumentRoot "/var/www/html/racktables"
#由於此服務器配置多個站點,ServerName的順序無所謂,但DocumentRoot順序要和下面的Directory保持一致,否則會出現網站的訪問錯亂
<Directory /var/www/html/racktables/>
Allow Override All
Order allow,deny
Allow from all
</Directory>
[root@itflow~]# service httpd restart
四、進行Web安裝
在瀏覽器中打開:http://tables.uki.com/
出現如下提示:
Configurationerror
Thisinstance of RackTables misses a configuration file (/var/www/html/racktables/inc/secret.php).
The configurationfile is usually generated by RackTables installer, which can be launched here.
點擊“here”單詞鏈接,出現如下頁面提示
RackTables installation: step 1 of 7
There seem to be no existinginstallation here, I am going to setup one now.
點擊上頁出現的“proceed”按鈕,出現另一頁面,有如下提示
RackTables installation: step 2 of 7
PHP version >= 5.2.10 PASSED
PDO extension PASSED
PDO-MySQL extension PASSED
PCRE extension PASSED
PCRE compiled with--enable-unicode-properties PASSED
SNMP extension NOT PRESENT
GD extension NOT PRESENT
Multibyte string extension PASSED
LDAP extension PASSED
PCNTL extension NOT PRESENT
JSON extension PASSED
cURL extension PASSED
BC Math extension NOT PRESENT
accessed over HTTPS No! (all your passwords will betransmitted in cleartext)
針對上面出現的***、紅色提示,進行安裝:
[root@itflow ~]# yum install php53-snmp
[root@itflow ~]# yum install php53-gd
[root@itflow ~]# yum install php53-bcmath
上面三個安裝完之後,重啓httpd生效;由於已經安裝好PHP,下面是php動態添加擴展的方式 phpize
[root@itflow ~]# find / -name pcntl
/root/php-5.3.3/ext/pcntl
[root@itflow ~]# cd /root/php-5.3.3/ext/pcntl
[root@itflow pcntl]# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
接下來作如下配置:
[root@itflow pcntl]# ./configure --with-php-config=/usr/bin/php-config
[root@itflow pcntl]# make && make install
[root@itflow pcntl]# echo extension=pcntl.so >>/etc/php.ini #添加php的擴展
[root@itflow pcntl]# service httpd restart
如果不需要https安全訪問的,SSL配置部分可忽略。
接下來配置SSL安全訪問:
[root@itflowmodules]# vi /etc/httpd/conf/httpd.conf
LoadModulessl_module modules/mod_ssl.so
由於已經Include conf.d/*.conf,否則需要:Include conf.d/httpd-ssl.conf
[root@itflowmodules]# vi /etc/httpd/conf.d/ssl.conf
作如下配置:
-----------------------------------------------------------------------------------------------
Listen8889
SSLCertificateFile/etc/httpd/ssl/ukiServer.crt #註釋掉原有行,否則httpd會失敗
SSLCertificateKeyFile/etc/httpd/ssl/ukiServer.key #註釋掉原有行,否則httpd會失敗
<VirtualHost_default_:8889>
DocumentRoot"/var/www/html/racktables/"
ServerName tables.uki.com:8899
ServerAdmin [email protected]
ErrorLog /etc/httpd/logs/ssl_error_log
TransferLog /etc/httpd/logs/ssl_access_log
</VirtualHost>
-----------------------------------------------------------------------------------------------
隨後下載一個自動生成ca的工具:
[root@itflow~]# wget http://www.openssl.org/contrib/ssl.ca-0.1.tar.gz
[root@itflow~]# tar -xvf ssl.ca-0.1.tar.gz
[root@itflow~]# cd ssl.ca-0.1
[[email protected]]# ./new-root-ca.sh
No Root CA key round. Generatingone
Generating RSA private key, 1024bit long modulus
..........++++++
.++++++
e is 65537 (0x10001)
Enter pass phrase for ca.key:(輸入一個密碼)
Verifying - Enter pass phrasefor ca.key: (再輸入一次密碼)
Self-sign the root CA... (簽署根證書)
Enter pass phrase for ca.key:(輸入剛剛設置的密碼)
(下面開始簽署):
You are about to be asked to enterinformation that will be incorporated
into your certificate request.
What you are about to enter iswhat is called a Distinguished Name or a DN.
There are quite a few fields butyou can leave some blank
For some fields there will bea default value,
If you enter '.', the field willbe left blank.
-----
Country Name (2 letter code) [MY]:CN
State or Province Name (full name)[Perak]:GUANGDONG
Locality Name (eg, city) [Sitiawan]:SHENZHEN
Organization Name (eg, company)[My Directory Sdn Bhd]:METRO
Organizational Unit Name (eg,section) [Certification Services Division]:IT
Common Name (eg, MD Root CA) []:YoukiROOTCA
Email Address []:[email protected]
結束上面的對話框後會生成 ca.crt 和ca.key 兩個文件,下面還要爲我們的服務器生成一個證書:
[[email protected]]# ./new-server-cert.sh ukiServer
接下來會出現之前類似的對話框,按需求填寫後會生成ukiServer.csr 和ukiServer.key 兩個文件,還需要簽署一下才能使用的:
[[email protected]]# ./sign-server-cert.sh ukiServer
Youhave new mail in /var/spool/mail/root
[[email protected]]# ./sign-server-cert.sh ukiServer
CAsigning: ukiServer.csr -> ukiServer.crt:
Usingconfiguration from ca.config
Enterpass phrase for ./ca.key: (輸入上面設置的根證書密碼)
還有一些確認框確認後會最終生成:ukiServer.crt,然後
[[email protected]]# cp -avr ukiServer.* /etc/httpd/ssl/
[root@itflowmodules]# httpd -t
[ThuJun 12 12:26:51 2014] [warn] module ssl_module is already loaded, skipping
SyntaxOK
這是由於之前這個操作導致的,去掉下面的設置即可:
[root@itflowmodules]# vi /etc/httpd/conf/httpd.conf
LoadModulessl_module modules/mod_ssl.so
[root@itflowmodules]# httpd -t
SyntaxOK
上面操作完成後,再點一次step 2 of 7,出現如下提示
RackTables installation: step 2 of 7
窗體頂端
PHPversion >= 5.2.10 PASSED
PDOextension PASSED
PDO-MySQLextension PASSED
PCREextension PASSED
PCREcompiled with--enable-unicode-properties PASSED
SNMPextension PASSED
GDextension PASSED
Multibytestring extension PASSED
LDAPextension PASSED
PCNTLextension PASSED
JSONextension PASSED
cURLextension PASSED
BCMath extension PASSED
accessedover HTTPS PASSED
全部綠色通過,點擊“proceed”單詞鏈接,出現如下頁面提示
RackTables installation:step 3 of 7
The /var/www/html/racktables/inc/secret.phpfile is not writable by web-server. Make sure it is.The following commands shouldsuffice:
touch '/var/www/html/racktables/inc/secret.php';chmod 666 '/var/www/html/racktables/inc/secret.php'
Fedora Linux with SELinux may require thisfile to be owned by specific user (apache) and/or executing "setenforce 0"for the time of installation. SELinux may be turned back on with "setenforce1" command.
依據提示修改:
[root@itflow~]# touch '/var/www/html/racktables/inc/secret.php'
[root@itflow~]# chmod 666 '/var/www/html/racktables/inc/secret.php'
做完上面操作後,再點“proceed”鏈接,出現下一步:
RackTables installation: step 3 of 7
Server-side MySQL setupof the database:
mysql>
CREATE DATABASE racktables_dbCHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGESON racktables_db.* TO racktables_user@localhost IDENTIFIED BY 'MY_SECRET_PASSWORD';
TCP connection #我選了此項
UNIX socket
TCP host: 172.21.4.11 #注意,最好用IP,不然後面會出錯
TCP port (if not 3306):
UNIX socket: /var/lib/mysql/mysql.sock
database: racktables
username: rackuser
password:
由於之前已經創建了,這裏的綠色提示可以忽略用戶名、密碼改成自己設定的就可以了!然點retry按鈕,出現類似(The configuration file has been written successfully.)的成功提示,接着點擊“proceed”出現:
RackTables installation: step 4 of 7
Please setownership (chown) and/or permissions (chmod) of /var/www/html/racktables/inc/secret.php on the server filesystem as follows:
The file MUST NOT be writable by the httpd process.
The file MUST be readable by the httpd process.
The file should not be readable by anyone except the httpd process.
The file should not be writable by anyone.
For example,if httpd runs as user "nobody" and group "nogroup", commandssimilar to the following may work (though not guaranteed to, please consider onlyas an example):
chown nobody:nogroup secret.php; chmod 400secret.php
若有上面的錯誤提示,按內容提示解決:
[root@itflow inc]#chown apache:apache secret.php
[root@itflow inc]#chmod 400 secret.php
再點“retry”,顯示成功:
RackTables installation: step 4 of 7
The configurationfile ownership/permissions seem to be OK.
點擊“proceed”鏈接,出現如下頁面提示
Pdo exception: PDOException
SQLSTATE[42000]: Syntax error or access violation:1227 Access denied; you need the SUPER privilege for this operation(42000)
at file /var/www/html/racktables/inc/dictionary.php, line43
/var/www/html/racktables/inc/dictionary.php:43query('CREATE TRIGGER `trigger_test` BEFORE INSERT ON `innodb_test` FOR EACH ROWBEGIN END')
/var/www/html/racktables/inc/install.php:346isInnoDBSupported()
/var/www/html/racktables/inc/install.php:66init_database_static()
/var/www/html/racktables/index.php:271 renderInstallerHTML()
Error info:
Array
(
[0] => 42000
[1] => 1227
[2] => Access denied; you need the SUPER privilege for this operation
)
Parameters:
GET
module installer
POST
step 5
COOKIE
_gscu_1172443301 95043701ezw69614
itop-2e83d2e9b00e354fdc528621… nlm16l9g5ksqbr5flvln7rac14
好吧,修改!這個花了點時間解決,後面才發現犯了低級錯誤,重複step 3 of 7,改掉之前的TCP host裏面輸入的Localhost爲IP地址,有不同意見的歡迎指正。完成上面操作後,終於有了下面的成功提示:
RackTables installation: step 5 of 7
Initializingthe database...
done
section queries errors
structure 85 0
dictbase 15 0
dictionary 80 0
點擊“proceed”,出現:
RackTables installation: step 6 of 7
Administratorpassword not set
輸入管理員密碼後點擊“retry”,出現:
RackTables installation: step 6 of 7
Administratorpassword has been set successfully.
點擊“proceed”,出現:
RackTables installation: step 7 of 7
Congratulations! RackTablesinstallation is complete. After pressing Proceed you will enter the system.Authenticate with admin username.
RackTables project has a wikiand a mailing list for users. Have fun.
點擊“proceed”,出現登錄框,大功告成。