It is currently Thu Sep 09, 2010 8:18 pm

News News of Linux Distributions

Site map of Linux Distributions » Forum : Linux Distributions

Guides and tutorials for Red Hat Linux, Debian, Suse and others.

CentOS Apache 2.2.3 Directory index forbidden by Options directive

After installing Apache 2.2.3 on Centos 5.5, adding virtual domains with Directory indexes will not be possible and the apache welcome page will be displayed if there isn't an index file in the root directory of the vhost.

Directory index forbidden by Options directive


This behavior can be fixed by editing /etc/httpd/conf.d/welcome.conf and change it from:
Code: Select all
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>


to
Code: Select all
<LocationMatch "^/+$">
    Options Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>
...


Configure bind (named server) to listen on localhost on Debian

By default on a Debian distro, named daemon listens on all available interfaces. In order to change it to listen on a specific IP address or localhost, edit the named.conf.options

# vim /etc/bind/named.conf.options
options {
directory "/var/cache/bind";

// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113

// forwarders {
// 0.0.0.0;
// ...
Read more : Configure bind (named server) to listen on localhost on Debian | Views : 215 | Replies : 0


Linux umount -f: umount2: Device or resource busy Linux umount -f: umount2: Device or resource busy

Code: Select all
# umount -fv /test
umount2: Device or resource busy
umount: /data: device is busy


Code: Select all
# fuser -mvu /test
#


Make sure that the filesystem is not exported via NFS (locked by lockd). Stop NFS/portmap services and retry unmounting.
Read more : Linux umount -f: umount2: Device or resource busy | Views : 280 | Replies : 0


Linux change the password with output from echo command (standard input) Linux change the password with output from echo command (standard input)

In Linux it is possible to change a user's password with the ouput of an echo command, coming from standard input, via pipe.

NAME
passwd - update a user’s authentication tokens(s)

SYNOPSIS
passwd [-k] [-l] [-u [-f]] [-d] [-n mindays] [-x maxdays] [-w warndays] [-i inactivedays] [-S] [--stdin] [user-
name]

DESCRIPTION
Passwd is used to update a user’s authentication token(s).

Passwd is configured to work through the Linux-PAM API. Essentially, it initializes itself as ...


Linux reloading inittab without reboot Linux reloading inittab without reboot

Linux refresh init process after modifying inittab without reboot

man init
After it has spawned all of the processes specified, init waits for one of its descendant processes to die, a powerfail signal, or until it is signaled
by telinit to change the system's runlevel. When one of the above three conditions occurs, it re-examines the /etc/inittab file. New entries can be
added to this file at any time. However, init still waits for ...
Read more : Linux reloading inittab without reboot | Views : 470 | Replies : 0


Linux Shell: "Cannot overwrite existing file" when the file is owned by you Linux Shell: "Cannot overwrite existing file" when the file is owned by you

If the shell noclobber environment variable is set, you will not be able to overwrite a file's content by redirecting some output to it.
Code: Select all
# echo "2nd Overwritten content">tmp.file
bash: tmp.file: cannot overwrite existing file

First option would be to disable the noclobber variable:
Code: Select all
# set +o noclobber; set -o | grep nocl
noclobber       off


The second option is to use the pipe (|)right after the redirection sign:
# echo "2nd Overwritten content" ...


Linux Shell: Protecting against accidental output redirection and file overwrite Linux Shell: Protecting against accidental output redirection and file overwrite

Redirecting standard output/error in a Linux/BSD shell can very easy overwrite a file, removing it's content, making it impossible to recover (unless there's a backup).

To prevent this sh, bash and ksh shells implement an evironment variable called noclobber.

# cat tmp.file
If you use a lot of file redirection in your scripts it's quite easy to overwrite existing files accidentaly.
To prevent this, most shells implement the noclobber environment variable.

# echo "Overwritten content">tmp.file ...


Debian: Quick dpkg query commands Debian: Quick dpkg query commands

Here are a few tricks for querying Debian's dpkg command.

Upgrade or install a package:
Code: Select all
# dpkg -i package-name.deb


Listing installed packages in Debian. You can use directly package name after '-l' if you know it's name.:

# dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-============================================-============================-============================================
ii acl 2.2.47-3 Access control list utilities
ii acpi 1.4-2 displays information on ACPI devices
ii acpi-support-base 0.123-1 scripts for handling base ...
Read more : Debian: Quick dpkg query commands | Views : 330 | Replies : 0


Installing /w PXE booting RHEL 5 over the network Installing /w PXE booting RHEL 5 over the network

Installing and PXE booting RHEL 5 over the network

In the past weeks I needed to install Red Hat Enterprise 5 on two remote HP DL385 blades (if I remember correctly) and I had no one in the datacenter to insert the DVD in the drives. So the situation needed a network installation using PXE booting (Pre-boog eXecution Environment).

Since this was my first encounter with PXE booting and network installations on Linux Google ...
Read more : Installing /w PXE booting RHEL 5 over the network | Views : 654 | Replies : 0


 

Login  •  Register


Statistics

Total posts 120 • Total topics 103 • Total members 35

cron