1.安装的系统redhat6.0
2.安装openssl
[root@vbird openca] tar -zxvf openssl-1.0.1c.tar.gz
[root@vbird openca] cd openssl-1.0.1c
[root@vbird openssl-1.0.1c] ./config --prefix=/usr/local/openssl
3安装apahce
[root@vbird openca] # tar -zxvf httpd-2.2.10.tar.gz
[root@vbird openca] # cd httpd-2.2.10
[root@vbird httpd-2.2.10] # ./configure --prefix=/usr/local/apache2
[root@vbird httpd-2.2.10] # ./configure --prefix=/usr/local/apache2
[root@vbird httpd-2.2.10] # make && make install
开启apache服务
/usr/local/apache2/bin/apachectl start
错误:
如果碰到:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
则修改httpd.conf的#ServerName www.example.com:80 为:
解决方法:ServerName IPAdrress:80
设置apache开机自启动
cd /usr/local/apache2/bin/
cp apachectl /etc/rc.d/init.d/httpd
chmod 700 /etc/rc.d/init.d/httpd
4安装mysql(我为了方便没有用源码包用的是直接redhat提供的rpm包)
[root@vbird openca] # rpm -ivh mysql-5.1.52-1.el6_0.1.i686.rpm
[root@vbird openca] # service mysqld start
测试数据库:
[root@station89 openca]# mysql -uroot -p
Enter password: (密码)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.52 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> (这样成功安装数据库)
数据库报错
错误1.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
这个错误是mysql服务没有启动
错误2.
mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
/etc/init.d/mysqld stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
FLUSH PRIVILEGES;
quit
5创建数据库openca
create database openca;
GRANT create,drop,select,delete,insert,update ON openca.* TO 'openca'@'localhost' IDENTIFIED by 'openca';
FLUSH privileges;
exit;
6.安装openca-tools
[root@vbird openca] # tar -zxvf openca-tools-1.3.0.tar.gz
[root@vbird openca] # cd openca-tools-1.3.0
[root@vbird openca-tools-1.3.0]#
./configure--prefix=/user/local/openca-tools --with-openca-user=openca --with-openca-group=openca --with-openca-group=openca
[root@vbird openca-tools-1.3.0]#make && make install
7.安装openca-base
[root@vbird openca] # tar -zxvf openca-base-1.5.0.tar.gz
[root@vbird openca] # cd openca-base-1.5.0
[root@vbird openca-base-1.5.0]#
./configure --prefix=/usr/local/openca-base --with-openssl-prefix=/usr/local/openssl/ --with-db-type=mysql --with-db-host=localhost --with-db-port=3306 --with-httpd-fs-prefix=/usr/local/apache2 --with-htdocs-fs-prefix=/usr/local/apache2/htdocs/pki --with-httpd-user=daemon --with-httpd-group=daemon --with-openca-user=openca --with-openca-group=openca --with-openca-tools-prefix=/usr/local/openca-tools
[root@vbird openca-base-1.5.0]#make
[root@vbird openca-base-1.5.0]#make install-online
[root@vbird openca-base-1.5.0]#make install-offline
cd /usr/local/openca-base/etc/openca
./configure_etc.sh
cd /usr/local/openca-base/var/openca/log/
chown -R daemon:daemon /usr/local/openca-base/var
chown -R daemon:daemon /usr/local/openca-base/etc
启动openca服务
/usr/local/openca-base/etc/init.d/openca starts
报错解决:
错误1.Building (openca::openssl) ... ERROR::Can not build module报错
解决:openssl的路径 --with-openssl-prefix=路径
错误2:
OpenCA Error: Server is not online or does not accept requests (/usr/local/openca-base/var/openca/tmp/openca_socket - /usr/local/openca-base/var/openca/tmp/openca_socket). 0
一:检查mysql和openca服务是否启动
二:检查/usr/local/openca-base/etc/openca/config.xml这个文件中
<option>
<name>db_user</name>
<value>openca</value>
</option>
<option>
<name>db_passwd</name>
<value>openca</value>
</option>
这个文件中的用户和密码是否正确和openca编辑使用是否是该用户
三:上面检查完毕查看/usr/local/openca-base/var/openca/log/stderr.log这个日志的报错应该会是:
OpenCA: General error trapped 700: The compilation of the command cmdAdvanced_csr
failed. Can't use an undefined value as an ARRAY reference at /usr/local/openca-
base/lib/openca/functions/mail-utils.lib line 374.<br>
Compilation failed in require at /usr/local/openca-base/etc/openca/openca_start l
ine 66.
解决方法:这个
/usr/local/openca-base/lib/openca/perl_modules/perl5/OpenCA/DBI.pm
DBI.pm在1.5.0换成openca-base-1.3.0.tar.gz中安装的DBI.pm就应该可以解决了
还有网上说的一种报错说在官网下载1.1.1补丁个人说:是没有的,官方不提供那个补丁包了 所以不要一直搜了 看看日志报什么错 具体在分析和解决
资源下载:文档源码包的连接