Create a pfx key file for Windows

For apache, we use certificate for *.mycompany.com. They are 3 files :

mycompany.com.crt
mycompany.com.csr
mycompany.com.key

But I need a different file if I want to use this certificate on Windows. Windows asks for only one PFX file. Here is the command I use on linux:

openssl pkcs12 -export -in mydomain.com.crt -inkey mydomain.com.key -out mydomain.com.pfx

Fixe Corrupted Windows XP System Files

http://www.microapp.com/astuce_234_windows_xp_reparer_un_fichier_corrompu.html

If a Windows program like Internet Explorer or Outlook Express doesn’t work any more, it can be because some files are corrupted.

Windows have a System File Checker (SFC).

  • Click on “Start” button then on “Run…”
  • Type sfc /scannow in the text area “Open”. Then type Enter.
  • The dialog box Windows File Protection opens :
  • If a file is corrupted, the program warn you.
    Insert Windows CD-ROM then click on Restart to restore the original version of this file.

My DocumentRoot on Apache

Today Nicolas asked me to use a different root than /Library/Webserver/Documens/ his local websites.

He had “access forbidden” when using a symbolic link.

He found himself the solution, creating an alias :

Alias "/sxt" "/Volumes/DIVERS/projets/sxt/online/"
<Directory "/Volumes/DIVERS/projets/sxt/online/">
       Options Indexes FollowSymLinks MultiViews
       AllowOverride None
       Order allow,deny
       allow from all
</Directory>

Tricks against Spam

I found and interesting page : http://wiki.apache.org/spamassassin/OtherTricks explaining that spam often use the first MX only to go faster, or only the last because the antispam system must be less efficient.

fake0.example.com   10
realmx.example.com  20
fake1.example.com   30

It also propose to add a lot of fake servers at the end, some spam machine use random MX.

fake0.example.com   10
realmx.example.com  20
fake1.example.com   30
fake2.example.com   40
fake3.example.com   50
fake4.example.com   60
fake5.example.com   70

SVN Server on Debian Etch

SVN now directly in Leopard (Mac OS 10.5). This is such a nice surprise that I decided to come back on the right way of programming.

Having known CVS, and then Tortoise SVN for many years, I was not proud to have no backup at all or version control.

You can find what is SVN on Wikipedia.

I followed this tutorial : http://hikage.developpez.com/linux/tutoriels/subversion/?page=page_2

Now I start with the very well known Debian command:

root@strange:/var# apt-get install subversion
root@strange:/var# mkdir /var/subversion
root@strange:/var# mkdir /var/subversion/depot
svnadmin create /var/subversion/depot/myproject (myproject must be replaced by a real name)
apt-get install install libapache2-svn
a2enmod dav_svn (si nécessaire)

/etc/apache2/mod-available/dav_svn.conf must be tuned:

<Location /svn>
DAV svn
Require valid-user
SVNParentPath /var/subversion/depot/
AuthType Basic
AuthName "Mon dépôt"
AuthUserFile /var/subversion/conf/htpasswd
AuthzSVNAccessFile /var/subversion/conf/access
</Location>

now let’s create the first user:

mkdir /var/subversion/conf
htpasswd -c /var/subversion/conf/htpasswd chris
htpasswd /var/subversion/conf/htpasswd user2

/var/subversion/conf/access :

[groups]
webmasters = chris, user2
[myproject:/]
@webmasters = rw
[oneotherproject:/]
chris= rw
* = r
[oneotherproject:/documentation/utilisateur]
authordoc = rw

And now my repository is available at : http://myurl/svn/myproject/

PS: I had to change the right file access to /var/subversion/depot/

chown -R chris:www-data /var/subversion/depot
chmod -R 770 /var/subversion/depot

Apache2 Mass Virtual Hosting

I’m preparing an IPv6 server to host all my projects. It’s so nice to start with a clean one.

First thing, I’ll use Apache2 with his wonderful Mass Virtual Hosting.
This will allow me to create a new web site named www.newwebsite.com only by creating the following directory : /home/hosts/www.newwebsite.com/

Nice isn’t it ?

I’m following this article: http://httpd.apache.org/docs/2.0/vhosts/mass.html

Here are all the command I used for Mass Hosting on Debian Etch:

root@strange:/etc/apache2/mods-enabled# ln -s ../mods-available/vhost_alias.load
mkdir /home/websites
mkdir /home/websites/www.example.com
mkdir /home/websites/www.example.com/online (for my online files)
mkdir /home/websites/www.example.com/offline (where I keep documents about the website)

Then I just replaced the content of /etc/apache2/sites-enabled/000-default by:

# get the server name from the Host: header
UseCanonicalName Off
# this log format can be split per-virtual-host based on the first field
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon
CustomLog /var/log/apache2/access_log vcommon
# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /home/websites/%0/online
VirtualScriptAlias /home/websites/%0/cgi-bin

Here we are… just have to configure www.example.com’s IP

Next step : SVN Server. I’ll keep a backup of every versions of my projects…

Apple Dock?

Just one word: Wow!

 

http://www.macrumors.com/2008/01/03/apple-creating-imac-like-docking-station/

A patent application submitted in 2006 and published for the first time today has revealed that Apple is working on a docking station for portable computers, the exterior of which closely resembles Apple’s iMac line of desktop computers.

A docking station is disclosed. The docking station includes a display and a housing configured to hold the display in a manner that exposes a viewing surface of the display to view. The housing defines a docking area configured to receive a portable computer; The docking area is at least partly obscured by the display when viewed from the viewing surface side of the display at an angle substantially orthogonal to the viewing surface.

Apple argues that its docking station concept is superior in that it requires less desk space due to its vertical orientation. It is also simpler, as the display is integrated and wireless network technologies will be employed for communication between the dock and the portable.

There has been some speculation around the internet that the patent could be tied to the rumored Apple ultra-portable. While the timing of the publication is interesting, the application itself remains generic in nature, and appears to be applicable to any notebook computer.

Happy new year

For the new year I invited some friends at home (we were 11).

I was sure that 2am would be the end of the night, but at 6am everybody was still noisy and never thinking about living my house ^_^ I was proud to think that, after all, I was not so old… only the next day I understood where the difference is when older…. going to bed at 7:30 = 3 days off !

What surprised me was that nobody drank any alcohol or cigarette (or any prohibed substence). It was not on purpose, I was the first surprised. What a nice news: we can have a wonderful long night without any of these horrible things…

Chris' blog