Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday, 28 February 2016

How To Configure Wordpress on CentOS/RHEL 6x

How To Configure Wordpress on CentOS/RHEL 6x


Q. What Is WordPress?

Ans: WordPress is an open source and free blogging application and a dynamic CMS (Content Management System) developed using MySQL and PHP.

Step: 1. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 2. Install & Configure Mysql Server :

# yum -y install mysql mysql-server

# service mysqld restart
# chkconfig mysqld on

# mysql_secure_installation (To Set Root Password for Mysql)

Step: 3. Create "wordpress" Database :

# mysql -u root -predhat

mysql> create database wordpress character set utf8 collate utf8_bin;
mysql> grant all privileges on wordpress.* to wordpress@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

Step: 4. Install PHP :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt \
  php-devel php-xml php-imap php-ldap php-mbstring php-odbc php-pear \
  php-xmlrpc php-soap php-cli php-intl mod_ssl

Step: 5. Downloading WordPress Package :

# cd /var/www/html
# wget http://wordpress.org/latest.tar.gz
# tar -xvzf latest.tar.gz

Step: 6. Configure Wordpress :

# cd wordpress
# cp wp-config-sample.php wp-config.php
# vi wp-config.php

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

-- Give DB_NAME (wordpress)

/** MySQL database username */
define('DB_USER', 'username_here');

-- Give DB_USER (wordpress)

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

-- Give DB_PASSWORD (password)

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

-- Save & Quit (:wq)

Step: 7. Creating Apache VirtualHost for WordPress :

# vi /etc/httpd/conf/httpd.conf

<Directory /var/www/html/wordpress>
    Options +Indexes +Multiviews
        DirectoryIndex index.php index.html
    AllowOverride All
    Allow from all
</Directory>

-- Save & Quit (:wq)

# vi /etc/httpd/conf.d/wordpress.conf

Add The Following Lines :

Alias /wordpress /var/www/html/wordpress

<Directory /var/www/html/wordpress>
  AllowOverride Options
  <IfModule mod_authz_core.c>
    # Apache 2.4
    Require local
  </IfModule>
  <IfModule !mod_authz_core.c>
    # Apache 2.2
    Order Deny,Allow
    Deny from All
    Allow from all
    Allow from ::1
 </IfModule>
</Directory>

<Directory /var/www/html/wordpress/wp-content/plugins/akismet>
  <FilesMatch "\.(php|txt)$">
    Order Deny,Allow
    Deny from all
  </FilesMatch>
</Directory>

-- Save & Quit (:wq)


Step: 8. Restart the Apache Service :

# service httpd restart
# chkconfig httpd on

Step: 9. Finishing WordPress Installation :

http://192.168.72.139/wordpress

Give your Site Title, Create Admin User, Create Admin Password, Enter Your E-Mail and then click on Install button.

Click on Login -> Enter your WordPress Login details.

User: admin
Password: Passw0rd

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

Thursday, 25 February 2016

How To Install & Configure rssh on CentOS/RHEL 6x

How To Install & Configure rssh on CentOS/RHEL 6x

Q. What is rssh ?

Ans: rssh is a restricted shell for use with OpenSSH, allowing only scp or sftp. It now also includes support for rdist, rsync, & cvs. For example, if you have a server which you only want to allow users to copy files off of via scp, without providing shell access, you can use rssh to do that.rssh is a Restricted Shell for Providing Limited Access to a host via ssh, it allows following Operations only :

1. scp - Secure file copy
2. sftp - Secure FTP
3. cvs - Concurrent Versions System ~ you can easily retrieve old versions to see exactly which change caused the bug
4. rsync - Backup & sync file system
5. rdist - Backup / RDist program maintains identical copies of files on multiple hosts.

Step: 1. Install rssh :

For CentOS :

# cd /tmp
# wget http://dag.wieers.com/rpm/packages/rssh/rssh-2.3.2-1.2.el5.rf.i386.rpm
# yum -y install rssh-2.3.2-1.2.el5.rf.i386.rpm

For Ubuntu :

# apt-get -y install rssh

Step: 2. Grant Access to SFTP & SCP for all Users by Appending :

Note: By default rssh locks down everything including any sort of access.

# vi /etc/rssh.conf

Uncommented:

allowscp
allowsftp

-- Save & Quit (:wq)

Step: 3. Restart the SSHD Service :

# service sshd restart

Step: 4. Create A New User with "/usr/bin/rssh" shell :

# useradd -m -d /var/www/html/koushik.com -s /usr/bin/rssh koushik
# passwd koushik

New password:
Retype new password:

Step: 5. Change User's Shell bash to rssh :

# usermod -s /usr/bin/rssh user_name
or
# chsh -s /usr/bin/rssh user_name

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

Monday, 22 February 2016

How To Install Wetty (WEB+TTY) on RHEL/Centos 6x

How To Install Wetty (WEB+TTY) on RHEL/Centos 6x

Q. What is Wetty (Web + tty) ?

Ans: Terminal over HTTP and HTTPS. Wetty is an alternative to ajaxterm/anyterm but much better than them because wetty uses ChromeOS' terminal emulator (hterm) which is a full fledged implementation of terminal emulation written entirely in Javascript. Also it uses websockets instead of Ajax and hence better response time.

Step: 1. Install EPEL Repo :

# yum -y install epel-release

Step: 2. Install Wetty Dependencies :

# yum clean all
# yum -y install git nodejs npm screen
# yum groupinstall "Development Tools"
# npm -g update

Step: 3. Install NTP (Time Synchronization) :

# yum -y install ntp
# service ntpd restart
# chkconfig ntpd on
# ntpdate pool.ntp.org

Step: 4. After Installing these Dependencies, Clone the Wetty GitHub Repository :

# cd /root
# git clone https://github.com/krishnasrinivas/wetty

Step: 5. Install Wetty :

# cd wetty
# npm install pty.js
# npm install

Step: 6. Starting Wetty & Access Linux Terminal from Web Browser :

# node app.js -p 8080 (Port no.)

http://Your_IP-Address:8080

Step: 7. Run Wetty through HTTPS :

# cd /root/wetty
# openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes

Country Name (2 letter code) [XX]:IN
State or Province Name (full name) []:West Bengal
Locality Name (eg, city) [Default City]:Siliguri
Organization Name (eg, company) [Default Company Ltd]:TechnoMedia
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server's hostname) []:ser1.techno.com
Email Address []:your_email@techno.com

Step: 8. Launch Wetty via HTTPS :

# screen
[Just Press Enter]

# cd /root/wetty
# node app.js --sslkey key.pem --sslcert cert.pem -p 8080

Step: 9. Add an User for Wetty :

# useradd koushik
# passwd koushik

New password: redhat
Retype new password: redhat

# vi /etc/sudoers

koushik    ALL=(ALL)    NOPASSWD:ALL

-- Save & Quit (:wq!)

Step: 10. Access Wetty Through Web Browser :

https://Your_IP-Address:8080
User: koushik
Pass: redhat

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

Friday, 19 February 2016

How to Configure Linked Server with MySQL

How to Configure Linked Server with MySQL



Q. What is Linked Server?
Ans: Linked Servers allows you to connect to other database instances on the same server or on another machine or remote servers. It allows SQL Server to execute SQL scripts against OLE DB data sources on remote servers using OLE DB providers. The remote servers can be SQL Server, Oracle, MySQL etc. which means those databases that support OLE DB can be used for linking servers.

Scenario:

MySQL Server IP: 192.168.72.220
-- DB_Name: reportsdb
-- DB_User: reports
-- DB_Pass: redhat

Windows Server 2012 R2 IP: 192.168.72.226
-- Install MSSQL Server 2012 with SSMS
-- Download & Install ODBC Driver for MySQL to Connect from SQL Server.
 Link: http://cdn.mysql.com//Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.4-winx64.msi
  
Step: 1. Create Database & User on MySQL Server (192.168.72.220):

mysql> create database reportsdb;
mysql> grant all privileges on reportsdb.* to reports@'localhost' identified by 'redhat';
mysql> grant all privileges on reportsdb.* to reports@'%' identified by 'redhat';
mysql> flush privileges;

mysql> use reportsdb;
mysql> create table report1(name char(20));
mysql> insert into report1 values('koushik');
mysql> insert into report1 values('koushik1');

mysql> show tables;
+-------------------+
| Tables_in_report1  |
+-------------------+
| reports1                 |
+-------------------+
1 row in set (0.00 sec)

mysql> select * from reports1;

+-----------+
| name         |
+-----------+
| koushik1    |
| koushik      |
+-----------+
2 rows in set (0.00 sec)

mysql> flush privileges;
mysql> exit


Step: 2. Download & Install ODBC Driver for MySQL to Connect from SQL Server :

Link: https://dev.mysql.com/downloads/connector/odbc/5.1.html

For Windows Server 2008/2012 :
Link: http://cdn.mysql.com//Downloads/Connector-ODBC/5.3/mysql-connector-odbc-5.3.4-winx64.msi

Step 3. MySQL ODBC Connector Configuration :

Open Run --> odbcad32.exe --> System DNS (tab) & Click on Add -> Select MySQL ODBC 5.3 Driver --> Finish -> On MYSQL Connector Provide the Details of the Database that you are Trying to Connect.

Data Source Name: REPORTSMYSQL
DESCRIPTION: REPORTSMYSQL
TCP/IP SERVER: 192.168.72.220
USER: reposts
Password: redhat
Database: reportsdb

-- Test. (If Everything is Good it'll Showing Message: "Connection Success") --> Click "OK".
--> Click "OK" --> Again Click "OK"

Note: MySQL ODBC Connector Configuration has been done.

Method 1 :

Step: 3. Configure Linked Server :

-- Run the Following Query in SQL Server (SSMS). Change the Following Field :

1. DRIVER, 2.SERVER, 3.DATABASE, 4.USER, & 5. PASSWORD.

/****** Object: LinkedServer [REPORTSMYSQL] Script Date: 02/08/2016 16:34:21 ******/

EXEC master.dbo.sp_addlinkedserver @server = N'REPORTSMYSQL', @srvproduct=N'REPORTSMYSQL', @provider=N'MSDASQL', @provstr=N'DRIVER={MySQL ODBC 5.3 Driver}; SERVER=192.168.72.220;DATABASE=reportsdb; USER=reports; PASSWORD=redhat;option=3'

/* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'REPORTSMYSQL',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,
@rmtpassword=NULL
GO

EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'collation compatible', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'data access', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'dist', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'pub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'rpc', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'rpc out', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'sub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'connect timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'collation name', @optvalue=null
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'lazy schema validation', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'query timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'use remote collation', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'REPORTSMYSQL', @optname=N'remote proc transaction promotion', @optvalue=N'true'
GO

-- Execute.

or Method 2 :

-- Login to SSMS Console.
-- Expand "Server Object" -->  Right Click on "Linked Servers" --> Click on "New Linked Server" --> Then Do the Following (For Example) :

Linked Server: REPORTSMYSQL
Server Type: Other Data Source
Provider: Microsoft OLE DB Provider for ODBC Drivers
Product Name: REPORTSMYSQL
Data Source: REPORTSMYSQL
Provider String: DRIVER={MySQL ODBC 5.3 Driver};SERVER=192.168.72.220;PORT=3306;DATABASE=reportsdb; USER=reports; PASSWORD=redhat;option=3;

--> Click on "OK"

Step: 4. Verify the Connection :

Connect to SSMS --> Server Objects --> Linked Server --> TESTMYSQL.

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

Saturday, 13 February 2016

How to Install .NET Framework 3.5 on Windows Server 2012 and Windows Server 2012 R2


How to Install .NET Framework 3.5 on Windows Server 2012 and Windows Server 2012 R2


Step: 1. Command Line :

-- Insert the Windows Sever 2012 installation media.
-- Open Command Prompt as Administrator.
-- Execute the following command:

C:\Windows\system32> dism /Online /Enable-Feature /FeatureName:NetFX3 /All /Source:D:\Sources\SxS\ /LimitAccess

Step: 2. GUI Mode :

-- Insert the Windows Sever 2012 installation media.
-- Open Server Manager.
-- On the Add Roles and Features wizard, click on "Specify an alternate source path".
-- Enter D:\Sources\SxS\ to point to the Server 2012.
-- Click OK.


Note: Once done installing through the GUI or command prompt, if you navigate back to the Add Roles and Features Wizard, you should see the feature has been successfully installed now.

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

Wednesday, 10 February 2016

How to Install LAMP Server on CentOS/RHEL 6x

How to Install LAMP Server on CentOS/RHEL 6x

LAMP (Linux, Apache, MySQL, PHP)

LAMP is an open source Web development platform that uses Linux as the operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language. (Sometimes Perl or Python is used instead of PHP.)

Step: 1. Bind the Hosts File :

# vi /etc/hosts

192.168.72.220    ser1.domain.com    ser1

-- Save & Quit (:wq)

Step: 2. Install Apache Server :

# yum -y install httpd httpd-devel

Step: 3. Edit httpd.conf file :

# vi /etc/httpd/conf/httpd.conf

#ServerName www.example.com:80

Just Add this Line-

ServerName IP_Address_of_Server:80

-- Save & Quit (:wq)

Step: 4. Start httpd Service :

# service httpd restart
# chkconfig httpd on

Step: 5. Install MySQL Database Server :

# yum -y install mysql mysql-server mysql-devel

Step: 6. Start MySQL Service :

# service mysqld restart
# chkconfig mysqld on

Step: 7. Changing MySQL Root Password :

# mysql_secure_installation

or

# mysql

mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('new password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit

Step: 8. Check loggin With New Password :

# mysql -u root -p
Enter Password: <your new password>

mysql> show databases;

+--------------------+
| Database                 |
+--------------------+
| information_schema |
| mysql                      |
+--------------------+
2 rows in set (0.00 sec)

mysql> exit

Step: 9. Install PHP5 Scripting Language :

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt \
  php-devel php-xml php-imap php-ldap php-mbstring php-odbc php-pear \
  php-xmlrpc php-soap php-cli php-intl mod_ssl

Step: 10. Create a file named /var/www/html/info.php :

# vi /var/www/html/info.php

<?php
  phpinfo ();
?>

-- Save & Quit (:wq)

Step: 11. Restart Apache to Load PHP :

# service httpd restart

Step: 12. Then point your browser to http://ip_add/info.php :

Ex- http://192.168.72.220/info.php

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


Tuesday, 9 February 2016

How to Install AVG Anti-Virus on Ubuntu

Install AVG Anti-Virus on Ubuntu
AVG Anti-Virus is one of choice which can install in Ubuntu / Linux. a Free of AVG Anti-Virus for Linux is available for private and non-commercial use only, we can installed it and Update a Virus Database regularly free of charge. Here step by step to install AVG Anti-Virus on your Ubuntu / Linux.

Step: 1. Install Prerequisites :

# sudo -i
# cd /etc/apt/sources.list.d
# echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" > ia32-libs-raring.list
# apt-get update
# apt-get install ia32-libs

Note: If You are facing any error to Install "ia32-libs" Package, then :

# dpkg --add-architecture i386
# apt-get update
# apt-get install ia32-libs
# apt-get install gcc-multilib


Step: 2. Download & Install AVG Anti-Virus :

Download Link: http://free.avg.com/in-en/download-free-all-product

# cd /tmp
# wget http://aa-download.avg.com/filedir/inst/avg2013flx-r3118-a6926.i386.deb
# dpkg -i avg2013flx-r3118-a6926.i386.deb

Step: 3. To Update Virus Database or AVG :

# avgupdate
# avgupdate -d

- To update the current virus database, Use one of these Commands :

# avgupdate --priority 1
# avgupdate --priority 2
# avgupdate --priority 3
# avgupdate --priority 4
# avgupdate --priority 5

1 - Critical update
2 - Virus update
3 - Recommended update
4 - Program update (default)
5 - Optional update

Step: 4. To Scan a Specific Directory :

# avgscan -H -c -a /var/www

- For a heuristic scan :

# avgscan --heur /

Few selected important options lines from help :

As seen in example above, the syntax is: avgscan [options] [path-list]

-l, --heal Automatically heal infected object.
-t, --delete Automatically delete infected object.
-u, --vv-move Automatically move infected object into vault.
-U, --vv-backup Backup infected object if healed by deletion.


Step: 5. To Launch The AVG Anti-Virus on Ubuntu :

# avgctl --start

Step: 6. To Completely Remove AVG from your Computer :

# apt-get autoremove --purge avg2013flx

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

Sunday, 7 February 2016

How to Install CentOS Web Panel In RHEL/CentOS 6x


 CentOS Web Panel


-- About CentOS Web Panel :

CentOS Web panel(CMP), specially designed for RPM based distributions like CentOS, RHEL etc. CWP is a free, Open Source control panel that can be widely used for deploying a Web hosting environment easily.

Note: CWP automatically installs full LAMP on your server.

Features Included:

A. Apache, Tomcat 8 Server Management & Install in one click.
B. PHP
C. User Management
D. DNS
E. Email
F. System Management
G. Monitoring Server
H. Security
I. MySQL, PostgreSQL Database Management

Step: 1. Set Hostname :

# vi /etc/sysconfig/network

HOSTNAME=ser2.kmi.com

-- Save & Quit (:wq)

# hostname ser2.kmi.com

Step: 2. Bind the Hosts File :

   
# vi /etc/hosts
   
192.168.100.220 ser1.kmi.com   ser1
       
-- Save & Quit (:wq)
               
Step: 3. Stop firewall & Disable the Selinux :
   
# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux
   
SELINUX=disabled
   
-- Save & Quit (:wq)

Step: 4. Restart the Server :

# init 6

Step: 5. Update the System :

# yum -y update
               
Step: 6. Time Synchronization NTP :

# yum -y install ntp
# chkconfig ntpd on
# ntpdate pool.ntp.org
# service ntpd start

Step: 7. Install MySQL Database Server :

# yum -y remove mysql mysql-server

# rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

# yum -y install mysql-server

Step: 8. Set MySQL Root Password :

# service mysqld restart
# chkconfig mysqld on
# mysql_secure_installation

Step: 9. Install CWP :

# cd /usr/local/src
# wget http://centos-webpanel.com/cwp-latest
or
# wget http://dl1.centos-webpanel.com/files/cwp-latest

# sh cwp-latest

MySQL root password []:redhat

#############################
#      CWP Installed                         #
#############################

go to CentOS WebPanel Admin GUI at http://SERVER_IP:2030/

http://192.168.100.221:2030
SSL: https://192.168.100.221:2031
---------------------
Username: root
Password: ssh server root password
MySQL root Password: redhat

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

Friday, 5 February 2016

How to Install Oracle Java on RHEL/Centos 6x

Install Oracle Java


About JAVA :

-- Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable.

Step: 1. Installing the Java :

# yum -y install wget
# cd /opt
# wget --no-check-certificate --no-cookies --header 'Cookie: oraclelicense=accept-securebackup-cookie' http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.rpm
   
# yum -y install jdk-8u5-linux-x64.rpm

Step: 2. Setup JAVA_HOME Variable :

# export JAVA_HOME=/usr/java/jdk1.8.0_05
# export PATH=$PATH:$JAVA_HOME
# echo $JAVA_HOME

Step: 3. Edit the Java Profile :

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/usr/java/jdk1.8.0_05
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

-- Save & Quit (:wq)

# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh

Step: 4. Check Version of JAVA :

# java -version
   
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Client VM (build 25.5-b02, mixed mode)

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

 
Copyright © 2016 Kousik Chatterjee's Blog