RackTables电子机架配置

环境说明:

[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安装

  1. 在浏览器中打开:http://tables.uki.com/

  2. 出现如下提示:

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.

  1. 点击“here”单词链接,出现如下页面提示

RackTables installation: step 1 of 7

There seem to be no existinginstallation here, I am going to setup one now.

 

  1. 点击上页出现的“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

  1. 上面操作完成后,再点一次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

  1. 全部绿色通过,点击“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.

  1. 点击“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”,出现登录框,大功告成。

你可能感兴趣的:(mysql,配置,racktables,电子机架)