Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday 22 August 2012

Automating Linux Installation and configuration with Kickstart

Automating Linux Installation and configuration with Kickstart


If you are working for an IT Support company means you regularly have to install OSs like CentOS, Fedora & Redhat on servers, desktop computers or even Virtual Machines.
Following this guide will explain you how to automate the install process using a simple Kickstart file.

Read more for the very well explained guide here.

Monday 4 June 2012

yoyoclouds: Sharing CentOS Files with Remote Windows Systems- ...


Although Linux is increasingly making inroads into the desktop market, its origins are very much server based. It is not surprising therefore that Linux has the ability to act as a file server. It is also extremely common for Linux and Windows systems to be used side by side both in home and business environments.

It is a common requirement, therefore, that files on a Linux system be accessible to both Linux, UNIX and Windows based systems over network connections. Similarly, shared folders residing on Windows systems must also be accessible from CentOS systems.

Windows systems share resources such as file systems and printers using a protocol called Server Message Block (SMB). In order for a Linux system to serve such resources over a network to a Windows system and vice versa it must, therefore, support SMB. This is achieved using Linux based technology called Samba. In addition to providing integration between Linux and Windows systems, Samba may also be used to provide folder sharing between Linux systems.

In this tutorial we will look at the steps necessary to share file system resources and printers on a CentOS system with remote Windows and Linux systems.

Read the tutorial here ...



SOURCE

yoyoclouds: Update CentOS

Update CentOS 


There are basically two ways of updating a CentOS machine.. first is by using the GUI and the second, via command line...

Read more here ...

yoyoclouds: Install and Configure Apache Server on CentOS

Install and Configure Apache Server on CentOS Apache Server Apache HTTP Server is an open-source HTTP server for modern ....

Read more here ...

Thursday 31 May 2012

AWS - Migrate Linux AMI (EBS) using CloudyScripts


In a typical Amazon Web Services(AWS) Environment, Amazon Machine Images (AMIs) are strictly available in a certain region only. These AMIs cannot be moved from one region to another. Though the AMIs are shared within different Availability Zones of the same region.

For this purpose, you can use a third party tool called as CloudyScripts.

CloudyScripts is a collection of tools to help you programming Infrastructure Clouds.

The web-based tool is self explanatory and regularly updated. In case you find any bug, do not hesitate to email the owners right away.


Goto the CloudyScripts Copy AMI to different region tool
































Thursday 24 May 2012

Install and Configure MySQL on CentOS

MySQL is the world's most popular open source database.

MySQL Community Edition is freely downloadable version.

Commercial customers have the flexibility of choosing from multiple editions to meet specific business and technical requirements. For more details please refer to the MySQL official website.

INSTALL :


On any CentOS server with open internet, run the below command to install MySQL Community Edition:

yum install mysql-server mysql php-mysql

OR

Download the server and client rpm files from the MySQL Website depending upon the platform(OS) and architecture(32/64bit).

Install both rpm files using below command:

rpm -ivh <<rpm_filenames>>

Example:

rpm -ivh mysql-server-version.rpm mysqlclient9-version.rpm


CONFIGURE :


Once installed, run the below commands to configure MySQL Server:

1.Set the MySQL service to start on boot

chkconfig --levels 235 mysqld on

2. Start the MySQL service

service mysqld start

3. By default the root user will have no password, so to log into MySQL use command:

mysql -u root

4. To exit Mysql Console, enter below command

exit;

SET PASSWORD FOR ROOT :


To set the root user password for all local domains, login and run below commands

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('<<new-password>>');

SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('<<new-password>>');

SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('<<new-password>>');

(Replace <<new-password>> with actual password)

OR

run below command at linux shell:

mysqladmin -u root password '<<new-password>>'

(Replace <<new-password>> with actual password)

Once password is set, to login to Mysql use below command:

mysql -u root -p

Once you enter the above command, you will be prompted for the root password.

ADD NEW USER :




To add a new user for MySQL login, use the below SQL query. Remember this query must be run from the MySQL prompt.

for localhost:

INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) VALUES ('localhost', '<<USERNAME>>', password('<<PASSWORD>>'), 'Y','Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', '', '', '', '', 0, 0, 0, 0);

for anyhostname:

INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) VALUES ('%', '<<USERNAME>>', password('<<PASSWORD>>'), 'Y','Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', '', '', '', '', 0, 0, 0, 0);

Replace <<USERNAME>> and <<PASSWORD>> with actual username and password respectively.

Note they must be enclosed in single quotes.


DROP ANY USER :


In case, you want to drop any user use below command:

DROP '<<username>>''@'localhost';

DROP '<<username>>''@'localhost.localdomain';

(Replace <<username>> with actual username)




For more help and commands, refer --> http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html

Sunday 20 May 2012

Getting Started with Amazon Web Services EBS Volumes

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers. Amazon EC2 enables “compute” in the cloud.

Amazon Elastic Block Store (EBS) provides block level storage volumes for use with Amazon EC2 instances. EBS provides highly available, highly reliable storage volumes that can be attached to a running Amazon EC2 instance and exposed as a device within the instance. It persists independently from the life of an instance. These EBS volumes are created in a particular Availability Zone and can be from 1 GB to 1 TB in size.

Follow the below steps to Create, attach and mount EBS Volumes to launched EC2 instances:

Create the EBS Volume


Log into AWS Management Console and follow the below steps for all the each extra volume to be attached to instances. For example, let’s create and attach a 6GB EBS volume (for Oracle Alert Logs and Traces) to Database server.

• Choose “Volumes” on the left hand control panel:



• In the right-hand pane under EBS Volumes, click on ‘Create Volume’



• In Create Volume dialog box that appears:
Enter the size mentioned in table, keep availability zone same as that of Database instance and select No Snapshot and click on ‘Create’.



• This will create an EBS volume and once create is complete it will be displayed as



Attach Volume


• Select a volume and click on button to Attach Volume



• Select the instance for which EBS volume is to be attached. Also mention the mount point for the volume in device.
Here Instance is for database and mount device is /dev/sdf



• Once attached it will be displayed as



Mount the Volume


• Execute commands in the EC2 instance’s (Database Server) linux shell. As this is a new volume (with no data), we will have to format it
Run command:

mkfs -t ext3 /dev/sdf

(Replace text in blue with mount device used in previous step)

• Make a directory to mount the device.


mkdir /mnt/disk1

• Mount the device in newly created directory


mount /dev/sdf /mnt/disk1

(Replace text in blue as required)

• By default volumes will not be attached to the instance on reboot. To attach these volumes to given mount point every time on reboot, execute the following command

echo "/dev/sdf /mnt/disk1ext3 noatime 0 0" >> /etc/fstab"

(Replace text in blue as required)

Check attached volume by using command: df -h


Unmounting the volume


From the Elastic Block Storage Feature Guide: A volume must be unmounted inside the instance before being detached. Failure to do so will result in damage to the file system or the data it contains.

umount /mnt/disk1

Remember to cd out of the volume, otherwise you will get an error message

umount: /mnt/disk1: device is busy

Hope the above steps help you get into action in minutes.

In case you get stuck at any point, do comment below. I will be glad to help. :)

Friday 18 May 2012

Install JAVA on Linux using rpm files

Steps for installing JAVA (JDK 6) on linux using rpm files:

1. Log into the linux shell and become root user by running the command

su –i

2. Change directory.

cd /opt

3. Please search at http://www.oracle.com/technetwork/java/javase/downloads/index.html for newer versions to download.

You can download to any directory you choose; it does not have to be the directory where you want to install the JDK. Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal.

To download use one of the below commands, depending on the server's architecture (32/64 bit) :
64 bit:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64-rpm.bin

32 bit:
wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-i586-rpm.bin



4. Make sure that execute permissions are set in the self-extracting binary.
Enter ls –la to see the permissions for the file.


5. Run below command to grant execute permission to the file:

chmod a+x <<name-of-rpm-file-downloaded-earlier>>
 
For e.g.:
chmod +x jdk-6u25-linux-x64-rpm.bin\?e\=1306317438\&h\=294de0d36f54e28dd65fc8370e3c406d

6. Change directory to the location where you would like the files to be installed. The next step installs the JDK into the current directory.

7. Execute the downloaded file, prepended by the path to it.
For example, if the file is in the current directory, prepend it with "./"  :
./<<name-of-rpm-file-downloaded-earlier>>
For e.g.:

./jdk-6u25-linux-x64-rpm.bin\?e\=1306317438\&h\=294de0d36f54e28dd65fc8370e3c406d



8. The binary code license is displayed, and you are prompted to agree to its terms.



9. Check if java is installed using command

java -version



The java version must be displayed correctly. You may also want to run commands like java or javac to check if installation is proper.

10. Execute below command to test if the JAVA_HOME environment variable is set.

echo $JAVA_HOME

It must display the location where java is installed.

11.  Delete the bin and rpm files if you want to save disk space.

rm -rf sun*