useradd openca
to install required packages. Also we need some Perl modules. I am using the CPAN directory for this. You may be able to find a CentOS repository with the according rpms.yum install gpg ftp links make unzip openssl-devel expat-devel httpd mod_ssl mysql-server
perl -MCPAN -e shell install CGI::Session install Convert::ASN1 install Digest::MD5 install Digest::SHA1 install Encode::Unicode install IO::Socket::SSL install IO::Stringy install MIME::Base64 install MIME::Lite install MIME::Tools install MailTool install Net::Server install URI install XML::Twig install XML::SAX::Base install Digest::HMAC install Authen::SASL install NET::SSLeay install G/GU/GUIDO/libintl-perl-1.20.tar.gz //Maybe changed you have to find the latest one --> tape: install i libintl-perl install G/GB/GBARR/perl-ldap-0.4001.tar.gz //Maybe changed you have to find the latest one --> tape: install i perl-ldap quit
/etc/hosts
Change this file and add your machine hostname like this:
# Do not remove following line,or various programs #that require network Functionality will fail 127.0.0.1 localhost.localdomain localhost X.X.X.X ra.marwan.ma ra
/etc/httpd/conf/httpd.conf
Change this line to your hostname:
ServerName ra.marwan.ma
Fix a CentOS MySQL bug: editmysql_install_db
/etc/my.cnf
In the section mysqld add the following line:
Start daemon:skip-bdb
Set root password:service mysqld start
Create database and change permissions for openca:mysqladmin -u root password 'new_password' mysqladmin -u root -h your_hostname password 'new_password'
I don't think it's necessary but you can restart MySQL:mysql -p create database openca; GRANT create,drop,select,delete,insert,update ON openca.* TO 'openca_u'@'localhost' IDENTIFIED by 'database_password'; FLUSH privileges; exit;
service mysqld restart
Now for the OpenCA ! application itself. Download and uncompress package:wget ftp://serv1.marwan.ma/pub/packages/openca-tools-1.3.0.tar.gz tar xvzf openca-tools-1.3.0.tar.gz cd openca-tools-1.3.0./configure –-prefix=/opt/openca –-exec-prefix=/opt/openca –-with-openca-prefix=/opt/openca –-with-openca-user=openca –-with-openca-group=openca
make make install
Configure and install OpenCA : We install openca in the directorywget ftp://serv1.marwan.ma/pub/packages/openca-base-1.1.0.tar.gz tar xvzf openca-base-1.1.0.tar.gz
/opt/openca
Now, depending on whether you want to install the offline or online service you have to executecd openca-base-1.1.0./configure –-prefix=/opt/openca –-exec-prefix=/opt/openca –-with-openca-prefix=/opt/openca –-with-openca-user=openca –-with-openca-group=openca -–with-module-prefix=/opt/openca/modules –with-web-host=ra.marwan.ma --with-httpd-user=apache –-with-httpd-group=apache -–with-openca-tools-prefix=/opt/openca
make
ormake install-offline
Now we install a few helper scripts (it seems there is a bug and they are not installed by default):make install-online
Edit: After installing the above command also does not work anymore. You'll have to copy the scripts in this directory manually tocd src/scripts make install
/opt/openca/bin and change owner and permissions.
/etc/init.d/openca and put the following in it:
#!/bin/sh
#
# chkconfig: 345 75 55
# description: OpenCA Server
cd /opt/openca/etc/openca || exit 1
case "$1" in
start)
echo -n "Starting OpenCA ... "
./openca_start
echo OK
;;
stop)
echo "Shutting down OpenCA ... "
./openca_stop
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
Now the install part of the OpenCA package is finished. Now we have to go to the configuration step.chown -R apache:apache /opt/openca/var/openca/log/
config.xml (You can downlaod the files andthen changes the values) And the country the CA is located in:<name>ca_organization</name> <value>MARWAN CA</value>
These two values are the first two tokens of the DN a certificate of this CA is going to have.<name>ca_country</name> <value>MA</value>
What is the ca email address?<name>sendmail</name> <value>/usr/lib/sendmail -t </value>
A link to your CA's policy:<name>service_mail_account</name> <value>ca@marwan.ma</value>
The value must be the same as indicated in the CP/CPS, be careful!!<name>policy_link</name> <value>http://ca.marwan.ma/pki/pub/policy.html</value>
<option>
<name>dbmodule</name>
<!-- you can use DB or DBI -->
<value>DBI</value>
</option>
<option>
<name>db_type</name>
<value>mysql</value>
</option>
<option>
<name>db_name</name>
<value>openca</value>
</option>
<option>
<name>db_host</name>
<value>ra.marwan.ma</value>
</option>
<option>
<name>db_port</name>
<value>3306</value>
</option>
<option>
<name>db_user</name>
<value>openca_u</value>
</option>
<option>
<name>db_passwd</name>
<value>database_password</value>
</option>
<option>
<name>db_namespace</name>
<!--
a namespace is prefix in front of every table
Example: table user1
==>
select * from user1.certificate;
This is not required for MySQL, PostgreSQL and IBM DB2.
Nevertheless all supported database can use such namespaces
and it is the default behaviour of Oracle. Oracle uses as
namespace usually the name of the database.
-->
<value>openca</value>
</option>
We need activate LOAS (Levels of Authentication):
<option>
<name>USE_LOAS</name>
<value>yes</value>
</option>
Now for a very important part, the dataexchange. For the Ofline machine comment the "no dataexchange configuration" and uncomment the "acts as CA only" section. For the Online machine also comment the "no dataexchange configuration" but uncomment the "acts as RA only" section.
We also have to configure the way we exchage data between Offline and Online machine (will add details later).
<option>
<name>dataexchange_device_up</name>
<value>/tmp/fd0</value>
</option>
<option>
<name>dataexchange_device_down</name>
<value>/tmp/fd0</value>
</option>
<option>
<name>dataexchange_device_local</name>
<value>/tmp/openca_local</value>
</option>
You can dowmlaod the config.xml for the 2 machine (they will be availaibles as soon as possible) :
When you are finished editingin CA Machine wget ftp://serv1.marwan.ma/pub/packages/config_CA.xml mv /opt/openca/etc/openca/config.xml /opt/openca/etc/openca/config_back.xml mv config_CA.xml /opt/openca/etc/openca/config.xml in RA Machine wget ftp://serv1.marwan.ma/pub/packages/config_RA.xml mv /opt/openca/etc/openca/config.xml /opt/openca/etc/openca/config_back.xml mv config_RA.xml /opt/openca/etc/openca/config.xml
config.xml you have to apply the content of config.xml to the appropriate templates to create the "real" config files:
cd /opt/openca/etc/openca ./configure_etc.sh
Point your browser toservice openca start
https://your_hostname/ca. You will be prompted to trust a server certificate. This certificate was created when installing the apache package and it is self-signed. We will exchange it later. Trust it for now.
Login with the default login/password root/root.
At this stage if every think is Ok you shoud access the CA interface of OpenCA
Next configuration will be availaible as soon as possible !!!
| I | Attachment | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|
| |
config.xml | manage | 32.6 K | 2011-01-21 - 15:33 | EumedUser |