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

Thursday, January 13, 2011

How to edit /etc/sudoers?

Hi Friends,

Well you must have come across various situations when you need to quickly edit the /etc/sudoers file for making changes.

Though it is not straight forward to open in an vi editor & edit it, below are time saving commands for Linux & Unix to quickly edit the same:

Linux:
bash-3.00$ sudo visudo

Unix:
bash-3.00$ /usr/local/bin/sudo /usr/local/sbin/visudo

VISUDO opens the /etc/sudoers file in a temporary editable mode, which can be changed and saved to reflect changes immediately.

Hope this tip helps :-)

Keywords:
Linux, Unix, Red Hat, Solaris, /etc/sudoers, vi, visduo, sudo, edit, etc

Saturday, May 22, 2010

Reset runtime Apache access.log & error.log

Hi Friends,

Today morning i got a page from our data center that one of the Production Apache based Webserver diskspace was almost full & most of the space was consumed by access.log & error.log!

Well, i knew this would happen some day since it has been a year we put these machines in Production, moreover we havent setup the log rotation for access.log & error.log.

Now, i had two tasks at my hand...
1) Take a quick backup of both the log files.
2) Reset/Clear the logs to size zero without bouncing the Apache Webserver services, i.e. at Runtime.

Solution:
1) Took a zipped backup on another disk in the same machine:
bash$ zip /d01/Apache_BK/access_log_20052010.zip access.log
bash$ zip /d01/Apache_BK/error_log_20052010.zip error.log

2) Reset/Clear the logs to size zero using /dev/null:
bash$ cp /dev/null access.log
bash$ cp /dev/null error.log

OR

bash$ cat /dev/null > access.log
bash$ cat /dev/null > error.log

Well, using /dev/null is very effective on Linux & Unix platforms, but if you are wondering if we have something similar to that in Windows, then the answer is yes!

C:\>type NUL > access.log
C:\>type NUL > error.log

Just hope that Windows havent locked the log file with an exclusive handle ;-)
If you have a lock on the file & need to reset the log file without restarting the Apache services, then your only option is to install Unlocker (http://ccollomb.free.fr/unlocker/)

Hope this tip helps as no one wants to bounce a Production system just for taking a log backup & resetting its size to zero :-D

Enjoy!

Keywords:
Oracle HTTP Server, Apache, OHS, /dev/null, NUL, access.log, error.log, zip, backup, etc

Saturday, December 31, 2005

Ubuntu 5.10 (Breezy Badger) Step-by-step Guide for Dual Boot Installation

I am installing Ubuntu 5.10 Breezy BadgerSo lets begin with insertion of Install CD in Cd-drive and booting from
the CD-Rom...
1)Once the CD Autoboots, you would get a Ubuntu Logo Screen with 'boot' prompt...
2)Press ENTER to begin the installation
Note: Entire Installation is in TEXT-Based Mode, no GUI-based is available.
3)It would prompt for 'Choose Language', select English
4)Now it prompts for 'Choose Location', select as appropriate5)Keyboard Layout selection confirmation dialog appears...confirm and press ENTER
6)Now various hardware detection and IDE,Ports configuration would take place...so sit back and relax
7)Various Modules and Softwares would be Unpacked next...
8)Network configuration box appears.. It wud try auto-detect via DHCP or if it fails, it would ask whether you want to configure ManuallyYou can select as appropriate...
Note: If you use DSL or PPPoe type Internet Connection, do not configure your internet manually, just skip to next step
9)Now it prompts for the Hostname... by default it says 'Ubuntu', you can configure it to anything...its just like Computer Name while Windows Installation
10)Now main part comes is Partitioning of Disks...
Now, select your appropriate HDD(in-case of multiple hdd's)..
Mostly it would be something like
Erase entire disk: IDE1 master(hda) - 37GB, etc..
11)Next screen it would show you two partitions made, one of 'ext3' filesystem and other a 'SWAP' partitionIf you selected the proper HDD in earlier step... select YES for 'Write Changes to the disk'
12)Now installation of Base System would begin so sit back and enjoy..
13)Timezone configuration box prompts after above step..select your Timezone and confirm
14)Now user setup comes up... Enter your full name for the User, in next screen select a short username for logon (This username is what you would use to login) and then the password bviously!
15)Now, the Boot Loader configuration comes... If it shows your already installed Windows Installation, like Windows XP Professional.. its safe to install the Boot Loader on MBR without any problems...
16)Now, it would prompt for a REBOOT... upon reboot..enter your Bios and put First Boot Priority to Harddisk i.e. ur Windows one
17)Now, it would show you Loading GRUB 1.5..and then list various OS...with 4 entries for ubuntu and under Other Operating Systems, it would list Windows XP Professional
18)Boot your Ubuntu, the first in the listit would complete the remaining installation
19)Now X-Server Configuration appears.. select the various resolutions your monitor supports and confirm
20)Thats it.. your installation is completed and your Ubuntu Logon screen appears.. Put in your 'username' used in step14 and password to get inside.
Now, after installation you can reboot and use your Windows XP by selecting it from the Boot Menu

If you want to configure Windows XP as the default OS for booting each time, boot into Ubuntu Navigate to My Computer>Filesystem>boot>grub>menu.lst
Open the menu.lst file in text editor..it wud be having something like this at start:

# Generated by grubconf-0.5.1
default=1
timeout=10

Change the default=1 to default=4
Thats it...now your XP is the default booting system next time onwards.

Enjoy your Ubuntu..and do let me know if you face problems..
Few Screenshots...



A comprehensive list of screenshots while installation can be checked at: http://shots.osdir.com/slideshows/slideshow.php?release=342&slide=1

Keywords: breezy badger,edubuntu,free,installing ubuntu,linux,linux operating system,linux os,linux support,open source,operating system,software,ubuntu,ubuntu desktop,ubuntu download,ubuntu how to,,ubuntu install,ubuntu laptop,ubuntu linux,ubuntu screenshots,ubuntu server,xubuntu