...
To make browsing to the up.time UI easy for users, have it listen on the default up.time UI port, 9999, as well as the typical HTTP and HTTPS ports, 80 and 443.
Above the line "Listen 9999", add the following two lines:
Code Block |
---|
Listen 80 |
...
Listen 443 |
To handle requests on each of these ports, 80, 443, and 9999, and redirect (actually rewrite) them properly, we will leverage the mod_rewrite.so module, so we need to enable it.
On Windows installations, uncomment the following two lines in httpd.conf.
Code Block |
---|
LoadModule rewrite_module modules/mod_rewrite.so |
...
LoadModule ssl_module/mod_ssl.so |
On Linux installations, the mod_rewrite.so module is not bundled with up.time, so it is necessary to download and copy the mod_rewrite.so file from the bottom of this article to the <uptime_dir>/apache/modules directory. Then, in httpd.conf, add the following line after "# LoadModule foo_module modules/mod_foo.so". If issues are experienced with the version of mod_rewrite.so attached, try creating a symlink to the mod_rewrite.so file provided by the Linux distribution instead.
Code Block |
---|
LoadModule rewrite_module modules/mod_rewrite.so |
Finally, the last part is to add entries in httpd.conf that will rewrite the requests as HTTPS. At the bottom of the httpd.conf file, add these lines, changing <uptime_dir> to the directory of your up.time installation:
Code Block | ||
---|---|---|
| ||
SSLMutex default |
...
SSLPassPhraseDialog "exec:<uptime_dir>/apache/conf/passphrase.cmd" |
...
SSLSessionCache none |
...
<VirtualHost *:80> |
...
RewriteEngine on |
...
RewriteCond %{SERVER_PORT} !^443$ |
...
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [NC,R,L] |
...
</VirtualHost> |
...
<VirtualHost *:443> |
...
SSLEngine on |
...
DocumentRoot "<uptime_dir>/GUI" |
...
SSLCertificateFile "<uptime_dir>/apache/conf/uptime_ssl_server.crt" |
...
SSLCertificateKeyFile "<uptime_dir>/apache/conf/uptime_ssl_server.key"\t |
...
</VirtualHost> |
...
<VirtualHost *:9999> |
...
RewriteEngine on |
...
RewriteCond %{SERVER_PORT} !^443$ |
...
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [NC,R,L] |
...
</VirtualHost> |
Update uptime.conf
Open the <uptime_dir>/uptime.conf file for editing and change the httpContext parameter (which begins with "httpContext=http://") to relfect the use of SSL:
Code Block | ||
---|---|---|
| ||
httpContext=https://<Server_Hostname>:9999 |
Restart the services
For the changes to take effect, restart the up.time Data Collector and up.time Web Server on Windows or uptime_core and uptime_httpd on Linux.Windows:
Restart the
Starting and Stopping up.time Data Collector" service.
Restart the "up.time Web Server" service.
Linux:
...