Установка LAMP (apache+php+mysql)

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
Перейти к:навигация, поиск
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Установка LAMP на CentOS 5

Пример для CentOS 5.7

[root@anton ~]# cat /etc/redhat-release 
CentOS release 5.7 (Final)
Выполните обновление всех пакетов:
[root@anton ~]# yum -y update
Выполните установку apache 2.2, php 5.1, mysql 5.0
[root@anton ~]# yum -y install httpd httpd-devel php php-mysql mysql mysql-server
Включите apache и mysql в автозагрузку:
[root@anton ~]# # chkconfig httpd on
[root@anton ~]# chkconfig mysqld on
Запустите apache:
[root@anton ~]#  service httpd start
Запускается httpd: 
Запустите mysqld и укажите root пароль
[root@anton ~]#  service mysqld start
[root@anton ~]# /usr/bin/mysqladmin -u root password 'password_here'
Подключитесь к MySQL из под root пользователя:
[root@anton ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.77 Source distribution 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Проверьте версию PHP: [root@anton ~]# php -v PHP 5.1.6 (cli) (built: Feb 2 2012 18:24:47) Copyright (c) 1997-2006 The PHP Group Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
Закомментируйте все что есть в:
/etc/httpd/conf.d/welcome.conf - тестовая страница
и залейте файлы в /var/www/html/
После перезапустите apache:
[root@anton ~]#  service httpd start
Зайти на веб-сервер можно по адресу: http://IP_of_VDS/

--Admin iph 22:42, 3 февраля 2012 (MSK)