Dienstag, 25. November 2008

Apache2: Redirect Subdomains to directory

Rewrite Mod anschalten und apache neu starten
a2enmod rewrite && invoke-rc.d apache2 restart


/etc/apache2/sites-enabled/000-default

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\..* [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.de([.*]?)$
RewriteCond /var/www/%1 -d
RewriteRule ^(.*) http://domain\.de/%1$1 [L]

Das heißt also:
asd.domain.de/qwe -> domain.de/asd/qwe
asd.domain.de -> domain.de/asd
www.domain.de -> domain.de

Windows Server 2003 x64 config für xen3.3

kernel = '/usr/lib/xen/boot/hvmloader'
builder = 'hvm'
memory = 1024
device_model = '/usr/lib/xen/bin/qemu-dm'

name = 'asd'

vif = [ 'type=ioemu, bridge=eth0' ]

# This is for using an LVM volume as a virtual disk
disk = [ 'phy:/dev/vg0/lvm-disk,hda,w', 'file:/home/images/Microsoft/Windows/2003_x64/EN_CD_01.iso,hdc:cdrom,r' ]
boot='cd'

# the number of cpus guest platform has, default=1
#vcpus=1
# enable/disable HVM guest ACPI, default=0 (disabled)
acpi=1
# enable/disable HVM guest APIC, default=0 (disabled)
apic=1
# enable SDL library for graphics, default = 0
#sdl=0
# enable VNC library for graphics, default = 0
#vnc=1
#vnclisten='0.0.0.0'

on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'

Donnerstag, 20. November 2008

Exchange 2007 setup on Windows 2003

DNS Suffix eintragen

Microsoft .NET Framework Version 2.0 Redistributable Package (x64)
Microsoft .NET Framework 2.0 Service Pack 1 (x64)

Windows PowerShell 1.0 English-Language Installation Package for Windows XP x64 Edition (KB926139)

IIS installieren !!!
Control Panel -> Add/Remove Software -> Windows Components -> IIS incl unterpalaber

Start -> Run
dcpromo

Active Directory-Domains and Trusts.
rechten Maustaste auf Domäne -> Raise bla.
Windows Server 2003 -> Raise.

Exchange 2007 SP1 installieren
Update Rollup 1 for Exchange Server 2007 Service Pack 1

Konfigurieren des Servers
Exchange Management Console -> Organization Config -> Hub Transports -> Send Connectors -> New Send Connector
Name: domain.de
Type: Internet
Address Namespace -> Add -> "*"
Exchange Management Console -> Server Config -> Hub Transports -> Receive Connectors
Default -> Rechte Maus -> Properties -> Permission Groups
Allow Anonymous

antiSpam Agent installieren
Exchange Management Shell -> installAntispamAgents.ps1
restart
Der dienst Exchange Edge Sync kann deaktiviert werden

Einstellungen des AntispamAgents findet man unter
Exchange Management Console -> Organiyation Config -> Hub Transports -> AntiSpam

Dort kann man zB bei Black List DNS Provider unter Properties folgende Einträge hinzufügen:
zen.spamhaus.org
bl.spamcop.net

Des Weiteren sollte man einen SPF Record für die eigene Domain anlegen!!!

Quelle & Weiterfuehrende links:

Mittwoch, 19. November 2008

bash: colorprompt

~/.bashrc
# actually check for color-support and set real fancy prompt
if (tput setaf 1) >&/dev/null
then
if [ $USER = 'root' ]
then
PS1='\[\e[0;31m\]\u@\h\[\e[m\]:\w\$ '
else
PS1='\[\e[0;32m\]\u@\h\[\e[m\]:\w\$ '
fi
fi


neu einlese
source .bashrc

~/.fluxbox/startup

für fbsetbg
aptitude install eterm


~/.fluxbox/overlay
background: none


~/.fluxbox/startup

fbsetbg -f /usr/share/backgrounds/warty-final-ubuntu.png

xrdb ~/.Xdefaults
unclutter -idle 1 &
whaw &
fbpager -w &
qbat &
nm-applet &
bluetooth-applet &
xcompmgr -c &
xterm &

exec /usr/bin/fluxbox

~/.fluxbox/keys

vVolume mit amixer und xosd

~/.fluxbox/keys

Mod1 F1 :RootMenu
OnDesktop Mouse1 :HideMenus
!OnDesktop Mouse2 :WorkspaceMenu
!OnDesktop Mouse3 :RootMenu

Mod1 r :Reconfigure


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Close Window
!!!!!!!!!!!!!!!!!!!!!!!!!
Mod1 F4 :Close
Mod1 Shift F4 :KillWindow


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Window - handling
!!!!!!!!!!!!!!!!!!!!!!!!

Mod1 Tab :NextWindow 1
Mod1 Shift Tab :PrevWindow
Mod1 Return :Fullscreen

Mod4 Return :Fullscreen
Mod4 m :Minimize
Mod4 s :Stick
Mod4 f :Shade

Mod4 Shift Right :MoveRight 1
Mod4 Shift Left :MoveLeft 1
Mod4 Shift Up :MoveUp 1
Mod4 Shift Down :MoveDown 1

Mod4 Control Left :Resize -1 0
Mod4 Control Right :Resize 1 0
Mod4 Control Up :Resize 0 -1
Mod4 Control Down :Resize 0 1

Mod4 Shift Control Left :MoveTo 0 * Left
Mod4 Shift Control Right :MoveTo 0 * Right
Mod4 Shift Control Up :MoveTo * 0 Upper
Mod4 Shift Control Down :MoveTo * 0 Lower


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Frame/Tab - handling
!!!!!!!!!!!!!!!!!!!!!!!!
Mod4 Left :PrevTab
Mod4 Right :NextTab
Mod4 d :DetachClient
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Workspace - handling
!!!!!!!!!!!!!!!!!!!!!!!!
Mod1 Control Right :NextWorkspace
Mod1 Shift Control Right :TakeToNextWorkspace
Mod1 Control Left :PrevWorkspace
Mod1 Shift Control Left :TakeToPrevWorkspace
!Mod1 Control Tab :NextWorkspace
!Mod1 Control Shift Tab :PrevWorkspace

Mod1 1 :Workspace 1
Mod1 Shift 1 :TakeToWorkspace 1
Mod1 2 :Workspace 2
Mod1 Shift 2 :TakeToWorkspace 2
Mod1 3 :Workspace 3
Mod1 Shift 3 :TakeToWorkspace 3
Mod1 4 :Workspace 4
Mod1 Shift 4 :TakeToWorkspace 4


!!!!!!!!!!!!!!!!!!!!!!!!!
! Sound
!!!!!!!!!!!!!!!!!
!XF86AudioMute :ExecCommand amixer -q set Master toggle
!XF86AudioRaiseVolume :ExecCommand amixer -q set Master 1+ unmute
!XF86AudioLowerVolume :ExecCommand amixer -q set Master 1- unmute
!http://supernerd0.blogspot.com/2008/12/debianxosd-volume-mit-amixer.html
XF86AudioMute :ExecCommand /path/amixerxosd.sh toggle
XF86AudioRaiseVolume :ExecCommand /path/amixerxosd.sh up
XF86AudioLowerVolume :ExecCommand /path/amixerxosd.sh down


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Direct Commands
!!!!!!!!!!!!!!!!!!!!!!!!!
Mod1 F2 :ExecCommand fbrun -bg black -fg white -font Matto -title Run -w 200 -h 30 -pos 0 729
Mod1 Escape :ExecCommand xterm
!Mod1 asciicircum :ExecCommand xterm
Mod4 L :ExecCommand sleep 0.1; xtrlock

screen: config

~/.screenrc
shell -$SHELL
startup_message off
defscrollback 10000
defutf8 on
altscreen on
vbell off # turn off visual bell

activity '[%c] Activity in %n%f %t!'
pow_detach_msg 'Bye'

autodetach on

bind r source ${HOME}/.screenrc
bind + resize +3
bind - resize -3

bind ^[ #disable copy with C-a Esc
bindkey -k F1 prev
bindkey -k F2 next


##
# yellow blue
#caption always "%{+u wk}%L=%-w%50>%?%F%{+b by}%:%{+b kd}%? %n %t %{-}%+w%-0< %-= %H - %c"

##
# gray
caption always "%{+u wk}%L=%-w%50>%?%F%{+b kd}%:%{+b dk}%? %n %t %{-}%+w%-0< %-= %H - %c"

##
# screen farben:
# 0 Black . leave color unchanged
# 1 Red b blue
# 2 Green c cyan
# 3 Brown / yellow d default color
# 4 Blue g green b bold
# 5 Purple k blacK B blinking
# 6 Cyan m magenta d dim
# 7 White r red r reverse
# 8 unused/illegal w white s standout
# 9 transparent y yellow u underline

##
# caption description:
# ------------------------------------------------------------------------------
# caption always "%?%F%{-b bc}%:%{-b bb}%?%C|%D|%M %d|%H%?%F%{+u wb}%? %L=%-Lw%45>%{+b by}%n%f* %t%{-}%+Lw%-0<"
#
# Anything I don't describe is treated literally.
#
# %? - Start of a conditional statement.
# %F - Use this part of the statement if the window has focus (i.e. it
# is the only window or the currently active one).
# %{-b bc} - Turn off bold, blue foreground, cyan background.
# %: - else
# %{-b bb} - Turn off bold, blue foreground, blue background (this obscures
# the text on non-focused windows and just gives a blue line).
# %? - End conditional statement.
# %C - time (hh:mm, leading space) in 12 hour format
# %D - Three-letter day-of-week appreviation
# %M - Three-letter month appreviation
# %d - Day of the month
# %H - hostname
# %? - Start of conditional statement.
# %F - Use this part of the statement if the window has focus.
# %{+u wb} - underlined, white foreground, blue background
# %? - End conditional (if not focused, text remaind blue on blue).
# %L= - truncation/padding point. With the 'L' qualifier, basically
# just acts as a reference point. Further truncation/padding is
# done relative to here, not the beginning of the string
# %-Lw - window list up to but not including the current window (-),
# show window flags (L)
# %45> - truncation/padding marker; place this point about 45% of the
# way into the display area (45)
# %{+b by} - add bold (still underlined from before), blue foreground,
# yellow background
# %n - number of the current window
# %f - flags for current window
# %t - title of current window
# %{-} - undo last color change (so now we're back to underlined white
# on blue) (technically, this is a pop; a second invocation
# would drop things back to unadorned blue on cyan)
# %+Lw - window list from the next window on (-), show window flags (L)
# %-0< - truncation/padding point. Place this point zero spaces (0)
# from the right margin (-).

vim: config

~/.vimrc

set nocompatible " disable vi shit

set autoindent " nice indent activate all three
set smartindent
set cindent

set showmatch " Show matching brackets

"set guioptions-=T " No toolbar

set vb t_vb= " turn off beep
set novisualbell " turn off visual bell

set showcmd " display incomplete commands

set hlsearch " highlight searches
set incsearch " find while search
"set virtualedit=all " to be able to set curser behind text

set nobackup " do not keep a backup file
set number " show line numbers
set ignorecase

set scrolloff=5 " keep 5 lines when scrolling

set nowrap " don't wrap lines
set laststatus=2 " 2 line statusbar

set tb=icons " set Toolbar in GUI

syntax on " syntax highlighing
"colorscheme elflord " use this color scheme
colorscheme delek
set background=dark " adapt colors for background


set mouse=a
map [62~

Xen 3.3 setup on debian

1. Debian etch Installation


[x] Standard System

aptitude install python­pyopenssl make­ gcc­ ncurses­dev­ python­twisted ­libvncserver­dev libz­dev patch bin86 ­libssl­dev ­gettext ­libx11­dev­ python­dev­ tetex­extra tetex­base gs­common ­pdfjam ­graphviz fig2dev transfig bridge­utils bcc build-essential mercurial

wget http://bits.xensource.com/oss‐xen/release/3.3.0/xen‐3.3.0.tar.gz
tar xvzpf xen‐3.3.0.tar.gz
cd xen‐3.3.0
make dist
./install.sh

aptitude search linux‐image‐xen

je nach Platform auswählen ‐686 ‐amd64 usw.
aptitude install linux‐image‐xen‐XXXX

Autostart xend
update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

wenn nicht vorhanden
mkdir /var/lock/subsys/

Damit die firewall auf dom0 nur dom0 schützt und nicht auch die domUs blockt müssen folgende Schritte ausgeführt werden (Thanks to James from xen-users Mailinglist)
echo 0 > /proc/sys/net/bridge/bridge-nf-call-iptables
echo 0 > /proc/sys/net/bridge/bridge-nf-call-ip6tables
echo 0 > /proc/sys/net/bridge/bridge-nf-call-arptables

Wichtig
echo 1 > /proc/sys/xen/independent_wallclock

Xen Config für Win2003 x64 hier