Saturday 5 October 2013

How to install wordpress in rhel 6.x / Centos 6.x

[root@upload2 ~]# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
[root@upload2 ~]# yum install yum-plugin-replace
[root@upload2 ~]# yum install php-enchant
root@upload2 ~]# yum replace php-common --replace-with=php54w-common
[root@upload2 ~]# yum install wordpress
Installed:
  wordpress.noarch 0:3.6.1-1.el6                                              

Dependency Installed:
  php-IDNA_Convert.noarch 0:0.8.0-1.el6   php-PHPMailer.noarch 0:5.2.2-1.el6  
  php-simplepie.noarch 0:1.3.1-3.el6      php54w-process.x86_64 0:5.4.19-1.w6 

Complete!
[root@upload2 ~]# mysql -u root -ppassword
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
Bye
[root@upload2 ~]# vim /etc/wordpress/wp-config.php
 19 define('DB_NAME', 'wordpress');
 20
 21 /** MySQL database username */
 22 define('DB_USER', 'wordpress');
 23
 24 /** MySQL database password */
 25 define('DB_PASSWORD', 'password');

[root@upload2 ~]# mkdir /usr/share/wordpress/wp-content/languages
[root@upload2 ~]# wget -P /usr/share/wordpress/wp-content/languages http://svn.automattic.com/wordpress-i18n/ja/tags/3.1.2/messages/ja.mo http://svn.automattic.com/wordpress-i18n/ja/tags/3.1.2/messages/continents-cities-ja.m
[root@upload2 ~]# ls /usr/share/wordpress/wp-content/languages/
continents-cities-ja.mo  ja.mo
[root@upload2 ~]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]





How to configure webdev

[root@upload ~]# vim /etc/httpd/conf.d/webdav.conf
alias /share /imagedata1/3rdparty_packages/
<Location /share>
   DAV On
   SSLRequireSSL
   Options None
   AuthType Basic
   AuthName WebDAV
   AuthUserFile /etc/httpd/conf/.htpasswd
   <LimitExcept GET OPTIONS>
      Order allow,deny
      Allow from all
# IP address you allow

      Require valid-user
   </LimitExcept>
</Location>

[root@upload ~]# chmod 755 -R /imagedata1/3rdparty_packages/
[root@upload ~]# htpasswd -c /etc/httpd/conf/.htpasswd bala
New password:
Re-type new password:
Updating password for user bala
[root@upload ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                           [  OK  ]

Windows does not have webdav function, so Use free software for webdav client. Download 'CarotDAV' for free from following site.

http://rei.to/carotdav_en.html

Download and install in windows pc


The waring is shown like follows, it's SSL certificates is not installed on your PC, it's no ploblem, Click 'Ignore' and go next.  




Friday 4 October 2013

How to configure slave dns server

Configuration on Master DNS

[root@upload named]# cat /etc/named.conf

options {
        listen-on port 53 { 127.0.0.1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost; any; };
        allow-transfer { localhost; 10.66.191.221; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};
zone "zumi.com." {
       type master;
       file "zumi.com.zone";
       allow-update { none; };
};

zone "191.66.10.in-addr.arpa." {
      type master;
      file "191.66.10.in-addr.arpa.zone";
      allow-update { none; };
};

include "/etc/named.rfc1912.zones";

[root@upload named]# cat /var/named/zumi.com.zone
$TTL    86400
@    IN      SOA   upload.zumi.com.  root.zumi.com. (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum            
             IN    NS             upload.zumi.com.
             IN    NS             upload2.zumi.com.
         IN       A          10.66.191.230
         IN       MX    1      upload.zumi.com
upload       IN    A              10.66.191.230
upload2         IN    A              10.66.191.221

[root@upload named]# rndc reload

Configuration on Slave DNS

[root@upload2 named]# cat /etc/named.conf

options {
    listen-on port 53 { 127.0.0.1; };
    #listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { localhost; any; };
    recursion yes;

    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};
    zone "zumi.com" IN {
        type slave;
        masters { 10.66.191.230; };
        file "slaves/zumi.com.zone";
        notify no;
    };

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

[root@upload2 etc]# service named start
Generating /etc/rndc.key:                                  [  OK  ]
Starting named:                                            [  OK  ]
[root@upload2 etc]# rndc reload
server reload successful
[root@upload2 etc]# ls /var/named/slaves/
zumi.com.zone

How to configure NTP Server

[root@upload2 ~]# yum -y install ntp
[root@upload2 ~]# vim /etc/ntp.conf
 
# line 19: add the network range you allow to receive requests

restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap
 
# change servers for synchronization
 
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org
 
server ntp1.jst.mfeed.ad.jp
server ntp2.jst.mfeed.ad.jp
server ntp3.jst.mfeed.ad.jp 
 
[root@upload2 ~]# /etc/rc.d/init.d/ntpd start
Starting ntpd:                                             [  OK  ]
[root@upload2 ~]# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 ntp1.jst.mfeed. 172.29.3.50      2 u   11   64    1  209.194  -112312   0.000
 ntp2.jst.mfeed. 172.29.2.50      2 u   11   64    1  191.529  -112304   0.000
 ntp3.jst.mfeed. 172.29.3.50      2 u   12   64    1  185.499  -112319   0.000
[root@upload2 ~]# 

Thursday 3 October 2013

How to install zabbix in rhel 6.X / Centos 6.X


Information about my system:-

Linux upload2.zumi.com 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

[root@upload2 ~]# rpm -ivh epel-release-6-8.noarch.rpm
[root@upload2 ~]# rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
[root@upload2 ~]# rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm
[root@upload2 ~]# yum install httpd php php-mysql mysql-server
[root@upload2 ~]# service mysqld start
[root@upload2 ~]# mysqladmin -u root password password
[root@upload2 ~]# mysql -u root -ppassword
mysql> use mysql;
mysql> DELETE FROM mysql.user WHERE user = '';
mysql> flush privileges;
mysql> quit
[root@upload2 ~]# yum install zabbix-server-mysql zabbix-agent zabbix-web-mysql
[root@upload2 ~]# mysql -u root -ppassword
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> quit
[root@upload2 ~]# cd /usr/share/doc/zabbix-server-mysql-2.0.8/create/
[root@upload2 create]# mysql -u root -ppassword zabbix < schema.sql
[root@upload2 create]# mysql -u root -ppassword zabbix < images.sql
[root@upload2 create]# mysql -u root -ppassword zabbix < data.sql
[root@upload2 create]# vi /etc/zabbix/zabbix_server.conf
81 DBHost=localhost
91 DBName=zabbix
107 DBUser=zabbix
115 DBPassword=zabbix

[root@upload2 create]# vi /etc/zabbix/zabbix_agentd.conf

136 Hostname=upload2.zumi.com
137
138 #Hostname=Zabbix server

[root@upload2 create]# vim /etc/php.ini

# line 440: change to Zabbix recomended

max_execution_time = 600
 
# line 449: change to Zabbix recomended

max_input_time = 600
 
# line 457: change to Zabbix recomended

memory_limit = 256M
 
# line 729: change to Zabbix recomended

post_max_size = 32M
 
# line 878: change to Zabbix recomended

upload_max_filesize = 16M
 
# line 946: uncomment and add your timezone

date.timezone = Asia/Calcutta
 
[root@upload2 create]# vi /etc/httpd/conf.d/zabbix.conf
 
Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all   ------- > if u need specify particular ip range here.

    php_value max_execution_time 600
    php_value memory_limit 256M
    php_value post_max_size 32M
    php_value upload_max_filesize 16M
    php_value max_input_time 600
    php_value date.timezone Asia/Calcutta
</Directory>

[root@upload2 create]# vim /etc/httpd/conf/httpd.conf
276 ServerName upload2.zumi.com:80
 
[root@upload2 create]# service zabbix-server start
[root@upload2 create]# service zabbix-agent restar 
[root@upload2 create]# service httpd restart



Change to "zabbix in "User" field and input the password. Next, click "Test Connection" and id it's "OK" like follows, go next


Input ZABBIX server's hostname and so on like follows


Make sure settings and if it's Ok all, go next

 

 

 Default username/password is Admin/zabbix. 



Thursday 6 June 2013

How to check hard disk failure in linux

smartctl is a command line utility designed to perform SMART tasks such as printing the SMART self-test and error logs, enabling and disabling SMART automatic testing, and initiating device self-tests. First, make sure S.M.A.R.T. support is enabled in the BIOS. Next, run the following command to see if your hard disks support S.M.A.R.T technology or not:

[root@vellore ~]# smartctl -i /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.32-279.el6.x86_64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.12
Device Model:     ST3250318AS
Serial Number:    9VM8EC2E
LU WWN Device Id: 5 000c50 01a4a684d
Firmware Version: CC38
User Capacity:    250,058,268,160 bytes [250 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Thu Jun  6 10:19:02 2013 IST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

If not enabled by default, To enable SMART, run:

[root@vellore ~]# smartctl -s on -d ata /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.32-279.el6.x86_64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.

Run overall-health self-assessment test, enter:

[root@vellore ~]# smartctl -d ata -H /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.32-279.el6.x86_64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

A sample output from failing hard disk: 

smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 110 58 25)
 
The following will provide even more information about failing hard disk:

[root@vellore ~]# smartctl --attributes --log=selftest /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.32-279.el6.x86_64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   119   099   006    Pre-fail  Always       -       221288423
  3 Spin_Up_Time            0x0003   097   097   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   093   093   020    Old_age   Always       -       7332
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   083   060   030    Pre-fail  Always       -       205719784
  9 Power_On_Hours          0x0032   091   091   000    Old_age   Always       -       8550
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   097   097   020    Old_age   Always       -       3611
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   046   046   000    Old_age   Always       -       54
188 Command_Timeout         0x0032   100   092   000    Old_age   Always       -       68720526384
189 High_Fly_Writes         0x003a   095   095   000    Old_age   Always       -       5
190 Airflow_Temperature_Cel 0x0022   066   048   045    Old_age   Always       -       34 (Min/Max 20/37)
194 Temperature_Celsius     0x0022   034   052   000    Old_age   Always       -       34 (0 18 0 0 0)
195 Hardware_ECC_Recovered  0x001a   038   032   000    Old_age   Always       -       221288423
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   192   000    Old_age   Always       -       2109
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       269139830654254
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       1152744560
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       177103330

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      8550         -
# 2  Short offline       Completed without error       00%      8550         -

Thursday 30 May 2013

How to install jboss in rhel 6.x / Centos 6.x

This post will cover installing JBoss 7.1.1 on CentOS 6.x.

We'll also set up JBoss to run as a service, as well as set up access to the management console

Finally, we will look at how run JBoss on port 80 or, alternatively, placing JBoss behind Apache.

Firstly, we will need to install Java.

JBoss 7.1.1 will work with JDK 6 or JDK 7.

I'm using JDK 7

[root@vellore 3rdparty_packages]# rpm -ivh jdk-7u7-linux-x64.rpm
-->
[root@vellore Downloads]# unzip jboss-as-7.1.1.Final.zip -d /usr/share/
[root@vellore Downloads]# cd /usr/share
[root@vellore share]# mv jboss-as-7.1.1.Final/ jboss-as

Since we will want to run JBoss as a non-root user with minimal privileges, we'll create a user, jboss, who will own the JBoss files and JBoss will run under his account.

To do this, do the following.

Create a new group, jboss, and then create the user jboss and add the user to the jboss group.

[root@vellore Downloads]# groupadd jboss;useradd -s /bin/bash -g jboss jboss
[root@vellore Downloads]# chown -Rf jboss.jboss /usr/share/jboss-as/
[root@vellore Downloads]# passwd jboss
[root@vellore Downloads]# cat /root/.bash_profile
JAVA_HOME=/usr/java/jdk1.7.0_07
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
[root@vellore Downloads]# . ~/.bash_profile
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
[root@vellore Downloads]# java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
[root@vellore Downloads]# su - jboss
[jboss@vellore ~]$ java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[jboss@vellore ~]$ exit
logout
[root@vellore Downloads]# cp /usr/share/jboss-as/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss
[root@vellore Downloads]# vim /etc/init.d/jboss
5 # chkconfig: 234 80 20
18 JBOSS_USER=jboss
19 export JBOSS_USER
[root@vellore Downloads]# chmod 755 /etc/init.d/jboss
[root@vellore Downloads]# chkconfig --add jboss
[root@vellore Downloads]# chkconfig --level 234 jboss on
[root@vellore Downloads]# service jboss start
Starting jboss-as: [ OK ]
[root@vellore Downloads]# service jboss stop
Stopping jboss-as: *** JBossAS process (16287) received TERM signal *** [ OK ]
[root@vellore ~]# vim /usr/share/jboss-as/standalone/configuration/standalone.xml
By default, JBoss 7.1.1 is bound to the loopback IP of 127.0.0.1, so if we want to make it available on the web, we need to change this.

Locate standalone.xml under /usr/share/jboss-as/standalone/configuration/.

Open standalone.xml in vi or a text editor and look for the public interfaces node as shown below.

<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>

To make JBoss publicly accessible, change 127.0.0.1 to either 0.0.0.0 to allow access on all interfaces or to your public IP.

So, for example, if your public IP is 10.66.191.232, you would change it as so:

[root@vellore ~]# vim /usr/share/jboss-as/standalone/configuration/standalone.xml
275 <interfaces>
276 <interface name="management">
277 <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
278 </interface>
279 <interface name="public">
280 <inet-address value="${jboss.bind.address:10.66.191.232}"/>
281 </interface>
282 <!-- TODO - only show this if the jacorb subsystem is added -->
283 <interface name="unsecure">
284 <!--
285 ~ Used for IIOP sockets in the standard configuration.
286 ~ To secure JacORB you need to setup SSL
287 -->
288 <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
289 </interface>
[root@vellore ~]# service jboss start
Starting jboss-as: [ OK ]
[root@vellore ~]#

Again, if you wish to have JBoss publicly accessible on all interfaces, use 0.0.0.0 in place of your IP above.

Save your changes, start up JBoss, and check it is publicly accessible via http://10.66.191.232:8080



How to install glassfish in rhel 6.x / Centos 6.x


-->

[root@vellore 3rdparty_packages]# rpm -ivh jdk-7u7-linux-x64.rpm


[root@vellore Downloads]# unzip glassfish-3.1.2.2.zip -d /usr/share/
[root@vellore Downloads]# vim /etc/init.d/glassfish
#!/bin/bash
# description: Glassfish Start Stop Restart
# processname: glassfish
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.7.0_07
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
GLASSFISH_HOME=/usr/share/glassfish3/glassfish/
case $1 in
start)
sh $GLASSFISH_HOME/bin/asadmin start-domain domain1
;;
stop)
sh $GLASSFISH_HOME/bin/asadmin stop-domain domain1
;;
restart)
sh $GLASSFISH_HOME/bin/asadmin stop-domain domain1
sh $GLASSFISH_HOME/bin/asadmin start-domain domain1
;;
esac
exit 0
[root@vellore Downloads]# chmod 755 /etc/init.d/glassfish
[root@vellore Downloads]# chkconfig --add glassfish
[root@vellore Downloads]# chkconfig --level 234 glassfish on
[root@vellore Downloads]# service glassfish start

check this URL in your browser http://localhost:8080/

Click Administration Console it will take you to http://localhost:4848
Change password and logout



Tuesday 21 May 2013

How to find serial number of server in rhel/centos

[root@vellore Desktop]# dmidecode | egrep -i "serial|product"

                      Serial services are supported (int 14h)
        Product Name: ProLiant ML350 G5
        Serial Number: SGH839XC4Y     
        Serial Number: SGH839XC4Y     
        String 1: Product ID: 412645-B21

Thursday 14 March 2013

How to change tomcat port number


Tomcat by default runs on port number 8080, However there is high chance get a port conflict with others program. Sometime we just need to change the Tomcat port number.

Steps of changing the Tomcat Port

1) Locate server.xml in {Tomcat installation folder}\ conf \
2) Find following similar statement
 <!-- Define a non-SSL HTTP/1.1 Connector on port 8180 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />
or
    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
3) About Tomcat’s server.xml file cites it’s runs on port 8080. Change the Connector port=8080 port to any other port number.
For example
 <Connector port="8181" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
Above statement instruct Tomcat server runs on port 8181.
4) Edit and save the server.xml file. Restart Tomcat. Done

Ref :- http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/

Wednesday 6 February 2013

Apache Interview Questions


Q: – What is location of log files for Apache server ?
Ans- /var/log/httpd
Q: – What are the types of virtual hosts ?
Ans-
a. name-based
b. IP-based.

Name-based virtual host means that multiple names are running on each IP address.
IP-based virtual host means that a different IP address exists for each website served. Most configurations are named-based because it only requires one IP address.
Q: – Command to restart/start Apache web server ?
Ans- service httpd restart/start
Q: – Comamnd to check the version of Apache server ?
Ans- rpm -qa |grep httpd
Q: – What is meaning of “Listen” in httpd.conf file ?
Ans- Port number on which to listen for nonsecure (http) transfers.
Q: – What is Document Root ?
Ans- It is a location of files which are accessible by clients. By default, the Apache HTTP server in RedHat Enterprise Linux is configured to serve files from the /var/www/html/ directory.
Q: – Apache server works on which ports ?
Ans-
http – port 80
https – port 443
Q: – Tell me name of main configuration file of Apache server ?
Ans- httpd.conf
Q: – On which version of apache you have worked ?
Ans- httpd-2.2.3
Q: – What do you mean by a valid ServerName directive?
Ans- The DNS system is used to associate IP addresses with domain names. The value of ServerName is returned when the server generates a URL. If you are using a certain domain name, you must make sure that it is included in your DNS system and will be available to clients visiting your site.
Q: – What is the main difference between and sections?
Ans- Directory sections refer to file system objects; Location sections refer to elements in the address bar of the Web Page.
Q: – What is the difference between a restart and a graceful restart of a web server ?
Ans- During a normal restart, the server is stopped and then started, causing some requests to be lost. A graceful restart allows Apache children to continue to serve their current requests until they can be replaced with children running the new configuration.

-->
apachectl -k restart – for graceful restart
Q: – What is the use of mod_perl module ?
Ans- mod_perl scripting module to allow better Perl script performance and easy integration with the web server.
Q: – If you have added “loglevel Debug” in httpd.conf file, than what will happen ?
Ans- It will give you more information in the error log in order to debug a problem.
Q: – Is it possible to record the MAC (hardware) address of clients that access your server ?
Ans- No

Saturday 12 January 2013

How to hide your IP address in rhel 6.X / Centos 6.X


How to hide your IP address in rhel 6.X / Centos 6.X



Tor doesn't work as root user so login as a user and extract the tar file and keep it in any directory say /home/ranjith/Downloads

[ranjith@vellore Downloads]$ cd tor-browser_en-US/
[ranjith@vellore tor-browser_en-US]$ ls
App Data Docs Lib start-tor-browser tmp

[ranjith@vellore tor-browser_en-US]$ ./start-tor-browser

Launching Tor Browser Bundle for Linux in /home/ranjith/Downloads/tor-browser_en-US
Qt: Session management error: None of the authentication protocols specified are supported

If your network uses proxy and password click settings > Network and enter your proxy details stop tor and start tor. Now you can connect to internet safely by masking your IP address. Enjoy browsing.

Wednesday 2 January 2013

How to configure MySQL Master-Slave Replication in RHEL 6.X/Centos 6.X

How to configure MySQL Master-Slave Replication in RHEL 6.X/Centos 6.X
  1. Working Linux OS like CentOS 6.3, RedHat 6.3 or Fedora 17
  2. Master and Slave are CentOS 6.3 Linux Servers.
  3. Master IP Address is: 10.65.62.30
  4. Slave IP Address is: 10.66.191.232
  5. Master and Slave are on the same LAN network.
  6. Master and Slave has MySQL version installed.
  7. Master allow remote MySQL connections on port 3306.
Master side (10.65.62.30):

[root@station1 Desktop]# yum install -y mysql*
[root@station1 Desktop]# service mysqld start
[root@station1 Desktop]# mysqladmin -u root password password ------> setting password for the root user
[root@station1 Desktop]# mysql -u root -ppassword ------> login
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.1.52 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> DELETE FROM mysql.user WHERE user = ''; ----> to delete anonymous users.
mysql> flush privileges;
mysql> create database Ranjith;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| Ranjith |
| mysql |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> use Ranjith;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create table contacts ( `first_name` char(20), `last_name` char(20), `mob_no` char(20), `email_id` char(30), PRIMARY KEY (`email_id`));
mysql> show tables;
+-------------------+
| Tables_in_Ranjith |
+-------------------+
| contacts |
+-------------------+
1 row in set (0.00 sec)
mysql> describe contacts;
+------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+----------+------+-----+---------+-------+
| first_name | char(20) | YES | | NULL | |
| last_name | char(20) | YES | | NULL | |
| mob_no | char(20) | YES | | NULL | |
| email_id | char(30) | NO | PRI | | |
+------------+----------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> INSERT INTO contacts (first_name,last_name,mob_no,email_id) VALUES ('Ranjith','Pandurangan','+918056316316','upload.vellore@licindia.com');
mysql> select * from contacts;
+------------+-------------+---------------+----------------------+
| first_name | last_name | mob_no | email_id |
+------------+-------------+---------------+----------------------+
| Ranjith | Pandurangan | +918056316316 | upload.vellore@licindia.com |
+------------+-------------+---------------+----------------------+
2 rows in set (0.00 sec)

mysql>quit;