Web server (LAMP) installation in Debian 5 (Lenny) and Ubuntu
I would describe this as their guide mysql on Debian 5 - code name "Lenny" and a fully functioning Ubuntu webserver with php, and install Java support in a few steps you can.
Package lists updated
To ensure that you get the right ones, and current packages is recommended to update your package list with the following command:
apt-get update
Installing the Apache web server (version 2.2)
With the following command will install the standard Apache Server 2.2 at no additional modules and immediately started. We have therefore already a running web server, the HTML files can play.
apt-get install -y apache2
To test this, you can in a browser enter the IP of your server. The default Web page of the Apache (/ var / www / index.html) is called and says you only: It works!
Installing the PHP module for Apache
Since we have to run like normal html files is not enough, and we also want to run php files, we added the following packages to install Apache web server.
apt-get install -y libapache2-mod-php5 php5-cli php5-common php5-cgi
As a very large tip for speeding up PHP under Apache, I recommend eAccelerator , about her here a guide is.
Installing the MySQL database
If you want to work with databases on your server, or databases want to make available, then the MySQL server is installed with following packages.
apt-get install -y mysql-server php5-mysql
During the installation process you will be deposited in a blue screen prompted to set the MySQL root password. I recommend doing so.

After confirming the password, the installation of the MySQL server is complete.
Apache restart
Now that our installations are completed, it is necessary to restart Apache so that all the new extensions can be processed.
/etc/init.d/apache2 restart
MySQL database users and create database
Our MySQL server is now installed and we can create the first user and the first database. Use the following command, we are connecting to the MySQL server console:
mysql -u root -p
You will be asked for your password, which you have entered during the installation of the Blue Box. We are now connected to the MySQL server console and insert the first database and the first user to:
create database datenbank1 ;
grant all privileges on datenbank1 .* to ' dbuser1 '@' localhost ' identified by ' Passwort ' with grant option;
db1 - stands for the database name
dbuser1 - stands for the username
localhost - Does the user only by the server, where the MySQL server is installed to access the game. This could also be an IP if you want to allow other servers to access, or possibly even a '%', which means that can be accessed from anywhere.
Password - stands for the password that is used to authenticate the user.
The bold letters should be adjusted according to your will.
Test the installation with the phpinfo file
In order to verify now that we have carried out the installation correctly, and all the necessary components to work correctly with Apache, we place ourselves in a small php file that will give us important information. We go first into the standard Apache directory and put us on the file info.php, which we then edit the favorite editor (vi for me):
cd /var/www/
vi info.php
In our data, we now add one includes:
<?php phpinfo(); ?>
We now save the file and call it with the following URL in our browser:
http://ip-adresse/info.php
You should now see a similar screen:

When you see the screen, then the php installation has already been worked out.
In addition, you can still check whether the point: "additional. Ini files parsed", the entry "/ etc/php5/apache2/conf./mysql.ini" exists. If this entry is also there, then your php also communicate with the mysql server.
Java Installation on Debian
Similar items:
- eAccelerator - PHP accelerator installation in Debian 5 (Lenny) and Ubuntu
- Icinga - Open Source Monitoring - Installing on Debian 5 (Lenny) with IDOUtils and MySQL database
- VMware Server 2 installation on Debian 5 (Lenny)
- Java Installation on Debian 5.0 (Lenny)
- Mac OS X 10.6 - Snow Leopard by installing PHP
14 Comments on web server (LAMP) installation in Debian 5 (Lenny) and Ubuntu
Leave a Reply
Last articles
Translator

News recommendations
- Vulnerability Oscars awarded ( heise Security )
- Critical vulnerabilities in TYPO3 ( heise Security )
- Benchmarked Against Debian Linux Debian GNU / kFreeBSD & FreeBSD ( Linux Today )
- Vulnerability in WPA2 keys discovered ( macnews.de )
- Wikileaks publishes U.S. military reports ( futurezone.ORF.at )



Hey,
Thank you! Get it tomorrow to try out =)
Greetings,
Bene.
Sg Mr. Author!
Thank you for the accurate and detailed description.
and the site has really helped.
'm A Linux-Baby (about 1 week old and stand just before my 40th birthday
With best regards,
TH
Has worked out great. Thanks for the really very well written instructions.
Possibly. yes you can still phpmyadmin and FTP to add the two points.
Regards
Hello nockuno,
I will consider your request and the instructions like phpmyadmin to the points and extend FTP Server.
Thanks for the Feeedback
Hy Patrick
Have first test on your own at my local web server to a Lenny 5.0.3 Joomla "put", which was not working as it should. In search of help in the www I found these instructions and had first drüberinstalliert with the specified command "and that also did not work. So then, has everything to do with the Apache, etc. removed, then started according to your instructions from the beginning. And ..: everything is as it should.
Thank you for this good guide
Hardy
That pleases me and so it should be
Hi,
has helped guide me Schonmal more like the other pages - Dankesehr!
But a small little problems I have:
apt-get install-y mysql-server mysql-server-5.0 mysql-common php5-mysql
"The blue box for the password does not."
and:
/ Etc/init.d/apache2 restart
If this error message:
Restarting web server: apache2apache2: Syntax error on line 278 of / etc/apache2/apache2.conf: Syntax error on line 5 of / etc/apache2/conf.d/phpmyadmin.conf: / etc/apache2/conf.d/phpmyadmin . conf: 5: was not closed.
failed!
For any help me further forward I am very grateful.
Sincerely, Addamain
PS I have Linux Debian 5.0 Lamp
Hello Addamain,
it may be that on your server a MySQL database was previously installed? Because at least Phpmyadmin installed, or did you deliberately installed phpmyadmin?
try using the following command your MySQL server service to reconfigure dpkg-reconfigure mysql-server-5.0
To tell more precise about the misconfiguration in Apache, I would have insight into the configuration. You can please me like the times / etc/apache2/apache2.conf and etc/apache2/conf.d/phpmyadmin.conf / send by mail.
Greeting
Patrick
Good guide, but I miss the painfully regard to safety.
Especially the Apache, in its basic configuration immediately after installing a non-negligible security risk dar.
Sure you can find on the net several instructions on how to protect its servers and applications running on it. However, neglecting the most new Linux users (but unfortunately not only ...) all too often the security of your server and think it was all done, once the desired program is running. Especially with the ever-falling prices for Root Server or VDS, many owners are not at all clear about the fact that they are for anything that runs on their server, fully responsible.
If at some point post by the prosecution for illegal distribution of music, software or child pornography or for using the server as spam or sling because of illegal network attack comes, it is too late for the server owner and he must expect severe penalties.
So we can not at all stress often enough on the security of a server ...
A relatively easy to understand instructions for example. see here: http://www.strassenprogrammierer.de/webserver-absichern-hacker_tipp_479.html
Otherwise helps http://gidf.de course, be happy ...
Hi Nexus,
You have just with the safety aspect, of course, fundamental rights.
However, I must say that after the installation is based on a Debian (Ubuntu on Debian) system with the above packages, just the standard web server ports are open. Therefore, it is pure port is no risk dar. Although I of course won every lie close to the ports after the installation of its server with nmap to check.
The Apache modules provide in Debian is not a real safety risk, because after installation, although many modules are available, not loaded. The modules which are loaded are determined 0815 for daily use only.
You tell me but about the idea of an article to write Web Server Security.
Greeting
Patrick
I see it the same way as you Patrick. Debian is from scratch, to security considered and Interpreted. The ports are to be kept and the Apache modules are limited! The Guide is a Top About Security contribution, I would love to but
Greeting
Alex
Hi Patrick
Are two years, I own a PC and do with my 72 years quite difficult when it comes to new things. But this tutorial is very good and detailed description of you have been. Of course, I am an absolute beginner but extremely eager to learn what the installation and configuration has to do a root server. The few years, you'll probably have to
I want to intensively manage spending with that of a root server.
My son, who came to live in fourth year by year, left in, I rented a root server, which took me a week ago on the idea in his mind simply bring the project further, even if I did not know what he really had before!
After more research I found out that the root servers only Debian was installed and then tried together for some time through Google information. Finally, I am then landed here at your website.
I had super class from the beginning to the end of this tutorial no problems and everything leuft.
Of course I still have a lot of questions on how to install the beisbiel hpmyadmin and FTP server / configured and how the whole also protects!
I also would like to know how to make the domain compares to the Ip, so that the domain can also view the Brwoser. Its current is so only with the server IP address. So I've been waiting forward to new tutorials.
Thanks again for your tutorial. You made an old bone really happy ...
Erik mfg
Hi Erik,
very emotional story. I'm very sorry about your son.
Regarding your questions, I will sit down the next days, weeks and again the guides extend a little. I was missing at the moment, unfortunately, a little time. FTP tutorial will be followed in any case yet.
Intrusion of a domain in Apache is actually quite simple. For this you need the file: / etc/apache2/sites-enabled/000-default edit and such. Add the following entry:
Server Name-my domain.de
ServerAlias my-other-my-other-domain1.de domain2.de
DocumentRoot / var / www / directory
PhpMyAdmin can be installed fairly simple:
apt-get install phpmyadmin
Greeting
Patrick
[...] Rest of the installation work then without further [...]