Author: Indrason

Setting up of Apache2 and Project Directory along with security in Linux / Ubuntu

Setting Apache2:

Installation of Apache2:
       Open terminal
       Run the command: $ sudo apt-get install apache2

To start the apache2:
       $ sudo /etc/init.d/apache2 start

To stop the apache2:
       $ sudo /etc/init.d/apache2 stop

To restart the apache2:
       $ sudo /etc/init.d/apache2 restart

To work with apache server, work with root access:
       $ sudo su or $ su (for some other linux/ubuntu)
       Type your password and press Enter

 root access

To open apache2.config file in terminal:
       # cd /etc/apache2
       # nano apache2.conf

apache2 conf1

       Hit Enter

apache2 configur

To modify the content:
       Edit your content
       Press Ctrl + X
       Confirm saving the file by pressing Y
       Then Press Enter

To Exit from the file:
       Press Ctrl + X

To check the working of apache2:
       Open browser and type localhost in the address bar and hit Enter

localhost

Continue reading “Setting up of Apache2 and Project Directory along with security in Linux / Ubuntu”

Advertisements

Some Shell Scripting Programs

Friends,

Here are some of the shell scripting programs:

  1. Write a shell script to check whether the name passed as first argument is the name of a file or directory.

Ans:     #!/bin/bash
             if [ -f $1 ] 
             then
                        echo “$1 is a file”
             else
                        echo “$1 is not a file”
             fi

  1. Write a shell script to print the “long list” of all the file names passed at command line.

Ans:     #!/bin/bash
                        for i in $*
                        do
                                    ls -l $i
                        done
           

  1. Write a shell script to enter a file/directory name at command line. Change its permissions to      user – rwx
    group – rw-
    others – r–

Ans:     #!/bin/bash
                        if [ -f $1 ]
                        then
                                    chmod 764 $1
                                    ls -l $1
                        elif [ -d $1 ]
                        then
                                    chmod 764 $1
                                    ls -ld $1                        else
                                    echo “Not a file nor a directory”
                        fi
                       

  1. Write a shell script to create a file and a directory. The name given as first argument should be used for creating the file and the second argument should be used as the name of directory.

Ans:    #!/bin/bash
                  touch $1
                  mkdir $2
 

  1. Write shell script to create a file inside a directory. The file name should be passed as first argument and the directory name/path should be passed as second argument.

Ans:    #!/bin/bash
                  mkdir $2
                  cd $2
                  touch $1

Continue reading “Some Shell Scripting Programs”

VMware Hands-On Labs

genuine-hol

Hello Friends,

VMware Hands-On Labs is a free online service that one can learn about VMware and Virtualization easily. There are various Labs where one can enroll in any of them and gain knowledge.

To register and enroll yourself in any of the labs, Click here.

And if you want to download all the transcript of all the VMware Hands-On Labs, Click here.

Some of the popular VMware HOL are

Thank you.