Installing LAMP (Linux, Apache, MySQL, PHP)

Add the Atomic repository

[[email protected] ~]# wget -q -O – | sh[[email protected] ~]# sh

Install packages:

[[email protected] ~]# yum -y install httpd php mysql mysql-server php-mysql php-pear php-pdo php-pgsql php-pecl-memcache php-gd php-mbstring php-mcrypt php-xml

Let’s start MySQL:

[[email protected] ~]# service mysqld start

Set the root password for MySQL:

[[email protected] ~]# mysqladmin -u root password ‘ENTER-PASSWORD-HERE’

Connect to MySQL and delete the test base

[[email protected] ~]# mysql -u root -p[[email protected] ~]# mysql> DROP DATABASE test;[[email protected] ~]# mysql> DELETE FROM mysql.user WHERE user = “;[[email protected] ~]# mysql> FLUSH PRIVILEGES;

We register the services in autorun and start them:

[[email protected] ~]# chkconfig httpd on[[email protected] ~]# chkconfig mysqld on[[email protected] ~]# service httpd start[[email protected] ~]# service mysqld start

Open port 80 from the outside:

[[email protected] ~]# nano / etc / sysconfig / iptables

We register:

-A INPUT -p tcp -m state —state NEW -m tcp —dport 80 -j ACCEPT

Checking. Create phpinfo.php file

[[email protected] ~]# nano /var/www/html/phpinfo.php

We register in it:

We check the functionality by opening the phpinfo.php page in a browser.