Kategoriarkiv: Apache

Parse dhcpd.leases and return all active leases

#!/usr/bin/php <? $fh=fopen(“/chroot/dhcp/var/lib/dhcp/dhcpd.leases”,”r”); while ($dat=fgets($fh)) { if (preg_match(“/lease/”,$dat)) { $active=false; $ip = preg_split(“/ /”,$dat);$ip=$ip[1]; $dat=fgets($fh); while (!preg_match(“/hardware ethernet/”,$dat)) { if (preg_match(“/binding state active/”,$dat)) { $active=true; } $dat=fgets($fh); } $mac = preg_split(“/ |;/”,$dat); $mac=$mac[4]; if ($active) { print $ip.” – “.$mac.”\n”; … Læs resten

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

mod_proxy config

<VirtualHost thor.btworld.dk> ServerName thor.btworld.dk DocumentRoot /var/www/thor_redirect/htdocs ProxyPass /samurize/ http://thor.btworld.dk/samurize/ ProxyRequests Off </VirtualHost>

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

proftpd bandwith limit

<Directory /> AllowOverwrite on TransferRate APPE,RETR,STOR,STOU 25:1024 user !black </Directory> limits to 25KB/s with a 1024KB fullspeed limit, excludes the user black  

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

Automatic DNS check of apache virtualhosts

#!/usr/bin/perl $space=65; $myip=”212.242.77.75″; # Domains with this ip gets “working” stamp open(fh, “/usr/local/apache2/conf/httpd.conf”); while ($dat=<fh>) { if ($dat=~ /servername/i) { $dat =~ s/ //g;chop($dat); if ( lc ( substr($dat,0,10)) eq “servername”) { $domain=substr($dat,10,length($dat)); print $domain; $res = `host -t a … Læs resten

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

ServerSignature = Off i apache2

Bjarke Istrup Pedersen siger: og apache fortæller ikke hvad version der er m.m. Mike siger: oki Mike siger: hvordan har du skjult det? Bjarke Istrup Pedersen siger: der er en option til det i /etc/apache2/conf/commonapache2.conf Mike siger: nice Mike siger: … Læs resten

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

Dynamic Virtual Hosts in apache

#Simple dynamic virtual hosts # # This extract from apache2.conf implements the virtual host arrangement # outlined at http://www.apache.org/docs/vhosts/mass.html, using # mod_vhost_alias. # get the server name from the Host: header UseCanonicalName Off # # this log format can be … Læs resten

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

redirect of banned users in firewall

the table `macs` have a field `mac` which identifies the banned computer, and a field `status` which identifies the state of the computer. to redirect the users: <pre> for mac in $( echo “SELECT mac FROM macs WHERE status=’banned’;” | … Læs resten

Udgivet i Apache, Old Base | Skriv en kommentar

redirect of banned users in firewall

the table `macs` have a field `mac` which identifies the banned computer, and a field `status` which identifies the state of the computer. to redirect the users: <pre> for mac in $( echo “SELECT mac FROM macs WHERE status=’banned’;” | … Læs resten

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

Apache IDS

Protect your web server and dynamic content from intrusions. Detecting intrusions that utilize common protocols and services is a job that a network intrusion detection system is well suited for. However, due to the complexity of web applications and the … Læs resten

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

Apache security – ssl, suexec

Help secure your web applications with mod_ssl and suEXEC. Web server security is a very important issue these days, especially since people are always finding new and creative ways to put the Web to use. If you’re using any sort … Læs resten

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