20150718

LAMP на Centos6

LAMP
L - Linux
A - Apache
M - MySQL
P- PHP

Ставим.
# yum install httpd mysql-server php php-mysql

Запускаем apache.
# /etc/init.d/httpd start
Starting httpd:                                            [  OK  ]

Запускаем mysql. 
# /etc/init.d/mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h bender.ermoshin.pro password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                                      [  OK  ]
Starting mysqld:                                           [  OK  ]

Делаем первичную настройку mysql.
# /usr/bin/mysql_secure_installation
Задаем пароль для root и везде отвечаем "y".
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

 Проверяем php.
# vi /var/www/html/info.php
Пишем.
<?php
phpinfo();
?>

Перзапускаем httpd и по http://server_ip/info.php должна появиться инфрмация о текущей версии php. 

Включаем автозагрузку.
# chkconfig --level 2345 httpd on
# chkconfig --level 2345 mysqld on



Комментариев нет:

Отправить комментарий