Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday 22 January 2017

How to Configure Proftpd on RHEL/CentOS 6x

How to Configure Proftpd on RHEL/CentOS 6x


Q. What is Proftpd?

-- ProFTPD is an FTP Server. ProFTPD is Free & open-source software, compatible with Unix-like systems and Microsoft Windows (via Cygwin). Along with vsftpd, Pure-FTPd and ProFTPD is among the most popular FTP servers in Unix-like environments today.

Step: 1. Install the EPEL Repository :

# yum -y install epel-release

Step: 2. Install Proftpd :

# yum -y install proftpd

Step: 3. Restart Proftp Service :

# service proftpd restart
# chkconfig proftpd on

Step: 4. Configure Proftpd :

# vi /etc/proftpd.conf

ServerName     "Give Hostname"

MasqueradeAddress       192.168.100.10    # Server IP Address
PassivePorts 60000 65535

# For Extension Retriction :

PathAllowFilter "\\.(jpg|jpgeg|mpeg|mpg|mp3)$"

or

PathDenyFilter "\\.(pdf|ini)$"

# For Upload File Size Limit :

MaxStoreFileSize  25 Mb
MaxRetrieveFileSize  25 Mb

# Jailing Directory :
<Anonymous /var/ftp/pub>
AnonRequirePassword       on
User                                                ftp
Group                                            ftp
RequireValidShell                   off
<Directory *>
<Limit WRITE>
    AllowAll
</Limit>
</Directory>
</Anonymous>

-- Save & Quit (:wq)

# service proftpd restart

Note: If proftpd service fails to start bind it in hosts file.

# vi /etc/hosts

Add the <machine ip> <machine name>

Step: 5. Add a System User To Access FTP Server :

# useradd -d /home/koushik koushik
# passwd koushik

-- Give Password.

Go To Proftp Configuration File :

# vi /etc/proftpd.conf

-- At the End Add those Lines :

<Anonymous /var/ftp/pub>
AnonRequirePassword       on
User                                                <username>
Group                                              ftp
RequireValidShell                     off
<Directory *>
<Limit WRITE>
          AllowAll
</Limit>
</Directory>
</Anonymous>

-- Save & Quit (:wq)

Step: 6. Change Server Level :

# vi /etc/pam.d/proftpd

-- Delete all & Add those Lines :

#%PAM-1.0
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth include system-auth
auth required pam_shells.so
account include system-auth
session include system-auth
session required pam_loginuid.so

-- Save & Quit (:wq)

Step: 7. Restart Proftpd Service :

# service proftpd restart
# chkconfig proftpd on

Step: 8. Proftp Configuration for Specific User & Directory :

# groupadd ftpusers

# useradd -d /var/www/html/domain.com -G ftp -g ftpusers -s /sbin/nologin username
# passwd username

-- Give Password.

Step: 9. Change Group :

# chown -Rf username:ftp domain.com (Directory name of the Site)

Example :

# useradd -d /var/www/html/domain.com -G ftp -g ftpusers -s /sbin/lologin ftpdomain
# passwd ftpdomain

-- Give Password.

# chown -Rf ftpdomain:ftp /var/www/html/domain.com

Step: 11. Testing Proftpd Server :

-- Install Filezilla & Test the FTP Server.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Sunday 15 January 2017

Install & Configure PowerDNS with MySQL on RHEL/CentOS 6x

Install & Configure PowerDNS with MySQL on RHEL/CentOS 6x


Q. What is PowerDNS?

-- PowerDNS is a DNS server, written in C++ and licensed under the GPL. It runs on most Unix derivatives. PowerDNS features a large number of different backends ranging from simple BIND style zonefiles to relational databases and load balancing/failover algorithms. A DNS recursor is provided as a separate program.

Step: 1. Install REMI and EPEL Repositories and Packages :

# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Step: 2. Installing MySQL Server :

# yum -y install mysql mysql-server

Step: 3. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on

# mysql_secoure_installation

Step: 4. Install Apache Server & PHP :

# yum -y install httpd httpd-devel php php-mcrypt php-pdo php-mysql php-devel php-gd \
    php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring gettext wget

Step: 5. Restart Apache Server :

# service httpd restart
# chkconfig httpd on

Step: 6. Install following two PEAR Packages :

# yum -y install php-pear-DB php-pear-MDB2-Driver-mysql

Step: 7. Create a Database for PowerDNS :

# mysql -u root -predhat

mysql> create database powerdns;
mysql> grant all privileges on powerdns.* to powerdns@'localhost' identified by 'password';
mysql> grant all privileges on powerdns.* to powerdns@'%' identified by 'password';

Step: 8. Create Tables :

mysql> use powerdns;
mysql> CREATE TABLE domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);

mysql> CREATE UNIQUE INDEX name_index ON domains(name);

mysql> CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);

mysql> CREATE INDEX rec_name_index ON records(name);
mysql> CREATE INDEX nametype_index ON records(name,type);
mysql> CREATE INDEX domain_id ON records(domain_id);

mysql> CREATE TABLE supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);

mysql> flush privileges;
mysql> quit;

Step: 9. Install & Configure PowerDNS :

# yum -y install pdns pdns-backend-mysql

# vi /etc/pdns/pdns.conf

#################################
# launch Which backends to launch and order to query them in
#
# launch=

launch=gmysql
gmysql-host=localhost
gmysql-user=powerdns
gmysql-password=password
gmysql-dbname=powerdns

#################################

-- Save & Quit (:wq)

# service pdns restart
# chkconfig pdns on

Step: 10. Install PowerAdmin :

# cd /var/www/html
# wget https://github.com/downloads/poweradmin/poweradmin/poweradmin-2.1.6.tgz
# tar xvfz poweradmin-2.1.6.tgz
# mv poweradmin-2.1.6 poweradmin
# cd poweradmin/inc/
# mv config-me.inc.php config.inc.php

Step: 11. Edit config.inc.php & make sure to change password you've specified in Step 7 :

# vi config.inc.php

Modify db_pass and session_key to your own values :

$db_host                = 'localhost';
$db_port                = '3306';
$db_user                = 'powerdns';
$db_pass                = 'password';
$db_name                = 'powerdns';
$db_type                = 'mysql';
$session_key            = 'Passw0rd';

-- Save & Quit (:wq)

# service httpd restart

Step: 12. Create PowerAdmin Account :

http://192.168.72.140/poweradmin

Click on Install -> Choose I prefer to proceed in English -> Go to Step2 -> Go to Step3 ->

Username: powerdns
Password: password
Database Type: MySQL
Hostname: 127.0.0.1
DB Port: 3306
Database: powerdns
PowerAdmin Administrator Password: Passw0rd

Go to Step4 -> This step is optional (SKIP) -> Go to Step5 -> Go to Step6 -> Go to Step7.

Note: Now we have finished the configuration, you should (must!) remove the directory "install/"

# cd /var/www/html/poweradmin
# mv install/ install_bak

Step: 13. Now you can login as Admin :

http://192.168.72.140/poweradmin

User: admin
Pass: Passw0rd

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

Sunday 8 January 2017

Install Maven3 on Ubuntu Server 14.04

Install Maven3 on Ubuntu Server 14.04


Q. What is Apache Maven?

-- Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Step: 1. Add the following line in sources.list file :

# vi /etc/apt/sources.list

deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main
deb-src http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main

-- Save & Quit (:wq)
       
Step: 2. Update the Systems & Install Maven3 :

# apt-get update --fix-missing
# apt-get install maven3
   
Step: 3. Create a Symbolic link :

# ln -s /usr/share/maven3/bin/mvn /usr/bin/mvn

Step: 4. Check mvn is Working :
   
# mvn -version

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_76, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-44-generic", arch: "amd64", family: "unix"

Step: 5. Running Maven Tools :

-- These are the most Common default lifecycle phases executed.



# mvn validate: Validate the project is correct & all necessary information is available.

# mvn compile: Compile the source code of the project.

# mvn test: test the compiled source code using a suitable unit testing framework.

# mvn package: take the compiled code & package it in its distributable format, such as a JAR.

# mvn integration-test: Process & Deploy the Package if necessary into an environment where
integration tests can be run.

# mvn verify: Run any checks to verify the package is valid and meets quality criteria.

# mvn install: Install the package into the local repository, for use as a dependency in other projects locally.

# mvn deploy: Done in an integration or release environment, copies the final package to the rem.


Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 

Sunday 1 January 2017

How to Install & Configure Linux Malware Detect (LMD) on CentOS 6x

How to Install & Configure Linux Malware Detect (LMD) on CentOS 6x


Q. What is LMD ?

-- Linux Malware Detect (LMD) is Malware detector & scanner for Linux, Designed for shared hosting environments. LMD is released under GNU GPLV2 license, it can be installed on cPanel WHM & Linux Environments with together other Detection tools such as ClamAV.

Prerequisite:

1. CentOS 6.x
2. Root Privileges.

Step: 1. Install Epel Repository :

# yum -y install epel-release

Step: 2. Install Mailx :

# yum -y install mailx

Step: 3. Install Linux Malware Detect (LMD) :

# cd /tmp
# wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
# tar -xzvf maldetect-current.tar.gz
# cd maldetect-1.5
# ./install.sh

Step: 4. Make a Symlink to the maldet Command in the /bin/ Directory :

# ln -s /usr/local/maldetect/maldet /bin/maldet
# hash -r

Step: 5. Configure Linux Malware Detect (LMD) :

# cd /usr/local/maldetect/
# vi conf.maldet

-- Enable Email Alert by Changing the value to '1' on Line No 16.

email_alert="1"

-- Type in Your Email Address on Line No 21.

email_addr="koushik@domain.com"

-- Use the ClamAV Scan binary as default Scan Engine because it provides a high-performance Scan on large file sets. Change value to '1' on Line No 114.

scan_clamscan="1"

-- Enable Quarantining to move Malware to the Quarantine Automatically During the Scan Process. Change value to '1' on Line No 180.

quarantine_hits="1"

-- Enable Clean based Malware Injections. Change value to '1' on Line No 185.

quarantine_clean="1"

-- Save & Quit (:wq)

Step: 6. Install ClamAV :

# yum -y install clamav clamav-devel

Step: 7. Update the ClamAV Virus Databases :

# freshclam

Step: 8. Testing LMD and ClamAV :

-- Go to the Web root Directory & Download some sample malware (eicar) with wget.

# yum -y install wget
# cd /var/www/html
# wget http://www.eicar.org/download/eicar.com.txt
# wget http://www.eicar.org/download/eicar_com.zip
# wget http://www.eicar.org/download/eicarcom2.zip

-- Scan the Web root Directory with the maldet.

# maldet -a /var/www/html

Step: 9. Check the Scan Report :

# maldet --report 161008-0524.9466

Step: 10. Now Check the Email Report from LMD :

# tail -f /var/mail/root

Step: 11. Other LMD Commands :

-- Perform a Scan for Specific file Extention only :

# maldet -a /var/www/html/*.php

-- Get a List of all Reports :

# maldet -e list

-- Scan Files that have been Created/Modified in the last X Days :

# maldet -r /var/www/html/ 5

-- Restore Files from the Quarantine Directory :

# maldet -s SCANID

-- Enable Monitoring of a Directory :

# maldet -m /var/www/html/

-- Check the Monitor Log File :

# tail -f /usr/local/maldetect/logs/inotify_log

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

 
Copyright © 2016 Kousik Chatterjee's Blog