About admin

My name is Vidyadhar Sarmalkar & I work as a consultant and have done RHCE & CCNA.
Website:
admin has written 273 articles so far, you can find them below.


How to Install LAMP on Ubuntu 12.04

As a web developer I prefer to work on my development environment before rolling out the changes to Production environment. For the same I use Apache, MySQL and PHP package on my Ubuntu 12.04 box. Today’s article is about how to install all these packages with minimum commands and efforts. To achieve this we are going to install LAMP on our Ubuntu box. LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform that uses Linux as operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language.

Installation
Step 1 Open a command prompt and run following command to install LAMP

sudo apt-get install lamp-server^

install-lamp-on-ubuntu-1
install-lamp-on-ubuntu2

Step 2 At the time of installation you will be prompted to set a password for the root user for MySQL
install-lamp-on-ubuntu3
install-lamp-on-ubuntu4

Your LAMP installation is now complete. Just a single command to install all three package on a ubuntu box.

Configuration
LAMP will install the default things. Now we have to modify certain parameters as per our need.

Configuring apache webserver
Open a command prompt and add ServerName hostname in the Global Configuration tag of /etc/apache2/apache2.conf
install-lamp-on-ubuntu5
Remember to put your hostname.

Run following command to restart your apache2 server

/etc/init.d/apache2 restart

install-lamp-on-ubuntu6

Configure MySQL
Since this tutorial is for setting up a local web development environment, the MySQL needs to be bound to the localhost IP address. By default this should be 127.0.0.1 on your system. Just in case, you can verify it with these commands.

cat /etc/hosts | grep localhost

You should see something like

 
You now  want to verify that you have the correct bind address in MySQL's my.cnf file.
<pre lang="bash">
cat /etc/mysql/my.cnf | grep bind-address

You should see:

bind-address = 127.0.0.1

If the bind address doesn’t match the one set for localhost on your system, you’ll need to edit/etc/mysql/my.cnf as root to correct it.

Testing Apache
Open a web browser window and enter the address http://SERVER_IP_OF_LAMP/ You should see a web page that says “It Works!”
install-lamp-on-ubuntu

Testing PHP
Now that you’ve confirmed that the Apache web server works, you want to make sure that your php installation is working. To do that you need to create a file in /var/www called testing.php. You can use your favorite text editor as root, or you can use the following terminal command:

echo "<?php phpinfo(); ?>" | sudo tee /var/www/testing.php

Go back to your web browser and enter the address http://SERVER_IP_OF_LAMP/testing.php and you should see a page displaying information about your php installation.
install-lamp-on-ubuntu8

How to Install MySQL Server Ubuntu

It is an easy task to install MySQL Server on Ubuntu or Debian linux.

This article explains how to install MySQL Server and its Client packages on a Ubuntu / Debian system. At the time of writing this article the latest version of MySQL Server is 5.5.28

We are going to install MySQL using two methods
1. Installing the binary packages using apt-get method
2. Compiling the packages from source

Method 1 Installing from binary packages

Step 1 Open a terminal to run commands

Step 2 Make sure your package management tools are up-to-date. Run following commands to update the package management

sudo apt-get update

Step 3 Run following command to install MySQL server and client packages

sudo apt-get -y install mysql-server mysql-client

When done, you have a MySQL database ready.

You need to set a root password. MySQL has it’s own user accounts, which are not related to the user accounts on your Linux machine. By default, the root account of the MySQL Server is empty. You need to set it. Please replace ‘mypassword’ with your actual password and myhostname with your actual hostname.

sudo mysqladmin -u root -h localhost password 'mypassword'
sudo mysqladmin -u root -h myhostname password 'mypassword'

Method 2 Installing from source packages

Step 1 Open a terminal to run commands

Step 2 Make sure your package management tools are up-to-date. Run following commands to update the package management and install the tools need to build MySQL from source

sudo apt-get -y install build-essential cmake g++ libncurses5-dev bison libaio-dev

Step 3 Downloading and Extracting the package
We will be downloading the package to /usr/local folder

cd /usr/local
sudo wget http://cdn.mysql.com/Downloads/MySQL-5.5/mysql-5.5.28-linux2.6-i686.tar.gz
sudo tar zxvf mysql-5.5.28-linux2.6-i686.tar.gz
sudo ln -s mysql-5.5.28-linux2.6-i686 mysql

Step 4 Creating a user and group requires for MySQL

sudo groupadd mysql
sudo useradd -g mysql mysql

Step 5 Assigning proper permission to MySQL server directory

cd /usr/local/mysql
sudo chown -R mysql .
sudo chgrp -R mysql .

Step 6 Installing a sample database and starting a server

cd /usr/local/mysql
sudo scripts/mysql_install_db --user=mysql
sudo chown -R root .
sudo chown -R mysql data
sudo bin/mysqld_safe --user=mysql &

If everything goes well, you should have a MySQL instance running now. To check the same run following command

ps auxwww | grep mysql

Output would be

root@vidyadhar:/usr/local/mysql# ps auxwww | grep mysql
root     13946  0.2  0.0   2216   612 pts/0    S    17:19   0:00 /bin/sh bin/mysqld_safe --user=mysql
mysql    14010  3.1  2.3 293484 35096 pts/0    Sl   17:19   0:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/vidyadhar.err --pid-file=/usr/local/mysql/data/vidyadhar.pid

When done, you have a MySQL database ready.

Step 7 You need to set a root password. MySQL has it’s own user accounts, which are not related to the user accounts on your Linux machine. By default, the root account of the MySQL Server is empty. You need to set it. Please replace ‘mypassword’ with your actual password and myhostname with your actual hostname.

sudo /usr/local/mysql/mysqladmin -u root -h localhost password 'mypassword'
sudo /usr/local/mysql/mysqladmin -u root -h myhostname password 'mypassword'

Step 8 If you want MySQL to start automatically with every system restart, add the following lines to /etc/rc.local

/usr/local/mysql/support-files/mysql.server start

For basic commands refter this article MySQL Basic

Install the Cinnamon Desktop on Ubuntu

I was using unity for quite couple of months, but problem is I still don’t prefer it as my desktop environment at work place. If given an option between unity and gnome classic, I will definately choose gnome classic.

Recently I come to know about Cinnamon desktop. Cinnamon desktop is a project of Linux Mint, a desktop distribution based on Ubuntu Desktop itself. Cinnamon is a Gnome-Shell desktop fork. It is not strictly a Gnome-2 interface, although the developers aims are laudable to produce a simpler more traditional desktop interface.

Development seems to be rapid. It is usable and certainly fun to play with with a growing number of extensions to install to extend the base installation.

This article show the simple steps needed to install and use Cinnamon on Ubuntu 12.04

Step 1 Open a terminal and run following commands. Basically you are going to add repository to install Cinnamon desktop

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon

Step 2 Logout and select the Cinnamon session:
Install the Cinnamon Desktop on Ubuntu 1

Step 3 Enter you password and you’ll see the Cinnamon desktop
Install the Cinnamon Desktop on Ubuntu 2

showing the traditional start type menu and applet design from Gnome-2
Install the Cinnamon Desktop on Ubuntu 3

Extensions/Applets

The Cinnamon desktop uses the same philosophy as Gnome-Shell – functionality can be added to by installing Extensions & Applets.

Cinnamon uses its own Settings tool.

Cinnamon Settings
Install the Cinnamon Desktop extension applets on Ubuntu 1

Cinnamon Applets
Similar to gnome-shell extensions – you can install applets from a dedicated Mint website.
Install the Cinnamon Desktop extension applets on Ubuntu 2

Reset the Websphere Application Server Administrative Console Password

In our production enviournment we always enable security to protect our server from unauthorized users.

As a recent case, one of our administrator has forgot the password after re-setting it. We took following steps to disable the security for time-being so that we can reset the password.

WARNING: Please use this as the last resort and make sure the server is not in the middle of processing any transactions.

There are 2 possible methods for disabling security

Method 1 By way of wsadmin command
Note : WAS_HOME would be Websphere Application Server path where you have actully installed Websphere Application Server. In my case path is D:\IBM\WebSphere\AppServer

Step 1 Open a command prompt and type following commands

cd <WAS_HOME>\bin\
wsadmin -conntype NONE

Disable_Webspher_application-server-global-security-1
Disable_Webspher_application-server-global-security-2

Step 2 Run securityoff command in wsadmin console to disable the Global Security

wsadmin>securityoff

Disable_Webspher_application-server-global-security-3
Disable_Webspher_application-server-global-security-4

Step 3 Run exit command in wsadmin console to exit from the wsadmin command window

wsadmin>exit

Disable_Webspher_application-server-global-security-5

Step 4 That’s it. Now restart the servers.

Step 5 Enable the security from administrative console.

Step 6 Restart the servers.

Method 2 : By way of manual edit of security.xml file

Step 1 Create a copy of security.xml file from \profiles\DMGR_PROFILE\config\cells\CELL_NAME\ in case you need to roll back.

Step 2 Disable the security from the security.xml file (change the very first occurrence of enabled=”true” to enabled=”false”)
Disable_Webspher_application-server-global-security

Step 3 Restart the servers.

Step 4 Enable the security from administrative console.

Step 5 Restart the servers.

How to Disable the Recovery Mode Ubuntu

Today I have given the responsibility to setup Ubuntu machine for school group. Nowadays kids are very smart and they can do the system level changes easily if they know the root password or they can start the machine as a dingle user. I though to disable single user mode / recovery mode booting to make it little bit more secure

To achieve the same I have followed following step which help me to remove single user / recovery mode from GRUB permanently.

Step 1 Open a terminal with Ctrl+Alt+T shortcut and type this command and then hit Enter

gksu gedit /etc/default/grub

Step 2 The above command will open grub default file in gedit text browser. Search for a section like this one

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

Remove the # mark from the line #GRUB_DISABLE_RECOVERY=”true”. The changed section should look like this

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

Save the file by pressing Ctrl+S then exit Gedit.

Step 3 Then again going to the terminal, execute the below command:

sudo update-grub

Step 4 Restart to see that the recovery option has gone.

Page 6 of 55« First...«456789»102030...Last »
rss twitter facbook

Categories

Archives