Tuesday, January 20, 2015

tar: Removing leading `/' from member names

When I write a script to tar a folder, I am getting the following error

tar: Removing leading `/’ from member names

Here is the script line /bin/tar czf “/data1/backups/$DATE/html_$DATE.tar.gz” /var/www/html/

Solution: Use the option P, will solve this error

New Code : /bin/tar czPf “/data1/backups/$DATE/html_$DATE.tar.gz” /var/www/html/

Wednesday, January 7, 2015

http_client.h:26:25: error: openssl/ssl.h: No such file or directory

I got this error while installing Skipfish on Centos

http_client.h:26:25: error: openssl/ssl.h:No such file or directory

Solution is to install the following packages
 yum install pcre-devel openssl-devel libidn-devel libidn2-devel

How to install skipfish on centos

Skipfish is a good tool for website vulnerability checking

Login to server
cd /opt
wget http://skipfish.googlecode.com/files/skipfish-1.01b.tgz
tar zxvf skipfish-1.01b.tgz

yum install pcre-devel openssl-devel libidn-devel libidn2-devel
cd skipfish
make
cp dictionaries/default.wl skipfish.wl
./skipfish -o output_folder http://www.example.com

you’ll want to less README to understand all the options.

Monday, January 5, 2015

PHP mail issue

From CLI (server terminal) I could send mails using php
ie:
[root@ip-IP html]# php sendmail.php (It is working fine)
But when i try http://IP/sendmail.php mail won’t work.
I am using postfix, using a gmail account to relay mails.
In /var/log/maillog I can see the following
Jan 5 07:27:38 ip-ipaddress sSMTP[9847]: Creating SSL connection to host
Jan 5 07:27:38 ip-ipaddress sSMTP[9847]: SSL not working: unknown protocol (0)
Jan 5 07:27:38 ip-ipaddress sSMTP[9847]: Cannot open smtp.gmail.com:587
Jan 5 07:32:03 ip-ipaddress sSMTP[9850]: Creating SSL connection to host
Jan 5 07:32:03 ip-ipaddress sSMTP[9850]: SSL not working: unknown protocol (0)
Jan 5 07:32:03 ip-ipaddress sSMTP[9850]: Cannot open smtp.gmail.com:587
Jan 5 07:54:12 ip-ipaddress sSMTP[9893]: Creating SSL connection to host
Jan 5 07:54:12 ip-ipaddress sSMTP[9893]: SSL not working: unknown protocol (0)
Jan 5 07:54:12 ip-ipaddress sSMTP[9893]: Cannot open smtp.gmail.com:587
How I fix this issue:
vi /etc/php.ini
Edit sendmail_path to
sendmail_path = /usr/sbin/sendmail.postfix -t -i
/etc/init.d/httpd restart
This solved my issue.

http://skynetclouds.com/blog/cant-send-php-mail-using-browser-can-send-via-cli/