Direkt zum Hauptbereich

Posts

Posts mit dem Label "vserver" werden angezeigt.

Server protection with mail notice if root logs in

Lately I have a lot of attacks on my server. Most of them are based in asia, e.g. China or Korea, but also some from servers in Europe like Ukraine or Sweden. The attacks are done by brute forcing my ssh login, which is quite safe to be honest, but this is not stopping people from trying. Firstly I have configured fail2ban to mail me in case of attacks. The attacking IP is blocked for a year. There was some doubt though, so I put a line in my root bash script which is mailing me any login as root, with a whois query as well: echo "ALERT - Shell Access on:' `date` '\n\n' `who` '\n\n' `whois $(who | cut -d'(' -f2 | cut -d')' -f1)`" | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" root@localhost Dont forget to edit you /etc/aliases and run newaliases or put another mail address in the command.

F***ing Firefox - apache2 redirect problems with multiple ssl virtualhosts with one ip

After trying the "Redirect permanent / https://....." for serveral hours and reading almost all of the internet I tried my other browser midori and my configuration just works fine. So, my conclusion: firefox browser sucks!!!!! Keeping this in mind (and I emptied my cache etc) I will not rely on firefox anymore when working with my servers apache configuration. Well, if you want to use more than one virtual host with ONE wildcard ssl certificate then you have to redirect via vhost files: <VirtualHost *:80> ServerName sub.domain.com Redirect permanent / https://...... ..... </VirtualHost> <VirtualHost *:443>  SSLEngine On .... ServerName sub.domain.com .... </VirtualHost>

PostgreSQL

I like to go with the newest trends since I am not really held back by any production site. So I had a look around and decided to install a new database system. The first thing you might want to consider is the growing hype of NoSQL db's like mongodb, couchdb etc. But after reading this I changed my mind: you-got-nosql-in-my-postgres-using-hstore-in-rails Having done this several times before with no gain of a working db server I looked around for a decent tutorial providing me with just the right steps: install-postgresql-on-fedora-centos-red-hat-rhel There I even had the howto for my CentOS-Server after deploying with postgresql. MySQL is in the minds of people, and it deserved a spot in the light for its availability and easyness, but with the NoSQL-movement and the availability of postgresql on the web it might be good to have had a look. And since I dont really come in contact with the db but just with the ORM there is no harm done ;) PS: there is even a nic...

Ruby On Rails

Die letzten Tage hatte ich hier ja einiges zum Thema RoR (RubyOnRails) berichtet, welches für die oder den einen wohl etwas zu "geeky" war. Ich hatte mich vorletztes Jahr mit CakePHP beschäftigt, und damals schon gelesen, dass es sich an RoR anlehnt, es nachahmt für PHP. Zu dieser Zeit hatte ich nur einen normalen Webhosting-Vertrag und konnte die Sprache Ruby gar nicht zum laufen bringen, so dass ich mich ebenn für CakePHP entschied. Dann kam der Sommer und ich legte alles wieder weg. Letztes Jahr dann beschloss ich, das Rad nicht neu erfinden zu wollen, und nach langer Recherche im Netz und auf amazon kaufte ich ein Buch über Joomla-Extentions. Ich hatte schon mit dem Vorgänger Mambo gearbeitet, so war mir die Architektur grob bekannt, aber seit neuestem gibt es auch bei joomla ein Framework, und das CMS baut nur noch darauf auf. Und das Programmieren von Extensions schien auch wunderbar einfach zu gehen (bis auf den Installer, wozu eine kommerzielle IDE fast nöt...

rvm problems with git bash completion - rack could not be started

Ruby locally and remote are different, just because of 32 and 64 bit, and because I dont work remotely of course. Basicly just follow these instructions:  Installing Ruby and Rails on Fedora with RVM (works also with centos) My history: Well, I got this error: Ruby (Rack) application could not be started ..... config/initializers/session_store.rb So I changed my config/initializers/session_store.rb: :key => '_wedding_session' Then this: Ruby (Rack) application could not be started ..... config/initializers/wrap_parameters.rb:8: syntax error, unexpected ':', expecting kEND wrap_parameters format: [:json] ^....... SOLUTION: instal l rvm and get versions same for 1.8 and 1.9 are not nice to each other  After installing rvm for ruby to I got on console: __git_p1 not found Just find your git-completion: find git-completion and add the found git-completion path with a prepended . into your bashrc. Now you...

ruby on rails deployment with capistrano and git

Hello everybody! I mentioned it before me trying ruby on rails. The language is pretty fast forward with its meaning. And I am already in love with the rails framework, although not having worked with it full time, not even semi-professional. The internet is full with howtos and tutorials, but sometimes the hard thing is to seperate them, and finding you own "truths", some are: Deploying Rails 3 Apps with Git, Capistrano and Passenger Deploying the application remotely using Capistrano life saving second post: rails 3.1 assets:precompile deployment I ran into serveral problems like: no pictures remotely -> precompile locally! make sure EVERY gem is noted in Gemfile rake failed almost everytime, and blaimed permission rules ... [until 5 hours of my live were gone] This is my approach to easily developing webapps: [do not just copy and paste, I dont post all the code; and in retroperspect I should have read into it more deep too to save time] For ...

mailman virtualhost settings

I found this nice page explaining mailman as subdomain: My Mailman Virtual Hosting List Setups But I found this to be too redundant compared to the default settings already been done by the installings process of mailman with postfix. And there were even some people working with HTML-Header-Redirects in subfolders for their virtualhost. I just did this in /etc/httpd/conf/httpd.conf <VirtualHost *:80> ServerName lists.mysite.com ServerAlias lists.mysite.com RewriteEngine on RewriteRule ^/mailman[/]+$ http://lists.mysite.com/mailman/listinfo [L,R] RewriteRule ^/$ http://lists.mysite.com/mailman/listinfo [L,R] </VirtualHost> Of course there were the RedirectMatch for /mailman/ in place; as well as the changes for the hosts in mm_cfg.py and postfix/main.cf like the link above shows. Mailman had to be initialised again, but then it worked all fine. Before going to smash something though, test your mailserver with: mail %TO_ADDRESS% ...

apache virtualhosts subdomains

In this post I will show how to configure several virtual hosts on a linux machine, that will function as subdomains with their own DocumentRoots. Goal: access your site via blog.mysite.com access a different site via test.mysite.com allow different app to be accessable via mysite.com/app1 First you will have to redirect any traffic to a virtual host on port 80: NameVirtualHost *:80 From now on every 'html' traffic is redirected to your following settings; and have in mind that you former DocumentRoot is overridden. (the last caused me some troube/time) Now set up some subdomains: <VirtualHost *:80> ServerName blog.mysite.com ServerAdmin webmaster@mysite.com DocumentRoot /var/www/html/blog <Directory /var/www/html/blog> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost>  <VirtualHost *:80> Server...