L4L.be

...because open source matters

  • Increase font size
  • Default font size
  • Decrease font size
Home Linux Documentatie Server toepassingen LAMP Server onder OpenSUSE 11.2

LAMP Server onder OpenSUSE 11.2

E-mail Print PDF

Inleiding

In dit document gaan we een LAMP server inrichten, die als basis kan dienen voor allerlei web-based toepassingen. LAMP staat voor de Apache Webserver, de MySQL database server en PHP als script taal allemaal draaiend onder Linux.

Zie ook Wikipedia over LAMP.

Installatie OpenSUSE

De installatie van OpenSUSE is vrij recht toe recht aan, maar het is een server, dus gaan we geen grafische omgeving installeren. Bij de installatie van OpenSUSE 11.2 heb je de vraag welke "Desktop Selection" je wilt gebruiken. Hier kies je voor "Other" -> "Minimal Server Selection (Text Mode)".

Netwerk configuratie

Na de installatie moet je eerst de netwerkinstellingen configureren. Dit doe je het gemakkelijkste met behulp van Yast. Log in als gebruiker, en voer het volgende commando uit:

sudo /sbin/yast network

Een server moet je nooit configureren met de NetworkManager (maar die wordt bij deze installatie methode ook niet gebruikt) en ook geen gebruik maken van DHCP. Bij de "Network Card Setup" kies je bij "Address" voor "Statically assigned IP Address". Vergeet ook niet een hostname te configureren, in mijn geval: web.l4l.local

Vervolgens kom je terecht bij Hostname/DNS. Ook hier vul je gegevens in. Bij mij hostname: web, domain name: l4l.local. Vergeet ook niet de dns servers !

Als laatste stap voer je bij "Routing" de default gateway in.

note: navigatie gaat eenvoudig door de alt-toets te gebruiken in combinatie met de fel gele letters.

Firewall

Daarna moeten wat firewall poorten geopend worden:

sudo /sbin/rcSuSEfirewall2 open EXT TCP ssh http https
sudo /sbin/rcSuSEfirewall2 restart

SSH

De Secure SHell toegang staat bij zo'n kale installatie standaard uit, dus ook dit moet geregeld worden, en uiteraard moet bij een herstart de service ook automatisch mee worden opgestart.

sudo /sbin/chkconfig sshd on
sudo /sbin/service sshd start

Installatie LAMP

Installatie gaat supersimpel met:

sudo zypper in -t pattern lamp_server

MySQL configuratie

De MySQL server, die we zojuist geinstalleerd hebben

We gaan de MySQL server starten, en ook weer er voor zorgen dat deze gestart wordt bij het bootproces. We regelen dat meteen ook voor de webserver.

sudo /sbin/service apache2 start
sudo /sbin/service mysql start
sudo /sbin/chkconfig mysql on
sudo /sbin/chkconfig apache2 on

Nu gaan we de server configureren, hiervoor levert Novell een script mee:

sudo mysql_secure_installation

Met dit script geef je het root account een wachtwoord, verwijder je anonymous gebruikers en het is ook verstandig om remote login als root te deactiveren.

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Finish

De basis is gereed, die we zullen gebruiken in andere documenten.