Archive for March 9th, 2008

script generates a MAC address for Xen guests

#!/usr/bin/python
# macgen.py script generates a MAC address for Xen guests
#
import random
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
print ':'.join(map(lambda x: "%02x" % x, mac))

No Comments

Hide sendmail version

vim sendmail.cf

Cambiar lo siguiente:

# SMTP initial login message (old $e macro)
#O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
O SmtpGreetingMessage=$j Sendmail ; $b

No Comments

Hide apache and php version

http://nixcraft.com/server-configuration-tutorials/746-apache-php-web-server-security-hiding-version-information.html

How do I Hide Apache Version info?
Open httpd.conf file (located in /etc/httpd/ directory /etc/apache2/ )

 

Code:

vi httpd.conf

Set Apache ServerTokens to product only but don’t show version and other info:

 

Code:

ServerTokens Prod

This directive controls whether Server response header field which is sent back to clients includes a description of the generic OS-type of the server as well as information about compiled-in modules.

Setting this to Prod only displays Apache and nothing else.

Set Apache ServerSignature off

 

Code:

ServerSignature Off

The ServerSignature directive allows the configuration of a trailing footer line under server-generated documents.

How do I hide php info?
Open php.ini (located in /etc/php.ini or /etc/php5 or /etc/php4 directory)

 

Code:

vi php.ini

Make sure php does not display errors and other php information. Modify add setting as follows:

 

Code:

expose_php = Off

display_errors=Off

register_globals = Off

Also send all errors to /var/log/php-scripts-error.log and not on screen to end user. It can provide serious information to user.
error_log = /var/log/httpd/php-scripts-error.log

Restart Apache.

 

Code:

/etc/init.d/httpd restart

Now all php script errors are written to /var/log/httpd/php-scripts-error.log. Ask your website developers to use following commands to view log files

 

Code:

tail -f /var/log/httpd/php-scripts-error.log

vi /var/log/httpd/php-scripts-error.log.

For more info please read Apache 2 docs http://httpd.apache.org/docs/2.2/mod/core.html

No Comments

mac bsd darwin ports

http://darwinports.com/ 

No Comments

Using multiple network cards in XEN 3.0

you need 2 bridge interfaces:
xenbr0 = eth0
xenbr1 = eth1

create a new script with the following lines: (ex: multiplebridge.sh) in /etc/xen/scripts/

#!/bin/sh
dir=$(dirname “$0″)
“$dir/network-bridge” “$@” vifnum=0 netdev=eth0 bridge=xenbr0
“$dir/network-bridge” “$@” vifnum=1 netdev=eth1 bridge=xenbr1

make the script executable (chmod +x /etc/xen/scripts/multiplebridge.sh)

modify /etc/xen/xend-config.sxp
change the line:
(network-script network-bridge)
to
(network-script multiplebridge.sh)

modify your virtual machine to use the new bridge interface:
ex:
vif = [ 'bridge=xenbr1', ]

Hope this helps.

another help Read the rest of this entry »

No Comments