Compiling Apache 2.2 with SNI on Ubuntu
From ZeePal Documentation
Contents |
Prerequisites
- APT Packages: "zlib1g-dev" & "libssl-dev"
Downloading OpenSSL and Apache2 Source Code
- Login: To the Server
- Run: "sudo apt-get source apache2 openssl"
Enabling SNI in OpenSSL Source
- Change Directory: "./openssl-0.9.8g"
- Run: "sudo ./config --prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib enable-tlsext no-sslv2"
- Watch & Wait: For OpenSSL to be configured ready for compiling, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
- Run: "sudo make depend"
- Watch & Wait: For OpenSSL's Dependancys to be Compiled, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
- Run: "sudo make"
- Watch & Wait: For OpenSSL to be Compiled, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
- Run: "sudo make install"
- Watch & Wait: For OpenSSL to be installed, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
Enabling SNI in Apache 2.2
- Save: File:Httpd-2.2.x-sni.patch on the server
- Disclosure: I take no credit for work on the file above.
- Reference: "https://sni.velox.ch/misc/httpd-2.2.x-sni.patch"
- Run: "sudo patch --verbose -d apache2-2.2.11/modules/ssl/ -i httpd-2.2.x-sni.patch"
- Watch: For errors and repair manually (You shouldn't continue if errors aren't repaired)
- Change Directory: "./apache2-2.2.11"
- Run: "sudo ./configure --enable-layout=Debian -enable-ssl=shared --enable-mods-shared=all --enable-deflate --with-program-name=apache2"
- Watch & Wait: For Apache2 to be configured ready for compiling, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
- Run: "sudo make"
- Watch & Wait: For Apache2 to be compiled, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
- Run: "sudo make install"
- Watch & Wait: For Apache2 to be installed, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
- Save: "LoadModule log_config_module /usr/lib/apache2/modules/mod_log_config.so" in a new file called: "/etc/apache2/mods-available/log.conf"
- Run: "do ln -s /etc/apache2/mods-available/log.conf /etc/apache2/mods-enabled/log.conf"
- Edit: "/etc/apache2/apache2.conf"
- Add: "NameVirtualHost *:443" just before "Include /etc/apache2/sites-enabled/"
- Run: "sudo /etc/init.d/apache2 stop"
- Wait: For Apache 2.2 to stop
- Run: "sudo /etc/init.d/apache2 start"
- Watch & Wait: For Apache2 to be started, Watch for errors and repair manually (You shouldn't continue if errors aren't repaired)
Notes
May not need to recompile OpenSSL 0.9.8g as it seems it comes precompiled with "enable-tlsext".
