Thursday, May 14, 2015

Cacti web access redirect from http to https

By default cacti can access using both http and https traffic. But due to the security reasons it should recommended to access cacti via https. Therefore you should change the index.php which is located in /usr/share/cacti folder.

So here is the tip on how to deploy in your Linux Machine:

1. Edit the index.php located on cacti's root folder
#cd /usr/share/cacti
#vi index.php

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

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

Then restart the apache server.
Open your cacti using http://your-server-ip/cacti, this will redirect you to https://your-server-ip/cacti and ask you to verify and confirm web certificate on the first use. Just proceed and complete the process and you are good to go.

Wednesday, May 13, 2015

Secure connection failed accessing Apache 2.4 web server by using Windows 7 machine


Error : When Windows 7 user try to access web site running on Apache 2.4 Web server it produce SSL Secure connection failure error message on the browser.

I have logged into the server and then check the ssl.conf file. There it found the below configuration in the file.
# SSL Protocol support:
# List the enable protocol levels with which clients will be able to
# connect. Disable SSLv2 access by default:
#SSLProtocol all -SSLv2
SSLProtocol all -SSLv2 -SSLv3

It has by default disabled the SSL v2 and SSL v3 support. Then I have enable the SSL v3 support by editing Above line. It's seems like this after the changes.

# SSL Protocol support:
# List the enable protocol levels with which clients will be able to
# connect. Disable SSLv2 access by default:
SSLProtocol all -SSLv2
#SSLProtocol all -SSLv2 -SSLv3

With the changes then restart the apache server. It has solved the problem.

Friday, February 6, 2015

VOIP server migration issues

I have migrated FreePBX 2.10 32 bit server to FreePBX 2.11 64 bit server. Then restored the backup. But after the reboot SIP does not response properly to its clients.
Check the asterisk logs and found some warning messages. It state that some modules can not be found.
loader.c: Error loading module 'pbx_config.so': /usr/lib/asterisk/modules/pbx_config.so: cannot open shared object file: No such file or directory
loader.c: Error loading module 'chan_local.so': /usr/lib/asterisk/modules/chan_local.so: cannot open shared object file: No such file or directory
loader.c: Error loading module 'res_mwi_blf.so': /usr/lib/asterisk/modules/res_mwi_blf.so: cannot open shared objec t file: No such file or directory loader.c: Error loading module 'pbx_config.so': /usr/lib/asterisk/modules/pbx_config.so: cannot open shared object file: No such file or directory

I have found that those modules are in the /usr/lib64/asterisk/ modules directory. Therefore I need to change the asterisk module directory path. It has located in /etc/asterisk/asterisk.conf file. Once the asterisk.conf file changed reboot the server. Then above errors are gone and server has responded to its clients properly.

The second issue was mysql connection error for CDR reports. I have checked the cdr configuration file for mysql. It is in /etc/asterisk/cdr_mysql.conf and it used previous server credentails. The new mysql user details can be taken from /etc/freepbx.conf and then it just a matter of copy and paste correct credentails to cdr_mysql.conf file.

Once you have migrated please keep continuous monitoring for at least one day. Cheers......

Thursday, August 28, 2014

BackupPC installation guide on Debian

Best and easiest way to install and configure BackupPC, proceed with the Debain OS. Therefore install debian and then change the source list as follows.

vi /etc/apt/sources.list
Comment the CD-ROM source from the source list and then add extra source. Then source list should be look as below.

#
# deb cdrom:[Debian GNU/Linux 7.6.0 _Wheezy_ - Official amd64 DVD Binary-1 20140712-14:11]/ wheezy contrib main
#deb cdrom:[Debian GNU/Linux 7.6.0 _Wheezy_ - Official amd64 DVD Binary-1 20140712-14:11]/ wheezy contrib main
deb http://security.debian.org/ wheezy/updates main contrib
deb-src http://security.debian.org/ wheezy/updates main contrib
deb http://ftp.us.debian.org/debian stable main contrib

Last line of the list is generated through below link. You can use below link to generate source list that nearest to your country.

Then follow the below guide to install and configure the BackupPC and clients.


  • First update the debian server by using “apt-get update” command.
  • Then start the installation of backuppc with other dependency packages.
        • aptitude install backuppc rsync libfile-rsync-perl libfile-rsyncp-perl par2 bzip2
  • This will go through the BackupPC installation process and it will prompt some configuration details. Make sure those things are written down in a paper.
  • Then you have finished the installation you may access the backuppc via the web interface.

Configure the Backup time and schedule as required. You must need to specify the Share folder details, User, and Samba share user password in Xfer configuration. This can be done to individual PCs or for the whole system.



Window client Configuration

  • Create a user called “backuppc”
  • Share the folders with the share name “Backup”
  • Then permit the backuppc user to access the share folders.
Above are common configuration for all windows distribution. But for the Windows 7 you need to edit the registry and add new value.



  • Click “Start” Button –» All Programs –» Accessories
  • Right mouse click on “Command Prompt” –» choose “Run as administrator” –» Continue
  • Type “regedit” and press “Enter”, this opens the Registry editor with administrative privileges.
  • Navigate to the following folder:“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System”
  • Add a new “DWORD (32-bit) Value” called “LocalAccountTokenFilterPolicy” (without the quotes).
  • Change the value from “0” to “1”

Finally reboot the Client PC. That'll be all and you can make backup successfully.





NT_STATUS_BAD_NETWORK_NAME error in BackupPC via samba

Error :
NT_STATUS_BAD_NETWORK_NAME error will generate when you try to backup Windows 8 client to BackupPC server via the SMB protocol.

Root cause :
If you browse the Windows 8 shared folder through another machine with in the network you will not see the  Shared folder that you have configured in the BackupPC under the “SmbShareName”. This is the root cause for the above error.

Solution :
http://www.addictivetips.com/windows-tips/windows-8-file-sharing-share-users-system-folders-on-network/

Use above link to share the folder correctly.

Thursday, April 10, 2014

Cacti Graph does not display

Problem :

Suddenly cacti has stopped drawing graph.

Analysis :

Log into the server and checked the cacti log.
Cacti has generated errors in /usr/share/cacti/log/cacti.log


Error log in cacti.

04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (128, 'mem_free', '2014-04-09 16:40:03', '2554360')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (127, 'load_5min', '2014-04-09 16:40:03', '0.00')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (126, 'load_15min', '2014-04-09 16:40:03', '0.00')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (123, 'cpu_system', '2014-04-09 16:40:03', '34305')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (122, 'cpu_nice', '2014-04-09 16:40:03', '19')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (58, 'traffic_out', '2014-04-09 16:40:03', '348607')'
04/09/2014 04:40:03 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1017', SQL:"insert into poller_output (local_data_id, rrd_name, time, output) values (58, 'traffic_in', '2014-04-09 16:40:03', '3948566')'

Root cause & Resolution :

The table “poller_output” in cacti database has corrupted. I've logged into the database and try to repair the table. Issue below commands.

Mysql > use cacti;
mysql > truncate table poller_ouput;

Then restarted the services apache and mysql. After a while graph is displayed and draw accordingly.

Tuesday, March 18, 2014

mod_rewrite does not overwrite properly

If your server does not rewrite properly then check the SELINUX property. This is for CentOS server. 
If it's set to permissive or enable then apache mod_write does not work properly. 

You should set the selinux to disabled mod and reboot the server. Then it should work fine.