Archiv für den Tag: 11. Jul 2007

20Min / 20Minuten die Schweizer „Tageszeitung“

Ich halte die 20min Zeitung, die’s an jedem Bahnhof und den meisten Bushaltestellen zu beziehen gibt, eh nicht für eine richtige Zeitung. Die 20Min ist so überfüllt mit Boulevardpresse-News, dass sogar dem Blick beim Anblick übel werden würde (haha, Wortspiel!).

Kleines Beispiel für die „Verlässlichen“ News der heutigen 20Min „Pendlerzeitung“:

Rote Moschee in Islamabad:

Laut 20Min wurden 800 Leichensäcke geordert, laut dem Spiegel waren’s komischerweise aber nur 300 (der Spiegel Artikel stammt noch von gestern, auch auf anderen Newsportalen wurden heute Morgen nicht mehr Leichensäcke angegeben)…

Solche schwerwiegende Fehler kann man in jeder 20Minuten Ausgabe finden. Vor allem die IT Ecke ist von selbsternannten Superinformatikern bevölkert.

Vor allem fällt mir eine Sache auf: Sie stellen alles unsicher dar oder versuchen Unsicherheitsgefühle breit zu machen.

Da beklagt sich gerade mal eine Stadt über einen leichten Anstieg der Jugendgewalt und schon steht am nächsten Morgen sowas wie „Jugendgewalt angestiegen“ in der Zeitung.

Ist natürlich toll, wenn man am Morgen in den Zug kommt und alle so eine Panikmachereizeitung in den Händen halten. Kein Wunder ist man so „nett“ zueinander.

Howto: Install Apache development-server under Ubuntu 7.04

Big thanks go out to Daehee Park from the information sciences and technology blog ITMilk.com. He helped improve the english part of the tutorial.

Deutschsprachige Besucher: Für eine deutsche Version des Tutorials, einfach runterscrollen!

Over the past several months I’ve released many WordPress themes, a few of which have gained popularity. So I’ve been getting all these emails from people who ask me how and where I develop them.

Well, here’s the answer for the „where“ part of developing WordPress themes! A how-to tutorial for creating themes will come in the near future.

First, for the hardware… I’m developing on an old PC running the latest Ubuntu 7.04 distro. It’s a HP machine with a 2.4GHz processor and 512Mb of RAM. As you can see, you don’t need a monster at all, and it’s more than you need for a small webserver at home.

Because some people still don’t know how to install a simple Linux Server machine, the following is a step-by-step tutorial. You’ll find out how to install a webserver with PHP5, MySQL, FTP, SSH and PhpMyAdmin on Ubuntu Linux in only 10 steps. This easy guide for creating a home development server is intended for people who are new to Linux systems.

1st. We need Ubuntu installed.

This is a whole different story and, since great installation guides already exist on the web, I’m not going to reinvent the wheel and will instead direct you here.

Imortant: Remember the username and password you’ve typed in while installing Ubuntu. You’ll need it later.

2nd. Get Root privileges

In Ubuntu, the superuser (root) is disabled in the default configuration, and we use a command called sudo to gain root privileges. We’re not going to cover any security issues regarding Ubuntu in this tutorial, but you can be assured that it is safer than a Windows box, regardless. In any case, this server is not intended to be a webserver connected to the Internet, but rather your own personal development box.

To set the root password, open the command line and type sudo passwd and then input your desired root password twice.

Then login as root by typing su followed by the password.

Yay, root is on and now you are god over this machine. Now we’re going over to the various installations…

3rd. Update system

apt-get upgrade

Updates the packages which are already installed

4th. Fix the server’s IP

If you leave the IP dynamically chosen (DHCP), the server will end up having a different IP address almost every time you restart it. So we need to set a static IP.

Find out an IP address that isn’t already being used in your network (avoid using IP’s which are within your DHCP range, you could end up with some IP conflict). If you are on a private home network, this can be almost any number (RIC: INSERT SOME EXAMPLE IP ADDRESSES HERE).

Type in this command

vi /etc/network/interfaces

and find the line called: auto eth0 (it depends on which network adapter you want to make static, but I’m assuming you only have one here).

and replace that line with those lines:

auto eth0

iface eth0 inet static

address (your chosen IP adress)

netmask (your netmask) (RIC: MORE INFO ON NETMASK FOR THE NEWBIE; AN EXAMPLE NETMASK?)

To make sure the options get into action immediately type in this command: /etc/init.d/networking restart. This will restart all network interfaces.

If you type in, ifconfig, now, eth0 should be displaying the IP address and netmask you’ve chosen.

Okay, thats it for that!

5th. Installing Webserver and modules

Now, here comes the really easy parts, starting with installing Apache!

apt-get install apache2

This automatically gets you the Apache2 server (you may need the installation disk inserted for the next steps)

chmod 777 /var/www this gets you the rights to modify the webserver directory (remember /var/www is where your going to put your projects. It is the root folder of the webserver content)

6th. Install PHP5 module

apt-get install php5

This will get you the freshest version of PHP.

Your server should be displaying the default Apache page if you type in the IP address into any browser.

But we are still need another module to run WordPress properly.

7th. Install MySQL Server

This is how we get this done:

apt-get install install php5-mysql

and after that

apt-get install mysql-server

(If you use PHP4, just change the numbers).

The MySQL default login is:

  • User: root

  • Password: Nothing, Keins, nix, nada, niente.

8th. Mysql Administration tool

We’ll use the popular PHPMyAdmin to add, delete and truncate any databases we are working with.

apt-get install phpmyadmin

9th. Terminal access

apt-get install ssh

By installing this package, you are able to access the server’s terminal from everywhere in the network with some terminal software like Putty (great thing if you don’t have any constantly plugged in display or keyboard on the server).

10th. FTP access

apt-get install proftpd.

Installs a small FTP Daemon which gives you the possibility to access the server with any popular FTP program like FileZilla. Login data is the same as your username and password.

Do you have any questions? Fine! Feel free to contact me!

PS: Dont use this tutorial for the installation of some online webserver. In that case, your server will probably get hacked without implementing some security tweaks. This tutorial is only for the purpose of the installation of a small, home-based development server (e.g. for people who develop WordPress plugins or templates).

Deutsche Version

Ich habe ja schon einige recht beliebte WordPress Templates veröffentlicht.

Immer wieder haben mich Leute gefragt, auf welchem System ich eigentlich entwickle.

Ganz einfach! Auf einem ausgemustertem HP Office Rechner mit 512Mb Ram und einem P4 mit 2.4 GHz. Das System läuft auf der Linux Distribution Ubuntu 7.04.

Das war nicht immer so. Das System war am Anfang immer noch mit dem Windows Xp von der Firma zugemüllt und musste erstmal auf den Mann gebracht werden. Also suchte ich nach einem Tutorial für eine Installation des Apache Webservers unter Ubuntu, wurde aber nicht fündig.

Deswegen kommt jetzt hier ein Tutorial für euch. Bitte beachtet dabei, dass man mit diesem Tutorial keinen öffentlich-erreichbaren Server betreiben sollte. Der Server den ihr hier installiert, kann man aber beruhigt als netter Entwicklungsserver im lokalem Netzwerk benutzen.

1. Ubuntu installieren

Falls Ubuntu Linux noch installiert ist, holt dies nach! Am Anfang reicht wohl noch die graphische Version. Der Webserver wird wohl nicht die Welt an Ressourcen benötigen. Ubuntu hat von Haus aus kein aktivierter Root Account. Eigentlich ein gutes Sicherheitsfeature, aber bei einem lokalem Server eher unnötig.

Notiert euch unbedingt den Usernamen und das Userpasswort, dass ihr während der Installation eingeben müsst!

2. Sich Root Rechte verschaffen und Root Account aktivieren

Um den Root Account zu aktivieren macht ihr folgendes:

sudo passwd und danach das neue Rootpw doppelt eingeben.

So, Root ist erstmal aktiviert. Jetzt kommen die Installationen!

loggt euch als Root ein: su

3. System aktualisieren

apt-get upgrade

Aktualisiert die vorhandenen Pakete

4. Ip des Servers fix einstellen

Lässt man die Ip dynamisch, kann der Server mal auf 192.168.1.64 wie auf 192.168.1.86 laufen, usw.

Deswegen sollte man die Ip Adresse des Servers fix einstellen.

Sucht euch eine Ip Adresse in eurem Netzwerk aus, die noch nicht vergeben ist und vom DHCP Server auch nicht vergeben werden kann, da es sonst zu einem IP-Konflikt kommen kann.

Zum Beispiel 192.168.1.99

Tippt dann folgenden Befehl ein, um zur Netzwerkkonfiguration zu gelangen:

vi /etc/network/interfaces

Ihr werdet da wohl eine Sektion finden, bei der auto eth0 (sofern ihr nur eine Netzwerkkarte habt) steht.

Ersetzt dies mit folgenden Zeilen:

auto eth0

iface eth0 inet static

address (eure auserwählte IP Adresse)

netmask (eure Netzmaske)

Mehr braucht ihr nicht, der Server soll sich ja nicht mit dem Internet verbinden.

5. Apache2 Webserver installieren

apt-get install apache2

Holt den Apache2 Webserver (evtl. braucht ihr dazu auch die Installationsdisk)

chmod 777 /var/www gibt euch die nötigen Rechte um überhaupt etwas am Verzeichnis ändern zu dürfen (erinnert euch: /var/www ist das Verzeichnis wo alle Projekte rein kommen werden, es ist das root Verzeichnis vom Webserver)

6. PHP5 Modul installieren

apt-get install php5

Holt euch die neueste PHP Version

Der Server sollte jetzt eigentlich schon aktiv sein und unter http://eureip erreichbar sein, aber für WordPress fehlt noch das Mysql Modul! Solltet ihr PHP4 benötigen, ersetzt einfach PHP5 mit PHP4 bei der Befehlseingabe.

7. Mysql Server installieren

Dies lösen wir mit dem Befehl

apt-get install install php5-mysql

und

apt-get install mysql-server

(Auch hier muss man für PHP4 nur die Zahl ändern).

Die Mysql Logindaten sollten standartmässig wie folgt lauten:

  • User: root

  • Pw: Keins, nix, nada, niente.

7. Mysql Verwaltung

apt-get install phpmyadmin

Ihr wollt ja die Datenbank einfach erstellen können? Phpmyadmin könnt ihr dann einfach unter http://ServerIPadresse/phpmyadmin/ erreichen (natürlich ist ServerIPadresse eure eigene Adresse).

8. Terminalzugriff

apt-get install ssh

Damit ihr auch über einen entfernten Rechner und unter benutzung eines SHH-fähigem Terminals, zB. Putty auf den Terminal des Servers zugreifen könnt (ideal wenn man den Server einfach in der Ecke stehen hat, kein Monitor und keine Tastatur nötig um etwas am Server zu ändern).

9. Dateizugriff

apt-get install proftpd.

Dies installiert den ProFTPD Ftp-Dienst. So bekommt ihr vollen Zugriff auf das Dateisystem mit jeglichen simplen FTP-Clients wie FileZilla. Die Login-Daten sind hier auch wieder die zu Anfang der Installation angegebenen Userlogindaten des Systems.

Solltet ihr noch Fragen haben, kommentiert einfach!

Wie gesagt, bitte nur zum lokalem entwickeln gebrauchen, Sicherheitseinstellungen usw. Habe ich hier willentlich ausser Acht gelassen.