Archive

Posts Tagged ‘sudo’

Basic System admin Tips in Debian

December 15, 2011 Leave a comment

How to change Log in message.(MOTD-Message of The Day)

sudo vim /etc/motd

 If you want to avoid /etc/motd to be overwritten with the old version upon reboot you also have to edit the following

sudo vim /etc/default/rcS

in this file change the EDITMOTD “yes” to “no”

Changing the computer name

sudo vim /etc/hostname

Categories: Sys Admin Tags: , ,

Adding Oracle ‘dba’ group to Ubuntu User

April 20, 2011 1 comment

1- Go to System->Administration->Users and groups.

Then select the “Group” tab, search for the “dba” group, click on properties and select your user moving from the pane on the left to the pane on the right. Accept the modification and you’re done.

2- use usermod from a terminal to add your user to the group:

sudo usermod -a -Gdba stan

Although I would recommend you keep starting and stopping the database with the oracle default user (just su – oracle in the terminal when you need to do it). It’s like the concept behind the “sudo” command in ubuntu: you’re protecting the user and yourself from mistakes, other people accesing your machine.

Categories: Oracle Tags: , , ,

Executing Our Own Shell Script When OS Booting in Debian

August 4, 2010 1 comment

Write a shell script.

To Open the folder with super user permission

#! /bin/sh

sudo nautilus

save the file as sample.sh

Make sample file as executable

chmod a+x sample.sh

Copy the file into init.d folder

sudo cp sample.sh /etc/init.d/

check which is default runlevel

sudo vi /etc/inittab

# The default runlevel.
id:2:initdefault:

This means your default run level is 2.

Give the link to to the default run level

ln /etc/init.d/sample.sh /etc/rc2.d/S10sample

why i gave the link rc2.d, because of the default runlevel is 2 so i gave the link to rc2.d.

In S10sample ‘ S ‘ is mandatory 10 is number u can give your own number from 10 to 99

After that update rc by following code

sudo update-rc.d sample defaults

A(Apache),M(MySql),P(PHP) Installation Steps

June 3, 2008 Leave a comment

LAMP Installation

The Below Steps Showing the installation of the Apache,MySql and PHP in your ubuntu 7.10 machine.

Installing Apache

Now we can get started installing. This will take a few minutes, so grab a beer (or your favorite beverage,) and off we go. To install Apache, type or paste this into your terminal:

sudo apt-get install apache2

Testing Apache

Once apache2 is done installing, you can go ahead and test it by using:

sudo /etc/init.d/apache2 start

If you get a message that it’s already running, you’re good to go. Now, open up your browser and navigate to:

http://localhost

You should see a page just like this. As long as you do,

we’re ready to install PHP.

Installing PHP

Again, to install PHP, type or paste this into your terminal:

sudo apt-get install php5 libapache2-mod-php5

Once it’s finished installing, restart apache, using:

sudo /etc/init.d/apache2 restart

Testing PHP

Now, let’s make sure that PHP is working properly. To do this, we’re going to run phpinfo(). You can, of course, swap out gedit with your editor of choice.

sudo gedit /var/www/phpinfo.php

Type or paste the following into the document, and save it. (remove the space before the ‘?php’)

<?php phpinfo(); ?>

Now we can test PHP by browsing to:

http://localhost/phpinfo.php

You should see all of the info about your PHP installation listed on the page, like so. For security reasons, you should remove this page when you’re sure that PHP works.

Installing MySQL

Now we can conquer MySQL

sudo apt-get install mysql-server

As MySQL is installing, it will ask you to configure your root password. Make sure that you type it correctly, as it will only ask you once.

Testing MySQL

After that is finished, you can test MySQL by running this, where zzzz is your password. -p is must needed

mysql -uroot -pzzzz

If it brings you to a MySQL prompt, you’re done! You can type exit to get out of MySQL.

Installing phpMyAdmin

Now, if you want to install phpMyAdmin to have a front end for MySQL, you can use the following.

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

then it shows the window in terminal in that select highlighted option apache

[*]apache2

[ ] apache

[ ] apache-ssl

[ ] apache-perl

It will ask you to choose a webserver to configure automatically, you can use the space bar to select Apache2. And after that’s finished, restart one last time.

sudo /etc/init.d/apache2 restart

Finished!

Now you have your own LAMP (Linux Apache MySQL PHP) server, with phpMyAdmin.

In PhpMyAdmin give username and password

Useful Commands and Default Locations

To Save yourself some time, you can make launchers for Apache or MySQL start, stop, and restart if you feel the need.

Apache

sudo /etc/init.d/apache2 start

sudo /etc/init.d/apache2 stop

sudo /etc/init.d/apache2 restart

MySQL

sudo /etc/init.d/mysql start

sudo /etc/init.d/mysql stop

sudo /etc/init.d/mysql restart

Locations

/var/www/ — Document Root

http://localhost/phpmyadmin — phpMyAdmin

/usr/share — phpMyAdmin local location

%d bloggers like this: