<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openssl.org/index.php?action=history&amp;feed=atom&amp;title=User%3AJohnjs</id>
	<title>User:Johnjs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openssl.org/index.php?action=history&amp;feed=atom&amp;title=User%3AJohnjs"/>
	<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=User:Johnjs&amp;action=history"/>
	<updated>2026-06-11T04:32:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://wiki.openssl.org/index.php?title=User:Johnjs&amp;diff=2380&amp;oldid=prev</id>
		<title>Johnjs: Compiling a Static OpenSSL FIPS Capable Apache2 httpd-2.4.18</title>
		<link rel="alternate" type="text/html" href="https://wiki.openssl.org/index.php?title=User:Johnjs&amp;diff=2380&amp;oldid=prev"/>
		<updated>2016-04-04T15:17:33Z</updated>

		<summary type="html">&lt;p&gt;Compiling a Static OpenSSL FIPS Capable Apache2 httpd-2.4.18&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Compiling a Static OpenSSL FIPS Capable Apache2 httpd-2.4.18  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install the latest FIPS OpenSSL (below steps)&lt;br /&gt;
&lt;br /&gt;
In your working directory /home/username&lt;br /&gt;
&lt;br /&gt;
Download openssl-fips-2.0.12.tar.gz &lt;br /&gt;
			&lt;br /&gt;
gunzip openssl-fips-2.0.12.tar.gz&lt;br /&gt;
&lt;br /&gt;
tar -xvf openssl-fips-2.0.12.tar&lt;br /&gt;
&lt;br /&gt;
cd openssl-fips-2.0.12&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
./config&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
Download openssl-1.0.2g.tar.gz&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
gunzip openssl-1.0.2g.tar.gz&lt;br /&gt;
&lt;br /&gt;
tar -xvf openssl-1.0.2g.tar&lt;br /&gt;
&lt;br /&gt;
cd openssl-1.0.2.g&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
./config shared fips --with-fipslibdir=/usr/local/ssl/fips-2.0/lib/&lt;br /&gt;
&lt;br /&gt;
make &lt;br /&gt;
&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
in /usr/local/ssl/lib there will be two &amp;quot;linked&amp;quot; files&lt;br /&gt;
&lt;br /&gt;
libcrypto.so.1.0.0 -&amp;gt; libcrypto.so&lt;br /&gt;
&lt;br /&gt;
libssl.so.1.0.0 -&amp;gt; libssl.so&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
copy the files (not linked libcrypto.so libssl.so) to&lt;br /&gt;
a new shared directory /usr/local/ssl/lib/shared&lt;br /&gt;
recreate the links in shared to libcrypto.so and libssl.so&lt;br /&gt;
			&lt;br /&gt;
ln -s /usr/local/ssl/lib/shared/libcrypto.so.1.0.0 /usr/local/ssl/lib/shared/libcrypto.so&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/local/ssl/lib/shared/libssl.so.1.0.0 /usr/local/ssl/lib/shared/libssl.so&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
Remove the links in /usr/local/ssl/lib&lt;br /&gt;
&lt;br /&gt;
rm libcrypto.so&lt;br /&gt;
&lt;br /&gt;
rm libssl.so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The shared directory is used for application linking&lt;br /&gt;
A direct compile for a FIPS application using: -L/usr/local/ssl/lib&lt;br /&gt;
Will fail if the links are still in /usr/local/ssl/lib&lt;br /&gt;
&lt;br /&gt;
in /home/username (your working directory)&lt;br /&gt;
&lt;br /&gt;
Download httpd.2.4.18.tar.gz&lt;br /&gt;
&lt;br /&gt;
Download pcre-8.38.tar.gz&lt;br /&gt;
&lt;br /&gt;
Download apr-1.5.2.tar.gz&lt;br /&gt;
&lt;br /&gt;
Download apr-util-1.5.4.tar.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
gunzip httpd.2.4.18.tar.gz&lt;br /&gt;
&lt;br /&gt;
gunzip pcre-8.38.tar.gz&lt;br /&gt;
&lt;br /&gt;
gunzip apr-1.5.2.tar.gz&lt;br /&gt;
&lt;br /&gt;
gunzip apr-util-1.5.4.gz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install PCRE&lt;br /&gt;
&lt;br /&gt;
tar -xvf pcre-8.38.tar&lt;br /&gt;
&lt;br /&gt;
cd /home/username/pcre-8.38&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/usr/local/pcre&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Apache2(httpd) with apr&lt;br /&gt;
&lt;br /&gt;
tar -xvf httpd.2.4.18.tar&lt;br /&gt;
&lt;br /&gt;
cd httpd.2.4.18&lt;br /&gt;
&lt;br /&gt;
cd srclib (subdirectory)&lt;br /&gt;
&lt;br /&gt;
cp /home/username/apr-1.5.2.tar .&lt;br /&gt;
&lt;br /&gt;
cp /home/username/apr-util-1.5.4.tar .&lt;br /&gt;
&lt;br /&gt;
tar -xvf apr-1.5.2.tar&lt;br /&gt;
&lt;br /&gt;
tar -xvf apr-util-1.5.4.tar&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create two links - they are needed when apache compiles&lt;br /&gt;
&lt;br /&gt;
ln -s apr-1.5.2 apr&lt;br /&gt;
&lt;br /&gt;
ln -s apr-util-1.5.4 apr-util&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cd .. (back to /home/username/httpd.2.4.18)&lt;br /&gt;
&lt;br /&gt;
NOTE: &lt;br /&gt;
&lt;br /&gt;
the --enable-ssl-staticlib-deps and --enable-mods-static=ssl&lt;br /&gt;
are to compile the Openssl module STATIC not shared. &lt;br /&gt;
If you leave them out, it will properly create a working apache2&lt;br /&gt;
server EXCEPT when you enable the SSLFIPS on in httpd.conf, then&lt;br /&gt;
apache2 will not start and you will get a FIPS fingerprint error&lt;br /&gt;
in the logs/error_log file.&lt;br /&gt;
&lt;br /&gt;
Procedure below is to compile OpenSSL as a static module in apache2&lt;br /&gt;
&lt;br /&gt;
The two export(s) below sets the proper FIPS fingerprint variables.&lt;br /&gt;
&lt;br /&gt;
The configure compiles a STATIC Openssl (mod_ssl.so) into Apache2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
export CC=/usr/local/ssl/fips-2.0/bin/fipsld&lt;br /&gt;
&lt;br /&gt;
export FIPSLD_CC=/usr/bin/gcc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/usr/local/apache2 --with-mpm=prefork --enable-ssl --with-ssl=/usr/local/ssl --enable-ssl-staticlib-dep --enable-mods-static=ssl --with-pcre=/usr/local/pcre --with-included-apr&lt;br /&gt;
						&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I need PHP(with mysql) - so I built the share module libphp5.so&lt;br /&gt;
and placed a copy in /usr/local/apache2/modules/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the httpd.conf file &amp;quot;Loadmodule ssl_module modules/mod_ssl.so&amp;quot; &lt;br /&gt;
has to be commented out. In a shared version it must be active.&lt;br /&gt;
The --with-mpm=prefork option allows me to use the system provided &lt;br /&gt;
PHP5 module, the &amp;quot;event&amp;quot;(threaded) version didn't load PHP properly.&lt;br /&gt;
There are some other changes needed in the httpd.conf file (on internet)&lt;br /&gt;
on allowing Apache2 to recognize the .php extension.&lt;br /&gt;
&lt;br /&gt;
to start: /usr/local/apache2/bin/apachectl start&lt;br /&gt;
&lt;br /&gt;
to stop:  /usr/local/apache2/bin/apachectl stop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Start apache and confirm it is running.&lt;/div&gt;</summary>
		<author><name>Johnjs</name></author>
	</entry>
</feed>