Installare LAMP stack On CentOS 6

LAMP = Linux, Apache, MySQL, PHP
Lo stack LAMP è una pila protocollare composta dalla installazione di software open source che permette di creare un web server running.



1) Supponiamo che il sistema operativo Centos sia già installato.

2) Apache HTTP server
E' un software per la realizzazione di web server. Il lavoro di base è quello di accettare richieste dai client (ad esempio il browser di un visitatore) e inviare la risposta a tale richiesta (ad esempio i componenti della pagina richiesti).

yum install httpd
service httpd start

Per controllare se installato correttamente, collegarsi alla url con l’indirizzo ip del server.
Estrarre l’indirizzo ip
ifconfig eth0 | grep inet | awk '{print $2}'

Verifica:
http://<indirizzo ip>

Compare la schermata seguente:



3) MySQL
yum install mysql-server
service mysqld start

Verrà chiesto due volte l’autorizzazione: inserire yes

/usr/bin/mysql_secure_installation

Il prompt chiederà la tua password di root corrente ma avendo appena installato MySQL, molto probabilmente non ne avrai uno, quindi lascialo vuoto premendo invio.
Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Quindi il prompt ti chiederà se vuoi impostare una password di root. Vai avanti e scegli Y e segui le istruzioni.
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!

4) PHP
E' un linguaggio di programmazione utilizzato per creare pagine web dinamiche.

yum install php php-mysql

Creae un file di test.
vi /var/www/html/hello.php
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <p>Hello World</p>
 </body>
</html>

service httpd restart

Verifica:
http://<indirizzo ip>/hello.php

Compare la schermata seguente:


Post popolari in questo blog

Individuare Tabelle in Lock

EXPLAIN PLAN ed EXECUTION PLAN

ORA-12154: TNS: il listener non è attualmente a conoscenza del servizio richiesto nel descrittore di connessione