Posts

Showing posts with the label howto

Limit the upload bandwidth of your apache webserver with mod_bw

Image
I've a server at home on a ADSL connection which has 100kBytes/s of upload and 1.2MBytes/s of download as bandwidth. If someone download at full speed some large file on my web server, my internet connection become unusable. To avoid this, I start to ask my friends to use a download manager to limit their download speed... but it's somewhat far too tricky for a lot of them... So I use mod_bw developed by Ivan Barrera http://www.ivn.cl/apache/ (sourceforge : http://bwmod.sourceforge.net/ ). Here is a quick way to limit the bandwidth used by Apache : Install & enable (on Ubuntu): sudo apt-get install libapache2-mod-bw sudo a2enmod bw Configure (your apache virtualhost conf file like /etc/apache2/sites-available/default) : <virtualhost *:80> #... other config stuf for the virtual host BandWidthModule On ForceBandWidthModule On BandWidth 192.168.0.0/24 0 BandWidth all 80000 </virtualhost> Explaination : line 1 : Activate the mod for the virtualhost. line 2 : Set a...

Setting up UPS link with an ubuntu server

Image
I've bought a new server (build from parts) to replace the old one that has capacitor leak issues and died † And with it, I bought a new UPS (Uninterruptible Power Supply) to replace the old one that non longer work either... I've googled internet to setup this UPS with my linux server (ubuntu server 8.0.4.1) and here is the result of my search and work : When the UPS detect a power outage, it wait some times (configured depending on the capacity of the UPS and the power consumption of the server), and then send a mail with the UPS state just before the shutdown, and then shutdown the server. While waiting some time, if the power is back, the shutdown is cancelled. The UPS state is useful as it shows you the health of your UPS when it goes on battery. If the charge is really low when the server is shutdown, you might want to reduce the time it wait on battery before shutting down the server or replace the battery (or the UPS). If the charge is really close to 100, you might wa...

Open ssh connection through proxy with NTML authentication

Image
Here is the explanation of how to pass a ssh connection through a proxy that use NTLM authentication protocol (cryptographic authentication) instead of a plain login/password authenication. First follow the steps describes here : http://blog.mansonthomas.com/2008/01/open-ssh-connection-through-http-proxy.html Next we have to deal with NTLM authentication. Putty do not know how to talk with proxy that use NTML authentication, so we need a soft that will handle the authentication and encapsulate the network packet. To do that we'll use cntlm which is a port of an unix programms using cygwin (no need to make a insall of cygwin though...). Once you unzip the files, edit the configuration file cntlm.ini You have to change 4 values : login: Your Windows login name domain: Your domain name You can get theses information by hitting CTRL+ALT+SUPPR, a window display and in the first fieldset you can see something like "Thomas Manson has opened a session as DOMAIN\LOGIN" proxy u...

How I setup GoogleApps Premium on an existing domain

Image
Mail administration is boring and time consuming... It continuously takes more importance in every days exchange and the loss of one mail can have huge consequence : What ! You didn't bought the bread ! I sent a mail so you don't forget... it's enough... I divorce ! :op Nowdays, email takes a huge amount of space, that you need to backup... So we decided to migrate our client to google Apps : 7 servers to handle your mail, 25Go of space, a simple and very powerfull web interface with the ability to still use imap. You'll find here how I set-up Google Apps Premium for the domain 123monsite.com. You should plan this operation at the beginning of the weekend to minimize any potential issue. First I get there : http://www.google.com/a/help/intl/fr/admins/editions.html I click on "Inscription" on the Premier Edition. Then I give the domain name : 123monsite.com Then I fill the form As it's for a company, I set the VTA reference of the company to avoid to pay VT...

Open a SSH connection through an http proxy and dig tunnels :)

Image
I'm working for an IT Services & Software Engineering company, and I often work for some time (3 months to a year) by the client company's office... And often, I'm behind a ****ing proxy that filters http request, provide antivirus analysis etc.. Useful for the company securtity and efficiency, but really borring for me. Those proxy allows http (tcp/80) and https (tcp/443) connections and nothing else... So no tcp/22 for SSH, and I miss it really much for many reasons. So here is what to do, to get an SSH connexion to a linux box. But beware that doing that will certainly break the security contract you signed when you enter the company. Doing that allow you to bypass the content filtering and security. And you could be fired for that... This blog post will show you how to bypass an http proxy with a basic authentication. The following post will show you a way to bypass a proxy with NTLM authentication mecanism. Server configuration You're a geek like me, so you hav...

Remote Desktop Client with Windows 2000

At one of my client office, their computers runs under windows 2000. I needed to access a windows 2003 server with a RDP Client. Windows 2000 does not have mstsc.exe installed, but the one for windows XP works well with windows 2000. Terminal Services Client comes in two versions, 5.1 & 6. The 6 needs a Genuinue Advantage validation (I didn't try but I don't think ti's possible under windows 2000 to have this validation), but the 5.1 here : http://www.microsoft.com/windowsxp/downloads/tools/rdclientdl.mspx don't ! Run the installer, click next until the end and then WindowsKey+R, type mstsc et voila !

Set up a secondary Domain Name Server with bind9 on a ubuntu linux

On my spare time, I manage the technical subjects of a small webagency i've created with a friend when I was in my second year of Engineer school. It's named 123monsite.com . Tonight I dig the secondary (slave) DNS server subject. Until now, we used a DNS server from our registar as DNS backup. But as we grow, we need more servers and a secondary DNS of our own is becomming handy. We've rent a dedibox from the free.fr ISP (a server for 30€/month : via 2Ghz, 2Go Ram, 160Go HDD, 5Go of monthly backup). I choosed ubunty feisty server (7) among all OS available (many linux flavour and some windows) So here is how I set up my secondary domain name server on my ubuntu server with bind9. Let's say the domain of the primary name server is ns0.primarydomain.com (80.1.1.1) The secondary will be : ns1.primarydomain.com (80.2.2.2) And the domaine we'll want to be handle by both servers is myDomain.com (90.9.9.9). Give your secondary server a domain name T...

Activate IPV6 on e-smith (sme server)

Free ISP has just launch ipv6 on their network. Free is the best ISP in france for geeks ;) and it's also my ISP... So... as ipv6 is available, I'd like to play with it... Here is the steps I've followed to activate the ipv6 supports on my e-smith server (sme server) 7.2. I've read the following howto to get this working : http://tldp.org/HOWTO/Linux+IPv6-HOWTO/index.html Kernel To check if ipv6 is activated on your system, run the following command : test -f /proc/net/if_inet6 && echo "Running kernel is IPv6 ready" If it display "Running kernel is IPv6 ready", then your system is ready for ipv6. By default, it's not the case on the e-smith. You can load the ipv6 module by executing the following command : modprobe ipv6 The command is silent (if no error, no message is displayed) Run the previous test again, it should now succeed. In order, this module to be loaded automatically, you need to have this line in /etc/modprobe.conf : alias n...

samba mount with accent support

I'm still coding my extjs explorer and another issue I had is that I wanted to browse directory that are mounted windows shares (windows 2003 server). As I'm french, and i've some files with accent, and with the default e-smith configuration, the accent are not displayed properly. Here is what I did to have accent displayed properly : First you need to configure the linux box to properly display accents. This is done through /etc/sysconfig/i18n configuration file. The e-smith is configured with the en_US charset (which means no accents ;) ) : Here is what I put in the configuration file : LANG="fr_FR@euro" SUPPORTED="fr_Fr@euro:fr_FR:fr" SYSFONT="lat0-sun16" SYSFONTACM="iso15" If you use a different charset that fr_FR, you should set the correct value for your language. Notice that for this file, the e-smith template system does not use the berkley database (db set-prop) but the file itself as for fstab file. Once you've updat...