Wednesday, July 27, 2016

Configuring Centos with Apache , Mysql and PHP

http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installation/#C6

before installing apache, fix the hostname, /etc/hosts file

=================================================
Install Apache
=================================================
# yum install httpd
LISTEN 80 , change it to any port you like
# firewall-cmd --add-service=http
# firewall-cmd --permanent --add-port=3221/tcp
# firewall-cmd --reload
# systemctl restart httpd.service
# systemctl start httpd.service
# systemctl enable httpd.service
=================================================
Install PHP
=================================================
# yum install php
# systemctl restart httpd.service
test php
# echo -e ""  > /var/www/html/phpinfo.php
# php /var/www/html/phpinfo.php

=================================================
Install MariaDB
=================================================
# yum install mariadb-server mariadb
# systemctl start mariadb.service
# systemctl enable mariadb.service
# firewall-cmd --add-service=mysql
secure mariadb using below
# /usr/bin/mysql_secure_installation

=================================================
phpmyadmin
=================================================
http://www.liquidweb.com/kb/how-to-install-and-configure-phpmyadmin-on-centos-7/


rpm -iUvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum -y update

yum -y install phpmyadmin

vim /etc/httpd/conf.d/phpMyAdmin.conf
Require ip 127.0.0.1

Allow from 127.0.0.1

Require ip 127.0.0.1

Allow from 127.0.0.1

Then exit and save the file with the command :wq .

Restart Apache:

systemctl restart httpd

=================================================
Hardening Centos Apache
=================================================
disable http track and trace methods
=================================================
in /etc/httpd/conf/httpd.conf

TraceEnable off
ServerTokens ProductOnly
ServerSignature Off

The above two lines are to hide server version etc..

Thursday, May 19, 2016

Using grep to find multiple keywords in multiple directories recursively

Using grep to find multiple keywords in multiple directories recursively

using the following command you will be able to find multiple keywords in multiple directories recursively

Command:
egrep -rwn

Example:
egrep -rwn '64.exe|m64.exe|s64.exe|s.aspx|sm.exe|ps.exe|vnc.exe|sm.bat|bruter.exe|kiss.exe|pl.exe|A.exe|xcmd.exe|share.exe|Unet.exe|splitter.exe|m32.exe|lsass.exe|wsc-x64.exe|psexec.exe|w.aspx|wce.exe|sexe.cab' /home/security/


Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More