apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

rdf2:/etc/apache2# cat httpd.conf
ServerName rdf2.sk.mcn.dk
rdf2:/etc/apache2#

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

HTTP 301 Redirects med php

For at teste hvilken type redirect en given side laver:

@ telnet localhost 80
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
GET / HTTP/1.1
Host: lcauto.dk

HTTP/1.1 302 Found
Date: Sat, 23 Aug 2008 23:33:49 GMT
Server: Apache/2.2.3 (Debian) PHP/4.4.4-8+etch6 proxy_html/2.5
X-Powered-By: PHP/5.2.0-8+etch11
location: http://www.lc-auto.dk/
Content-Length: 0
Content-Type: text/html; charset=ISO-8859-1

Connection closed by foreign host.

for at lave den rigtigt:

<?
Header( “HTTP/1.1 301 Moved Permanently” );
header(‘location: http://www.lc-auto.dk/’);
?>

skal vi nu vaere helt sikker paa at fange alt kan vi lave flg. htaccess fil:

RewriteEngine on
RewriteBase /

RewriteRule ^(.*)$/? index.php [L]

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

Installing a shiny new Debian Etch as a VMWare Jail Server

mkdir install
cd install

wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.6-91891.tar.gz
wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.6-91891.tar.gz

tar zxf VMware-mui-1.0.6-91891.tar.gz
tar zxf VMware-server-1.0.6-91891.tar.gz

apt-get install linux-headers-`uname -r` x-window-system gcc psmisc

// Just accept whatever it says when it asks for screen resolution

10 x default

“Read license agreement” Enter + 25 x Space “yes” enter

5 x default

Using compiler “/usr/bin/gcc”. Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.18-6-686/build/include]

(Default value should work)

Do you want networking for your virtual machines? (yes/no/help) [yes]

(Default value should work)

Your computer has multiple ethernet network interfaces available: eth0, eth1,
eth2, eth3. Which one do you want to bridge to vmnet0? [eth0]

(Default value should work)

The following bridged networks have been defined:

. vmnet0 is bridged to eth0

Do you wish to configure another bridged network? (yes/no) [no]

Do you want to be able to use NAT networking in your virtual machines? (yes/no)
[yes]

NO!!!!

5 x default

Enter serial number

jail01:~/install/vmware-server-distrib# inetd

Connect with console and se that it is working before proceding

MUI (optional)

cd ..
cd vmware-mui-distrib/

./vmware-install.pl

Read and agree with eula, enter, 26x Space, “yes” enter

9 x default

And now connect to port : 8333 to se it working

Finally reboot, and confirm that all is allright once again

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

Nulstil alle porte på en Cisco 3550

interface FastEthernet0/1
 no switchport
 no ip address
exit
interface FastEthernet0/2
 no switchport
 no ip address
exit
interface FastEthernet0/3
 no switchport
 no ip address
exit

interface FastEthernet0/4
 no switchport
 no ip address
exit
interface FastEthernet0/5
 no switchport
 no ip address
exit
interface FastEthernet0/6
 no switchport
 no ip address
exit

interface FastEthernet0/7
 no switchport
 no ip address
exit
interface FastEthernet0/8
 no switchport
 no ip address
exit
interface FastEthernet0/9
 no switchport
 no ip address
exit
interface FastEthernet0/10
 no switchport
 no ip address
exit
interface FastEthernet0/11
 no switchport
 no ip address
exit
interface FastEthernet0/12
 no switchport
 no ip address
exit
interface FastEthernet0/13
 no switchport
 no ip address
exit
interface FastEthernet0/14
 no switchport
 no ip address
exit
interface FastEthernet0/15
 no switchport
 no ip address
exit
interface FastEthernet0/16
 no switchport
 no ip address
exit
interface FastEthernet0/17
 no switchport
 no ip address
exit

interface FastEthernet0/18
 no switchport
 no ip address
exit
interface FastEthernet0/19
 no switchport
 no ip address
exit
interface FastEthernet0/20
 no switchport
 no ip address
exit
interface FastEthernet0/21
 no switchport
 no ip address
exit
interface FastEthernet0/22
 no switchport
 no ip address
exit
interface FastEthernet0/23
 no switchport
 no ip address
exit
interface FastEthernet0/24
 no switchport
 no ip address
exit
interface FastEthernet0/25
 no switchport
 no ip address
exit
interface FastEthernet0/26
 no switchport
 no ip address
exit
interface FastEthernet0/27
 no switchport
 no ip address
exit
interface FastEthernet0/28
 no switchport
 no ip address
exit
interface FastEthernet0/29
 no switchport
 no ip address
exit
interface FastEthernet0/30
 no switchport
 no ip address
exit
interface FastEthernet0/31
 no switchport
 no ip address
exit
interface FastEthernet0/32
 no switchport
 no ip address
exit
interface FastEthernet0/33
 no switchport
 no ip address
exit

interface FastEthernet0/34
 no switchport
 no ip address
exit
interface FastEthernet0/35
 no switchport
 no ip address
exit
interface FastEthernet0/36
 no switchport
 no ip address
exit
interface FastEthernet0/37
 no switchport
 no ip address
exit
interface FastEthernet0/38
 no switchport
 no ip address
exit
interface FastEthernet0/39
 no switchport
 no ip address
exit
interface FastEthernet0/40
 no switchport
 no ip address
exit
interface FastEthernet0/41
 no switchport
 no ip address
exit
interface FastEthernet0/42
 no switchport
 no ip address
exit
interface FastEthernet0/43
 no switchport
 no ip address
exit
interface FastEthernet0/44
 no switchport
 no ip address
exit
interface FastEthernet0/45
 no switchport
 no ip address
exit
interface FastEthernet0/46
 no switchport
 no ip address
exit
interface FastEthernet0/47
 no switchport
 no ip address
exit
interface FastEthernet0/48
 no switchport
 no ip address
exit

 

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

Cisco 2950 – STP With Uplinkfast, trunks and VLans

no service password-encryption

hostname HOSTNAME

enable secret 5 $ENCRYPTED PASSWORD/
enable password UNECRYPTED PASSWORD

ip subnet-zero
vtp domain pre-dmz
vtp mode transparent

spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
spanning-tree uplinkfast
no spanning-tree vlan 1


vlan 20
 name office
exit
vlan 30
 name drift
exit

interface FastEthernet0/1
 switchport mode trunk
 no ip address 
exit

interface FastEthernet0/2
 switchport mode trunk
 no ip address 
exit


interface FastEthernet0/3
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/4
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/5
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/6
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/7
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/8
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/9
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/10
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/11
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/12
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/13
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/14
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/15
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/16
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/17
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/18
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/19
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/20
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/21
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/22
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/23
 switchport access vlan 20
 no ip address 
exit

interface FastEthernet0/24
 switchport access vlan 20
 no ip address 
exit


interface Vlan10
 no ip address
 no ip route-cache
 shutdown
exit
interface Vlan20
 ip address 192.168.0.0 255.255.255.0
 no ip route-cache
exit
ip http server
exit

 

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

Music on website

It’s very simple to get music playing on your website:

<EMBED NAME=”Player” SRC=”music.mp3″ AUTOSTART=”true” LOOP=”false” TYPE=”audio/mp3″ showvideo=”0″ showcontrols=”0″ showdisplay=”0″ showstatusbar=”0″ ShowCaptioning=”false” ShowPositionControls=”false” nosave=”true”>

This line will start the file ‘music.mp3’ automatic. The options is simple to understand and edit

(The code will embed an invesible windows media player, and will only work with Internet explorer)

Udgivet i Knowledge Base, Old Base, Programmering | Skriv en kommentar

vmware tools in debian

install vmware-tools in debian:

uname -r and use the matching package for your headers:

apt-get install gcc make linux-headers-2.6.18-5-486

Insert the cd, mount it and unzip /mnt/cdrom/VMwareTools-1.0.4-56528.tar.gz to /tmp/

run the installer and answer all default questions

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

Install CURL extension to PHP on debian

It’s simple to install the CURL extension on debian, ubuntu etc. with apt-get

First download curl extension:

apt-get install curl libcurl3 libcurl3-dev php5-curl

When this is done all you need is restarting your apache:

/etc/init.d/apache2 restart

And then it should work

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

Fix broken CVS HEAD branch

# go to HEAD sandbox

# remove all sticky tags
cvs upd -A

# merge all changes from the branch point up untill now into HEAD.
# beware! If any changes exists in HEAD, they will be overwritten
cvs upd -j HEAD -j MCS_REL_1

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Installing an alphaweb server

*********************
Setup etch backports:
*********************

echo “deb http://www.backports.org/debian etch-backports main contrib non-free” >> /etc/apt/sources.list
cat >> /etc/apt/preferences << EOF
Package: *
Pin: release a=etch-backports
Pin-Priority: 999
EOF

wget -O – http://backports.org/debian/archive.key | apt-key add –
apt-get update

***************************
Setup webserver, databases:
***************************

apt-get install apache2 mysql-server postgresql-8.2 php5-cgi php5-cli php5-mysql php5-pgsql php5-curl php5-mcrypt libapache2-mod-fcgid proftpd proftpd-mysql screen php4-cgi php4-common php4-mcrypt php4-mysql php4-pgsql php4-curl

***************************
Change PostgreSQL password:
***************************
su – postgres
psql -d template1 -U postgres
alter user postgres with password ‘newpassword’;

*********************
Install webExchanger:
*********************

Part 1:
mkdir /system
Unpack webExchanger.latest.tar.gz to /system

Part 2:
Create ftp user in mysql
mysql -u root -p

create database ftp;
GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO ‘proftpd’@’localhost’ IDENTIFIED BY ‘newpassword’;
GRANT SELECT, INSERT, UPDATE, DELETE ON ftp.* TO ‘proftpd’@’localhost.localdomain’ IDENTIFIED BY ‘newpassword’;
FLUSH PRIVILEGES;

mysql -u root -p ftp < install/proftpd.sql

Disable mod_postgres in /etc/proftpd/modules.conf

Part 3:
Edit webExchanger.inc
Edit webExchanger_IPs.conf

Part 4:
Add webExchanger vhosts to apache:
echo “Include /system/webExchanger_vhost.conf” >> /etc/apache2/httpd.conf
Create wrappers dir:
mkdir /home/wrappers

Part 5:
Replace /usr/lib/apache2/suexec with suexec in install
Enable suexec
a2enmod suexec

Part 6:
Open an screen and execute ./startWeb.sh

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