[Oracle] oracle远程漏洞投毒扫描工具


1、安装扫描工具

1
2
3
4

curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > msfinstall && \
chmod 755 msfinstall && \
./msfinstall

2、扫描相应的数据库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[root@node3 soft]# msfconsole
[-] ***rting the Metasploit Framework console...|
[-] * WARNING: No database support: No database YAML file
[-] ***
.:okOOOkdc' 'cdkOOOko:.
.xOOOOOOOOOOOOc cOOOOOOOOOOOOx.
:OOOOOOOOOOOOOOOk, ,kOOOOOOOOOOOOOOO:
'OOOOOOOOOkkkkOOOOO: :OOOOOOOOOOOOOOOOOO'
oOOOOOOOO. .oOOOOoOOOOl. ,OOOOOOOOo
dOOOOOOOO. .cOOOOOc. ,OOOOOOOOx
lOOOOOOOO. ;d; ,OOOOOOOOl
.OOOOOOOO. .; ; ,OOOOOOOO.
cOOOOOOO. .OOc. 'oOO. ,OOOOOOOc
oOOOOOO. .OOOO. :OOOO. ,OOOOOOo
lOOOOO. .OOOO. :OOOO. ,OOOOOl
;OOOO' .OOOO. :OOOO. ;OOOO;
.dOOo .OOOOocccxOOOO. xOOd.
,kOl .OOOOOOOOOOOOO. .dOk,
:kk;.OOOOOOOOOOOOO.cOk:
;kOOOOOOOOOOOOOOOk:
,xOOOOOOOOOOOx,
.lOOOOOOOl.
,dOd,
.

=[ metasploit v5.0.27-dev- ]
+ -- --=[ 1895 exploits - 1067 auxiliary - 329 post ]
+ -- --=[ 547 payloads - 44 encoders - 10 nops ]
+ -- --=[ 2 evasion ]

指定扫描数据库的ip地址

1
2
3
msf5 >  use auxiliary/scanner/oracle/tnspoison_checker
msf5 auxiliary(scanner/oracle/tnspoison_checker) > set rhosts 192.168.168.177
rhosts => 192.168.168.177

查看配置选项

1
2
3
4
5
6
7
8
msf5 auxiliary(scanner/oracle/tnspoison_checker) > show options
Module options (auxiliary/scanner/oracle/tnspoison_checker):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS 192.168.168.177 yes The target address range or CIDR identifier
RPORT 1521 yes The target port (TCP)
THREADS 1 yes The number of concurrent threads

进行漏洞扫描

1
2
3
4
msf5 auxiliary(scanner/oracle/tnspoison_checker) > run
[+] 192.168.168.177:1521 - 192.168.168.177:1521 is vulnerable
[*] 192.168.168.177:1521 - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

根据提示177该服务器是易受攻击的,说明存在漏洞
下面是具体进行渗透测试:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
msf5 auxiliary(scanner/oracle/tnspoison_checker) > use auxiliary/admin/oracle/tnscmd
msf5 auxiliary(admin/oracle/tnscmd) > set rhosts 192.168.168.177
rhosts => 192.168.168.177
msf5 auxiliary(admin/oracle/tnscmd) > show options
Module options (auxiliary/admin/oracle/tnscmd):

Name Current Setting Required Description
---- --------------- -------- -----------
CMD (CONNECT_DATA=(COMMAND=VERSION)) no Something like ping, version, status, etc..
RHOSTS 192.168.168.177 yes The target address range or CIDR identifier
RPORT 1521 yes The target port (TCP)

msf5 auxiliary(admin/oracle/tnscmd) > run
[*] Running module against 192.168.168.177

[*] 192.168.168.177:1521 - Sending '(CONNECT_DATA=(COMMAND=VERSION))' to 192.168.168.177:1521
[*] 192.168.168.177:1521 - writing 90 bytes.
[*] 192.168.168.177:1521 - reading
[*] 192.168.168.177:1521 - .e......"..Y(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=1189)(ERROR_STACK=(ERROR=(CODE=1189)(EMFI=4))))
[*] Auxiliary module execution completed

修改oracle服务端的监听配置文件listener.ora,增加下列内容
单实例

1
2
VALID_NODE_CHECKING_REGISTRATION_LISTENER =ON
REGISTRATION_INVITED_NODES_LISTENER=(192.168.168.177)

多实例
listener.ora文件添加如下内容(RAC)

1
2
3
4
5
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN*=ON
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=ON
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=ON
VALID_NODE_CHECKING_REGISTRATION_LISTENER =ON
REGISTRATION_INVITED_NODES_LISTENER=(两台host的IP都列进来)

重新加载监听

1
lsnrctl reload

再次重新检测

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
msf5 auxiliary(admin/oracle/tnscmd) > use auxiliary/scanner/oracle/tnspoison_checker
msf5 auxiliary(scanner/oracle/tnspoison_checker) > set rhosts 192.168.168.177
rhosts => 192.168.168.177
msf5 auxiliary(scanner/oracle/tnspoison_checker) > show options

Module options (auxiliary/scanner/oracle/tnspoison_checker):

Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS 192.168.168.177 yes The target address range or CIDR identifier
RPORT 1521 yes The target port (TCP)
THREADS 1 yes The number of concurrent threads

msf5 auxiliary(scanner/oracle/tnspoison_checker) > run

[-] 192.168.168.177:1521 - 192.168.168.177:1521 is not vulnerable
[*] 192.168.168.177:1521 - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

点击阅读

[Oracle] oracle exp导出报错EXP-00091: Exporting questionable statistics


1、报错原因

1
数据库字符集与当前系统NLS_LANG参数不匹配

2、解决方法

查看数据库的字符集

1
2
3
4
select userenv('language') from dual;
USERENV('LANGUAGE')
------------------------------------------------------------------------------------------------------------------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK

声明NLS_LANG参数
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
再次执行导出
exp \"/ as sysdba \" tables=sys.aud$ file=/tmp/cbi1_daochu.dmp

点击阅读

[Oracle]oracle Cluster Verification Utility(cvu)参考


1、概述

cvu工具用于数据库安装、补丁升级、其他系统变更等操作之前的系统检查。

2、使用详情

cvu包含两个脚本runcluvfy.sh和cluvfy.sh
runcluvfy.sh:用于安装GI和Database之前运行(位于grid安装包解压出来的目录下)
cluvfy.sh:用于GI安装完成之后,Database安装的系统检查(位于$GRID_HOME/bin目录下)

note*****使用runcluvfy脚本时建议添加-verbose参数来获取到详细的参数。

3、使用下面语句检查预安装之前步骤是否完成

一般使用方法
$ ./runcluvfy.sh stage -pre crsinst -fixup -n rac1,rac2 -verbose
指定一个修复文件的生成目录
./runcluvfy.sh stage -pre crsinst -fixup -fixupdir /tmp/fixit.sh -n rac1,rac2 -verbose
如果不指定版本,cvu会按照11.2的要求检查,指定版本按下面方法:
$ ./runcluvfy.sh stage -pre crsinst -n node1,node2,node3 -r 10gR2

点击阅读

[Oracle] oracle查询被锁的sql语句并解锁


实验1:

1
2
3
4
session1:
20:01:35 SYS@ boston> select * from scott.t1 for update;
session2:
20:01:13 SCOTT@ boston> update t1 set empno=8000 where empno=7566;

session2执行update语句的时候卡主了,需要等待session1把锁释放掉。
session3查看当前被锁的会话:

1
2
3
4
5
20:01:16 SYS@ boston> select a.object_name,b.session_id,c.serial#,'alter system kill session '''||b.session_id||','||c.serial#||'''; ' as a,c.program,c.username,c.command,c.machine,c.lockwait from all_objects a,v$locked_object b,v$session c where a.object_id=b.object_id and c.sid=b.session_id;

OBJECT_NAME SESSION_ID SERIAL# A PROGRAM USERNAME COMMAND MACHINE LOCKWAIT
T1 208 2941 alter system kill session '208,2941'; sqlplus@dax-mysql-slave (TNS V1-V3) SYS 0 dax-mysql-slave
T1 301 957 alter system kill session '301,957'; sqlplus@dax-mysql-slave (TNS V1-V3) SCOTT 6 dax-mysql-slave

查看被锁的对象

1
2
3
4
SELECT l.session_id sid,s.serial#,l.locked_mode ,l.oracle_username ,l.os_user_name ,s.machine,s.terminal,o.object_name,s.logon_time,c.sql_text FROM v$locked_object l, all_objects o, v$session s, v$sqlarea c WHERE l.object_id = o.object_id AND l.session_id = s.sid and s.sql_id = c.sql_id ORDER BY sid,s.serial#;
SID SERIAL# 锁模式 登录用户 登录机器用户名 机器名 终端用户名 被锁对象名 登录数据库时间 会话正在执行的SQL语句
301 957 3 SCOTT oracle dax-mysql-slave pts/2 T1 2019:02:28 19:18:06
update t1 set empno=8000 where empno=7566

查询结果如上所示,因为session1的查询已经结束,session2的sql还被锁住,只能查询到session2的sql语句,因此我们要杀掉sessoin1的会话,让session2继续正常运行。如果杀掉了sesison2,其他会话再进来执行dml变更操作,会话仍然被卡主。

实验2:
rollback回滚上面的操作,之后继续实验2

1
2
3
4
5
6
7
session2:
20:13:00 SCOTT@ boston> update t1 set empno=8000 where empno=7566;
4097 rows updated.
Elapsed: 00:00:00.09

session1:
20:14:13 SYS@ boston> select * from scott.t1 for update;

session1执行select操作被卡主
session3查看被锁的语句

1
2
3
4
5
6
7
20:10:44 SYS@ boston> select a.object_name,b.session_id,c.serial#,'alter system kill session '''||b.session_id||','||c.serial#||'''; ' as a,c.program,c.username,c.command,c.machine,c.lockwait from all_objects a,v$locked_object b,v$session c where a.object_id=b.object_id and c.sid=b.session_id; 

OBJECT_NAME SESSION_ID SERIAL# A PROGRAM USERNAME COMMAND MACHINE LOCKWAIT
------------------------------ ---------- ---------- --------------------------------------------------------------------------------------------------------------- ------------------------------------------------ ------------------------------ ---------- ---------------------------------------------------------------- ----------------
T1 107 6131 alter system kill session '107,6131'; sqlplus@dax-mysql-slave (TNS V1-V3) SYS 3 dax-mysql-slave 00000000BD230AE0
T1 301 957 alter system kill session '301,957'; sqlplus@dax-mysql-slave (TNS V1-V3) SCOTT 0 dax-mysql-slave
Elapsed: 00:00:00.02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20:16:01 SYS@ boston> SELECT l.session_id sid,  
s.serial#,
l.locked_mode 锁模式,
l.oracle_username 登录用户,
l.os_user_name 登录机器用户名,
s.machine 机器名,
s.terminal 终端用户名,
o.object_name 被锁对象名,
s.logon_time 登录数据库时间 ,
c.sql_text 会话正在执行的sql语句
FROM v$locked_object l, all_objects o, v$session s ,v$sqlarea c
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
and s.sql_id = c.sql_id
ORDER BY sid, s.serial#;
SID SERIAL# 锁模式 登录用户 登录机器用户名 机器名 终端用户名 被锁对象名 登录数据库时间 会话正在执行的SQL语句
107 6131 3 SYS oracle dax-mysql-slave pts/0 T1 2019:02:28 20:14:13 select * from scott.t1 for update
Elapsed: 00:00:00.01

查询结果为session1的select语句被堵塞,处于正在执行的状态,session2的update语句已经执行完成,需要commit才能把锁释放掉。

点击阅读

[Oracle] 锁表情况下使用exp和expdp导出


1、共享锁

lock table test in share mode;
exp和expdp均可正常导出

1
2
3
4
5
6
7
8
9
exp test/Test1234 file=/tmp/test2.dmp  tables=test
Export: Release 11.2.0.4.0 - Production on Tue Jun 4 15:57:35 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST 3 rows exported
Export terminated successfully without warnings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[oracle@dax-mysql-slave tmp]$ expdp test/Test1234 dumpfile=expdp5.test directory=exp_data_dir tables=test
Export: Release 11.2.0.4.0 - Production on Tue Jun 4 15:59:45 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** dumpfile=expdp5.test directory=exp_data_dir tables=test
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "TEST"."TEST" 5.031 KB 3 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/tmp/backup/expdp5.test
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at Tue Jun 4 15:59:49 2019 elapsed 0 00:00:03

2、排他锁

1
2
3
15:58:19 TEST@ boston> lock table test in exclusive mode;
Table(s) Locked.
Elapsed: 00:00:00.00

exp可正常导出

1
2
3
4
5
6
7
8
9
[oracle@dax-mysql-slave tmp]$ exp test/Test1234 file=/tmp/test4.dmp  tables=test
Export: Release 11.2.0.4.0 - Production on Tue Jun 4 16:00:51 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST 3 rows exported
Export terminated successfully without warnings.

expdp导出进程被锁,直到排它锁被释放

1
2
3
4
5
6
7
8
9
10
11
12
13
[oracle@dax-mysql-slave tmp]$ expdp test/Test1234 dumpfile=expdp6.test directory=exp_data_dir tables=test
Export: Release 11.2.0.4.0 - Production on Tue Jun 4 16:01:30 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** dumpfile=expdp6.test directory=exp_data_dir tables=test
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS

下面设置当然用户下的表空间为只读

1
2
3
4
5
16:03:04 TEST@ boston> select default_tablespace from user_users;
DEFAULT_TABLESPACE
------------------------------
USERS
16:03:04 TEST@ boston> alter tablespace users read only;

exp导出正常,expdp报错

1
2
3
4
5
6
7
8
9
[oracle@dax-mysql-slave tmp]$ exp test/Test1234 file=/tmp/test4.dmp  tables=test
Export: Release 11.2.0.4.0 - Production on Tue Jun 4 16:04:37 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
. . exporting table TEST 3 rows exported
Export terminated successfully without warnings.
1
2
3
4
5
6
7
8
9
10
[oracle@dax-mysql-slave tmp]$ expdp test/Test1234 dumpfile=expdp7.test directory=exp_data_dir tables=test
Export: Release 11.2.0.4.0 - Production on Tue Jun 4 16:04:42 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31633: unable to create master table "TEST.SYS_EXPORT_TABLE_05"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPV$FT", line 1038
ORA-01647: tablespace 'USERS' is read-only, cannot allocate space in it

点击阅读

[Oracle] ORA-00257: archiver error Connect internal only until freed


1、查看闪回区使用情况

1
2
3
4
5
6
7
8
9
10
11
select * from V$FLASH_RECOVERY_AREA_USAGE;

FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE 0 0 0
REDO LOG 10.11 0 2
ARCHIVED LOG 0 0 2
BACKUP PIECE 0 0 0
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0

2、计算闪回区使用空间

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
03:56:25 SYS@ cbi> show parameter recovery;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/oracle/fast_recovery_
area/cbi/
db_recovery_file_dest_size big integer 10374182400
recovery_parallelism integer 0

N为db_recovery_file_dest_size的大小

select sum(percent_space_used)*N/100 from v$flash_recovery_area_usage;

04:00:43 SYS@ cbi> select sum(percent_space_used)*10/100 from v$flash_recovery_area_usage;

SUM(PERCENT_SPACE_USED)*10/100
------------------------------
1.011

3、ORA-00257的错误是因为归档太多导致闪回区满了造成的,下面通过rman删除归档

1
2
3
4
crosscheck archivelog all;
delete archivelog until time 'sysdate'; --删除所有日志
delete force noprompt archivelog all completed before 'sysdate-3'; --删除3天前的归档
delete expired archivelog all;--删除过期日志

点击阅读

[linux] linux添加用户sudo使用权限


1、修改/etc/sudoers文件

默认sudoers文件权限为440,需要手动修改权限,否则无法编辑
chmod 740 /etc/sudoers

修改sudoers文件vim /etc/sudoers
centos ALL=(ALL) ALL

如果使用sudo的时候不输入密码,需要添加nopasswd参数(注意NOPASSWD: ALL中间有空格)
centos ALL=(ALL) NOPASSWD: ALL

2、使用jenkins远程调用shell脚本,执行带有sudo的命令会报错

sudo:抱歉,您必须拥有一个终端来执行 sudo

这个问题,需要修改/etc/sudoers配置文件
Default requiretty
将Default requiretty这一行注释掉

点击阅读

[linux] docker启动ssh,允许使用ssh远程登录docker容器


1、安装依赖包

yum install openssh openssh-server openssh-clients

2、修改ssh配置/etc/ssh/ssh_config

vim /etc/ssh/ssh_config

1
2
3
4
#允许root用户ssh登录
PermitRootLogin yes
##禁用PAM
UsePAM no

3、启动ssh服务

1
2
3
service sshd start
service sshd stop
service sshd restart

4、查看服务是否启动

netstat -tunlp|grep 22

1
2
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      14513/sshd
tcp6 0 0 :::22 :::* LISTEN 14513/sshd

5、如果启动docker的时候没有指定端口映射,需要重新commit之后,指定新的端口映射启动

docker commit -m='add sshd service' -a='zeven' f2622fe8a8d8 zeven/ssh:v1

6、重启指定端口映射,启动容器

docker run -dti --privileged -p 2233:22 zeven/ssh:v1 /usr/sbin/init

7、启动完成之后可使用ssh连接工具配置宿主机ip、端口2233、用户名、密码便可正常登录docker容器

点击阅读

[linux] seeddms部署,docker环境启动


1、安装基础工具,下载软件安装包

1
yum install vim wget gcc net-tools sudo numactl initscripts -y
1
2
3
4
5
mkdir -p /data/soft && cd /data/soft
wget https://jaist.dl.sourceforge.net/project/seeddms/seeddms-5.1.10/seeddms-quickstart-5.1.10.tar.gz
wget https://jaist.dl.sourceforge.net/project/seeddms/seeddms-5.1.10/SeedDMS_Core-5.1.10.tgz
wget https://jaist.dl.sourceforge.net/project/seeddms/seeddms-5.1.10/SeedDMS_Lucene-1.1.13.tgz
wget https://jaist.dl.sourceforge.net/project/seeddms/seeddms-5.1.10/SeedDMS_Preview-1.2.10.tgz

2、解压quickstart安装包

tar -zxvf seeddms-quickstart-5.1.10.tar.gz

3、安装php

yum install php-mysql php-pear php-gd php-http-webdav-server php-mbstring php-pdo php-pear-Log php-ZendFramework-Search-Lucene php-pear-Image-Text php-ZendFramework-Search-Lucene -y
pear install channel://pear.php.net/HTTP_WebDAV_Server-1.0.0RC8

php版本要高于,下面升级到5.6,配置5.6yum源
追加CentOS 6.5的epel及remi源。
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
以下是CentOS 7.0的源。
yum install epel-release -y
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
使用yum list命令查看可安装的包(Packege)。
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
安装PHP5.6
yum源配置好了,下一步就安装PHP5.6。
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof -y
用PHP命令查看版本。
php --version

4、安装mysql数据库

(省略)

5、yum方式安装apache

yum install -y httpd
systemctl enable httpd
systemctl start httpd

6、将解压出来的文件拷贝到apache目录下

mkdir –p /var/www/html/dms
mv /data/soft/seeddms51x/* /var/www/html/dms/
chown apache:apache -R /var/www/html/dms
cd /data/soft

1
2
3
4
5
6
[root@node3 soft]# pear install SeedDMS_Core-5.1.10.tgz
install ok: channel://pear.php.net/SeedDMS_Core-5.1.10
[root@node3 soft]# pear install SeedDMS_Lucene-1.1.13.tgz
install ok: channel://pear.php.net/SeedDMS_Lucene-1.1.13
[root@node3 soft]# pear install SeedDMS_Preview-1.2.10.tgz
install ok: channel://pear.php.net/SeedDMS_Preview-1.2.10

7、创建mysql数据库

mysql -u root -p

1
2
3
4
create database db_dms;
grant all privileges on db_dms.* to 'dms'@'%' identified by 'dms';
flush privileges;
source /var/www/html/dms/seeddms/install/create_tables-innodb.sql

8、修改php配置文件

vim /etc/php.ini
date.timezone = 'Asia/Shanghai'

9、创建mysql连接

[root@node3 tmp]# mkdir -p /var/lib/mysql/
[root@node3 tmp]# ln -s /data/mysql/tmp/mysql.sock /var/lib/mysql/mysql.sock

10、修改配置文件/var/www/html/dms/conf/settings.xml

1
<server rootDir="/var/www/html/dms/www/" httpRoot="/dms/seeddms/" contentDir="/var/www/html/dms/data/" stagingDir="/var/www/html/dms/data/staging/" luceneDir="/var/www/html/dms/data/lucene/" logFileEnable="true" logFileRotation="d" enableLargeFileUpload="false" partitionSize="2000000" cacheDir="/var/www/html/dms/data/cache/" dropFolderDir="" backupDir="" repositoryUrl="" maxUploadSize="">
1
<server coreDir="" luceneClassDir="" contentOffsetDir="1048576" maxDirID="0" updateNotifyTime="86400" extraPath="/var/www/html/dms/pear/" maxExecutionTime="30" cmdTimeout="1">
1
<database dbDriver="mysql" dbHostname="localhost" dbDatabase="db_dms" dbUser="dms" dbPass="dms" doNotCheckVersion="false">

11、下面是本人制作的docker镜像,可下载直接使用

docker run -p 80:80 -dt zeven0707/seeddms:v1 /usr/sbin/init
(需要加上–privileged,否则启动httpd会报错Failed to get D-Bus connection: Operation not permitted)
只后进入docker启动mysql、apache
/etc/init.d/mysql start
systemctl start httpd

启动完成之后,登录

1
2
3
http://<宿主机ip>/dms/seeddms
用户名:admin
密码:admin

点击阅读

Proudly powered by Hexo and Theme by Lap
本站访客数人次
© 2020 zeven0707's blog