What is the Ubuntu equivalent for WAMP

ubuntuusers.de

This article has been tested on the following versions of Ubuntu:


Would you like to test the article for another Ubuntu version? Participation in the wiki is always welcome! For this purpose, the instructions for testing articles must be observed.

This article is intended especially for beginners and briefly describes how to install a simple LAMP server with Apache, MySQL and PHP on Ubuntu. More details on these three components can be found in the respective individual articles.

LAMP stands for L.inux, A.pache, M.ySQL, P.HP and describes a system that provides the web server Apache with PHP and the database server MySQL under Linux.

Installation¶

All required components can be installed from the official package sources [1] become. Alternatively, you can install the tasksel program and select the desired task there. In addition to Apache, MySQL and PHP, other server components can be installed here.

Expert info:

A password for the database administrator is always requested during the installation. Please choose this password carefully and, above all, keep it safe. And please do not confuse the database administrator with the system administrator account of the same name. They are two completely different users, even if their names are identical.

The following packages are required for the basic installation:

  • apache2 (Apache 2.4)

  • libapache2-mod-php

  • php

  • php-mysql

  • mysql-server

Package list to copy:

sudo apt-get install apache2 libapache2-mod-php php php-mysql mysql-server

Or install with apturl, Link: apt: // apache2, libapache2-mod-php, php, php-mysql, mysql-server

Use¶

For an initial test, use a web browser to call up the Internet address or. A start page will appear that looks something like the screenshot on the right.

If you don't see this page, Apache has probably not started yet. In this case start the web server with the following command [2][3]:

sudo systemctl start apache2

Upload content to the server¶

The contents for the server are saved in a directory called "document root". Depending on the Apache or Ubuntu version, this is the following folder:

However, root rights are required for saving in this folder. Since this can be impractical, the rights for this directory should not be adjusted, but instead the desired user should be added to the group. How this works is described in the Apache article (section “Rights”).

Test PHP¶

The file phpinfo.php with any editor [4] in the "document root" and add the following content:

<?phpphpinfo();?>

Then call up the address or in the web browser. All information about the PHP version and settings used is listed. After a successful test, please remove it so that this information is not made available to outsiders.

Other applications¶

Now that a LAMP server is basically ready for use, one can deal with practical use such as web development or web applications such as a picture gallery. Anyone who operates a web server that can be accessed from the Internet should definitely deal with the subject of "server security". Suggestions can be found in the links below.

In the case of web applications, the question often arises whether they should be installed via the official package sources. Unfortunately most of them - if they are included in the package sources at all - are assigned to the section, which means that they do not receive any security updates. The advantage of simple installation turns into the decisive disadvantage that later maintenance becomes impossible. What can still be tolerated on a private server that is not connected to the Internet is an absolute taboo on a public web server. In practice, you should therefore prefer a manual installation and check which mechanisms are offered in each case to keep the software in question up to date.

Monitoring¶

Especially with dedicated servers that are operated without a monitor, keyboard and mouse, it is practical to take a quick look at the current server status without having to resort to the command line. While PhpSysInfo 🇬🇧 and Monit have long been part of the standard inventory, Linux Dash 🇩🇪 offers a modern graphical user interface. If the server park grows and with it the demands, further suggestions can be found in the article network monitoring (section "Links").

Left¶

Internal¶

External¶

This revision was created on May 3, 2021 07:29 by frustschieber.
The following keywords were assigned to the article: web application, PHP, Apache, beginners, Internet, server, network