News | About | Get Frugalware | Packages | Documentation | Discussion Forums | Bug Tracker | Wiki | Community | Development

LAMP

From FrugalWiki

Jump to: navigation, search


Contents

Introduction

To make short, LAMP is a webserver. The nom comes from initials : Linux, Apache, Mysql and Php. I'll explain you how to create a local webserver.


Installation of Apache

To begin, what is Apache ? Apache is a HTTP server software made by the Apache Software Foundation.

To install it :

Root terminal 48px.png
# pacman-g2 -S apache


Where it's done, we have to start the "httpd" service :

Root terminal 48px.png
# service httpd start


It the service correctly started, you should have this shown on your screen :

Root terminal 48px.png
# Starting Apache web server (no SSL) [ OK ]


Now, to have the service started at each boot, you have to type this :

Root terminal 48px.png
# service httpd add


Apache will be launched automaticly at each boot of your machine.

Now, you have to edit a file, with your favorite editor. I prefer Gedit, which is easier because it provides a graphical interface.

Root terminal 48px.png
# gedit /etc/httpd/conf/httpd.conf


At the line 323, add "ServerName 127.0.0.1", as we are in local.

If all is ok, go to this url with your Internet Browser : http://127.0.0.1 or http://localhost

You could see a page like this :

Lamp-1.png

Installation of PHP

PHP is a programmation language for making dynamic web pages. To install php and its documentation, you have to type this :

Root terminal 48px.png
# pacman-g2 -S php php-docs-en


Now, we'll verify if the installation is good. For this, we'll create a file called phpinfo.php. This file will give us informations about the version of php installed on your system.

Root terminal 48px.png
# gedit /var/www/html/phpinfo.php


Add in this file these lines. These lines call a php function called phpinfo.

<?php
phpinfo();
?>

You should see a page similar (but maybe with some diffences) if your installation is OK.

NB : you should have to reboot your computer or reboot X.

Lamp-2.png

Installation of MySQL

MySQL is a relational database management system (RDBMS). According to the type of the application, its licence is free ou proprietary. It's one of the most database system used in the world, people (mainly web applications) as professionnals, competing Oracle or Microsoft SQL Server.

MySQL est un système de gestion de base de données (SGBD). Selon le type d’application, sa licence est libre ou propriétaire. Il fait partie des logiciels de gestion de base de données les plus utilisés au monde, autant par le grand public (applications web principalement) que par des professionnels, en concurrence avec Oracle ou Microsoft SQL Server.

To install MySQL :

Root terminal 48px.png
# pacman-g2 -S mysql


Like for Apache, we'll have to start the service :

Root terminal 48px.png
# service mysqld start


To launch the service each boot :

Root terminal 48px.png
# service mysqld add


We'll now install phpMyAdmin. It allows to administrate your databases with your web browser. It's easy to install it :

Root terminal 48px.png
# pacman-g2 -S phpmyadmin


To configure MySQL :

Root terminal 48px.png
# mysql_secure_installation


The first question is to choose a password for connecting to phpMyAdmin.The next questions are not necessary in your case. You can pass it by pressing Enter. But, if you want, you can configure the rest.


Now you can connect to verify if phpMyAdmin is installed. For this, go to : http://127.0.0.1/phpmyadmin/

To connect, the user is "root" and the password is the one you've configured earlier. You can imagine, but don't delete the two databases which are already present.

Now you have all the tools to work without Internet.

Personal tools
Namespaces
Variants
Actions