Apache 2 og PHP 4.3.1

wget http://www.php.net/get/php-4.3.1.tar.gz/from/dk2.php.
wget <apache>

tar zxf httpd-2.0.44.tar.gz
tar zxf php-4.3.1.tar.gz

cd httpd-2.0.44
mkdir /www
./configure --prefix=/www --enable-so
make
make install

cd ../php-4.3.1
./configure --with-apxs2=/www/bin/apxs --prefix=/www/php
make
make install

cp php.ini-dist /www/php/lib/php.ini

echo 'LoadModule php4_module modules/libphp4.so' >> /www/conf/httpd.conf
echo 'AddType application/x-httpd-php .php' >> /www/conf/httpd.conf

rediger httpd.conf, tilføj ‘index.php’ til linien ‘DirectoryIndex’

Så skulle den funke

Udgivet i Apache, Knowledge Base, Lamp, Linux, Old Base | Skriv en kommentar

Dk/Uk Layout

The old xmodmap hack has been remove, this is mucho more neater.

[submenu] (Keyboard Layout)
[exec] (Danish) {setxkbmap dk}
[exec] (English) {setxkbmap us}
[end]

No other files are needed, this is blackbox/fluxbox menu-style.

Udgivet i Knowledge Base, Linux, Old Base, Workstation | Skriv en kommentar

PPPoE (router) i freebsd

To enable PPPoO in freebsd, your /etc/ppp/ppp.conf should look like this:

default:
  set log Phase tun command
  set ifaddr 10.0.0.1/0 10.0.0.2/0

internet:
  set device PPPoE:INTERFACE
  set authname USERNAME
  set authkey PASSWORD
  set dial
  set login
  add default HISADDR

Now "ppp -ddial internet" will connect you to the internet, there must be no default route prior to this.

If you want to setup the machine to connect to the internet on bootup, insert the following in /etc/rc.conf , 'ppp_nat="YES"' make freebsd share the internet connection.


ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="internet"

 

Udgivet i FreeBSD, Knowledge Base, Networking, Old Base | Skriv en kommentar

ipv6 tools

http://www.argh.org/IPv6/IPv6-HOWTO/IPv6-HOWTO-3.html

Udgivet i Knowledge Base, Links, Linux, Networking, Old Base, Uncategorized | Skriv en kommentar

USB keyring under linux

modprobe usb-uchi
modprobe usb-storage
mount /dev/sda1 /mnt   (driveren emulere scsi enhed, se i dmesg hvad enheden hedder)

 

Udgivet i Knowledge Base, Linux, Old Base, Workstation | Skriv en kommentar

Kvael klokken i linux

X: xset b off
console: setterm -blength

 

Udgivet i Knowledge Base, Linux, Old Base, Uncategorized, Workstation | Skriv en kommentar

XF86Config med twinview og trippelskærm

den ligger på:
http://blackthorne.dk/linux/?6=xf86&8=Workstation&10=linux

Udgivet i Knowledge Base, Linux, Old Base, Workstation | Skriv en kommentar

irc bouncer

iptables -t nat -A PREROUTING -p tcp -d 10.2.1.1 --dport 16667 -j DNAT --to 80.161.143.54:6667

 

Udgivet i IRC, Knowledge Base, Linux, Networking, Old Base | Skriv en kommentar

Script til SSH tuneller

Ssh should be configured to log in with keyfiles(not password)

And then this script will do the trick, should explain itself.

-----


#!/bin/sh
SERVER_HOSTNAME=geekhosting.dk
SERVER_USERNAME=root
SERVER_IFIPADDR=10.20.1.1
CLIENT_IFIPADDR=10.20.1.2
MYSUBNET=10.1.0.0/16
LOCAL_SSH_OPTS="-P"

PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11/:

PPPD=/usr/sbin/pppd
SSH=/usr/bin/ssh
ROUTE=/sbin/route
if ! test -f $PPPD  ; then echo "can't find $PPPD";  exit 3; fi
if ! test -f $SSH   ; then echo "can't find $SSH";   exit 4; fi


case "$1" in
  start)
    # echo -n "Starting vpn to $SERVER_HOSTNAME: "
    ${PPPD} updetach noauth passive pty "${SSH} ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o Ba
tchmode=yes sudo ${PPPD} nodetach notty noauth" ipparam vpn ${CLIENT_IFIPADDR}:${SERVER_IFIPADDR}
    # echo "connected."
     ${ROUTE} add -net 10.0.0.0/8 gw ${CLIENT_IFIPADDR}
     ssh ${SERVER_HOSTNAME} route add -net ${MYSUBNET} gw ${SERVER_IFIPADDR}
        ;;
  stop)
        # echo -n "Stopping vpn to $SERVER_HOSTNAME: "
        PID=`ps ax | grep "${SSH} ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o" | grep -v ' pas
sive ' | grep -v 'grep ' | awk '{print $1}'`
        if [ "${PID}" != "" ]; then
          kill $PID
          echo "disconnected."
        else
          echo "Failed to find PID for the connection"
        fi
    ;;

  config)
    echo "SERVER_HOSTNAME=$SERVER_HOSTNAME"
    echo "SERVER_USERNAME=$SERVER_USERNAME"
    echo "SERVER_IFIPADDR=$SERVER_IFIPADDR"
    echo "CLIENT_IFIPADDR=$CLIENT_IFIPADDR"
  ;;

  *)
    echo "Usage: vpn {start|stop|config}"
    exit 1
    ;;
esac

exit 0
Udgivet i Knowledge Base, SSH | Skriv en kommentar

Script til ssh tuneller

Ssh should be configured to log in with keyfiles(not password)

And then this script will do the trick, should explain itself.

#!/bin/sh
SERVER_HOSTNAME=geekhosting.dk
SERVER_USERNAME=root
SERVER_IFIPADDR=10.20.1.1
CLIENT_IFIPADDR=10.20.1.2
MYSUBNET=10.1.0.0/16
LOCAL_SSH_OPTS="-P"

PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11/:

PPPD=/usr/sbin/pppd
SSH=/usr/bin/ssh
ROUTE=/sbin/route
if ! test -f $PPPD  ; then echo "can't find $PPPD";  exit 3; fi
if ! test -f $SSH   ; then echo "can't find $SSH";   exit 4; fi


case "$1" in
  start)
    # echo -n "Starting vpn to $SERVER_HOSTNAME: "
    ${PPPD} updetach noauth passive pty "${SSH} ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o Ba
tchmode=yes sudo ${PPPD} nodetach notty noauth" ipparam vpn ${CLIENT_IFIPADDR}:${SERVER_IFIPADDR}
    # echo "connected."
     ${ROUTE} add -net 10.0.0.0/8 gw ${CLIENT_IFIPADDR}
     ssh ${SERVER_HOSTNAME} route add -net ${MYSUBNET} gw ${SERVER_IFIPADDR}
        ;;
  stop)
        # echo -n "Stopping vpn to $SERVER_HOSTNAME: "
        PID=`ps ax | grep "${SSH} ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o" | grep -v ' pas
sive ' | grep -v 'grep ' | awk '{print $1}'`
        if [ "${PID}" != "" ]; then
          kill $PID
          echo "disconnected."
        else
          echo "Failed to find PID for the connection"
        fi
    ;;

  config)
    echo "SERVER_HOSTNAME=$SERVER_HOSTNAME"
    echo "SERVER_USERNAME=$SERVER_USERNAME"
    echo "SERVER_IFIPADDR=$SERVER_IFIPADDR"
    echo "CLIENT_IFIPADDR=$CLIENT_IFIPADDR"
  ;;

  *)
    echo "Usage: vpn {start|stop|config}"
    exit 1
    ;;
esac

exit 0

 

Udgivet i Uncategorized | Skriv en kommentar