Thursday, July 3, 2014

How To Clear Memory Cache in Linux

Clearning the Linux Memory cache can be a quick way to regain system resources. Writing to the drop_cache process will cause the kernel to drop clean caches, dentries and inodes from memory, causing that memory to become free.



    To free pagecache:                                      # echo 1 > /proc/sys/vm/drop_caches

    To free dentries and inodes:                      # echo 2 > /proc/sys/vm/drop_caches

    To free pagecache, dentries and inodes :  # echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation, and dirty objects are not freeable, the user should run "sync" first in order to make sure all cached objects are freed.

Example - Memory before:

[root@linuxstorages ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3763       3630        132          0       1374        147
-/+ buffers/cache:       2108       1655
Swap:         4095         22       4073


[root@linuxstorages ~]# sync


[root@linuxstorages ~]# echo 3 > /proc/sys/vm/drop_caches

Memory after:

[root@linuxstorages ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          3763       1083       2680          0          2         84
-/+ buffers/cache:        996       2767
Swap:         4095         22       4073

Tuesday, June 24, 2014

How to Configure Name Based Web Server in Linux

Red Hat® Certified Engineer (RHCE®) is a Red Hat Certified System Administrator (RHCSA) who possesses additional skills, knowledge, and abilities required of a senior system administrator responsible for Red Hat Enterprise Linux® systems.

An RHCE is capable of:

    Configuring static routes, packet filtering, and network address translation.
    Setting kernel runtime parameters.
    Configuring an Internet Small Computer System Interface (iSCSI) initiator.
    Producing and delivering reports on system utilization.
    Using shell scripting to automate system maintenance tasks.
    Configuring system logging, including remote logging.
    Configuring a system to provide networking services, including HTTP/HTTPS, File Transfer        Protocol(FTP), network file system (NFS), server message block (SMB), Simple Mail Transfer Protocol (SMTP), secure shell (SSH) and Network Time Protocol (NTP).



How to create multiple virtual host using name based virtual host.

First install web server in system

root@linuxstorage:~#yum install https* -y

configure the httpd configuration file   



root@linuxstorage:~# vi /etc/httpd/conf/httpd.conf

to enable Name Based virtual host change line by removing symbol in front of line

 #NameVirtualHost *:80
     to

 NameVirtualHost xx.xx.xx.xx(Domain ip ):80

 copy last 7 line of sample and paste it below, then edit it as given below

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>


change like this

<VirtualHost xx.xx.xx.xx:80>
    ServerAdmin webmaster@linuxstorages.com
    DocumentRoot /var/www/html/sample1
    ServerName sample1.com
    ErrorLog logs/
sample1.com-error_log
    CustomLog logs/
sample1.com-access_log common
</VirtualHost>

 <VirtualHost xx.xx.xx.xx:80>
    ServerAdmin webmaster@linuxstorages.com
    DocumentRoot /var/www/html/sample2
    ServerName sample2.com
    ErrorLog logs/
sample2.com-error_log
    CustomLog logs/
sample2.com-access_log common
</VirtualHost>



:wq!

Both sample1.com and sample2.com domains will have same ip address. Like this we can create more sites using single ip address with help of name based virtual host.

Both virtual host have different document root.

Now we can move file to particular document root. 



    root@linuxstorage:~#cd  /var/www/html/sample1

    root@linuxstorage:~#vi index.html

    test1

    :wq!

    root@linuxstorage:~#cd  /var/www/html/sample2

    root@linuxstorage:~#vi index.html

    test2

    :wq!



root@linuxstorage:~#httpd -s

check the configuration status with help of above command and now restart the web server service



root@linuxstorage:~#service httpd restart

check the domain names in URL or elinks command.


    root@linuxstorage:~#elinks http://sample1.com
    test1

    or

    root@linuxstorage:~#elinks http://sample2.com
    test2

Monday, June 23, 2014

Opera For Linux is Finally as Beta

Opera for Linux is finally here, but only as a beta

Opera has finally released a version of its popular browser for Linux. The Developer version of Opera 24 brings familiar Windows and Mac features to the open source platform and users can get it from the experimental Developer channel. Opera 24 will be an alternative to Chrome and Firefox, which are the two most used browsers on Linux.

 

Opera claims to have repurposed the browser based on the Blink rendering engine, that the company adopted when Google, along with Opera, ditched WebKit. “We’ve had many questions about Opera on Linux from our users,” says Zhenis Beisekov, Product Manager of Desktop Products at Opera Software. “We focused on rebuilding the entire browser, adding a new engine and the same features you can find in the Windows and Mac versions. Now, you can finally get a web experience completely re-thought for the Linux platform.”
With this Developer version, Linux users will get their first taste of Opera features such as the quintessential Speed Dial, Stash and Discover features. The Speed Dial is essentially your home page on the browser and gives you an overview of your bookmarks, folders, and recent history. Stash lets users collect webpages and arrange them in categories. Think of it like Pinterest within the browser, designed to help you plan your work, travel or home life with collections of links. Discover is essentially an RSS reader, which gathers articles based on your interests and specified topics.
For now, Opera for Linux is only available in a Developer or beta version, while a stable version has been planned for the future.

Saturday, June 21, 2014

How to Configure a WebServer in Linux

Red Hat® Certified Engineer (RHCE®) is a Red Hat Certified System Administrator (RHCSA) who possesses additional skills, knowledge, and abilities required of a senior system administrator responsible for Red Hat Enterprise Linux® systems.

An RHCE is capable of:

    Configuring static routes, packet filtering, and network address translation.
    Setting kernel runtime parameters.
    Configuring an Internet Small Computer System Interface (iSCSI) initiator.
    Producing and delivering reports on system utilization.
    Using shell scripting to automate system maintenance tasks.
    Configuring system logging, including remote logging.
    Configuring a system to provide networking services, including HTTP/HTTPS, File Transfer        Protocol(FTP), network file system (NFS), server message block (SMB), Simple Mail Transfer Protocol (SMTP), secure shell (SSH) and Network Time Protocol (NTP).







Implement a webserver


CMD:

Install web server packages using yum command


root@linuxstorages:~#yum install httpd* -y


Configure the web server configuration in below path


root@linuxstorages:~#vim /etc/httpd/conf/httpd.conf




Copy the last 7 line and paste in last. Then change all dummy into your hostname

Change document root is /var/www/html

:wq!   
 Change directory to document root of web server


root@linuxstorages:~#cd /var/www/html

Connect FTP server using lftp command 


root@linuxstorages:~#lftp server id

>cd /var/www/ftp

>get data.html
>bye

get - download file from server to local

bye - exit ftp server connection

Rename data.html to index.html


root@linuxstorages:~#mv data.html index.html

Enter ip address details in host file


root@linuxstorages:~#vim /etc/hosts

Add   ipaddress    hostname(fully)        hostname(half)
               
xx.xx.xx.xx    user.linuxstorages.com   user.linuxstorages

:wq!

Check status of web server configuration file after configuring


         root@linuxstorages:~#httpd -t
         syntax ok

        root@linuxstorages:~#service httpd restart

        root@linuxstorages:~#chkconfig httpd on

Check the URL using elinks command in terminal


root@linuxstorages:~#elinks user.linuxstorages.com

Friday, June 20, 2014

RHEL 7 Features

Red Hat has launched Red Hat Enterprise Linux 7 beta which will introduce a variety of new virtualization, cloud, networking, file system, and live update features.

Celebrating the launch of Red Hat Enterprise Linux 7! Check out the features: http://red.ht/overviewrhel7 #RHEL7 #RedHat





File systems have continued to be a major focus of development in within RHEL. XFS is currently the default file system in RHEL 7, allowing support file systems as large as 500TB. But scalability enhancements to ext4 file systems allow them to be 16TB to 50TB standalone with block sizes of up to 1MB.

This simplifies and speeds up block allocation and defragmentation. Emerging file system Btrfs is available as a technology preview within Red Hat Enterprise Linux 7.

Networking is now faster (with 40Gb Ethernet link support), more responsive, and includes TCP Fast Open and Early Retransmit for TCP.



 

© 2014 Linux Storages | Updated . All rights resevered. Designed by Templateism