Cacti

cacti http to https login redirection

배움나눔 2013. 4. 8. 14:40

출처 : http://dikehtonon.blogspot.kr/2012/03/cacti-http-to-https.html

원본 :

Though may not be required for most users to use Secured HTTP for their Cacti System, some may be required as a basic policy requirements especially for financial institutions. The simple PHP code below will redirect all http request to https, this is also the simplest method that will do the job compared to other methods that you may find on the web.

------------------------------------------------------------------------------------

<?php
if ($_SERVER['SERVER_PORT']!=443)
{
$url = "https://". $_SERVER['SERVER_NAME'] . ":443".$_SERVER['REQUEST_URI'];
header("Location: $url");
}
?>

------------------------------------------------------------------------------------

1. Edit the index.php located on cacti's root folder

#cd /var/www/cacti
#vi index.php

copy the PHP code above and insert it on the first line of index.php

2. Exit from vi saving the changes and restart httpd service

#service httpd restart

 

cactiez 0.8

Edit the index.php located on cacti's root folder

#cd /var/www/html/index.php
#vi index.php