• Установка Apache2 с PHP5 и MySQL в CentOS 6.0 (LAMP)

    Содержание материала

    Рейтинг:  5 / 5

    Звезда активнаЗвезда активнаЗвезда активнаЗвезда активнаЗвезда активна
     

    CentOSLAMP это краткое обозначение Linux, Apache, МySQL, PHP. В этом учебнике показано, как можно установить Apache2 Web сервер на CentOS 5.6 server с поддержкой PHP5 (mod_php) и поддержкой MySQL. Данный сервер можно скачать, подробнее на форуме в одноименной теме Установка Apache2 с PHP5 и MySQL в CentOS 6.0 (LAMP).

    Предварительные замечания

    В данной статье я использую имя хоста server1.example.com с IP адресом 192.168.2.222. Эти параметры могут отличаться в Вашем случае, поэтому Вам придется заменить их в случае необходимости.

    Установка MySQL 5.0

    Для установки MySQL, мы выполним это:

    • yum install mysql mysql-server

    Затем мы создаем связи автозапуска с системой для MySQL (так что бы MySQL запускалась автоматически при загрузке системы) и запустим MySQL сервер:

    • chkconfig --levels 235 mysqld on
    • /etc/init.d/mysqld start

    Установите пароль для учетной записи root MySQL:

    • mysql_secure_installation
    [root@server1 ~]# mysql_secure_installation
    
    
    
    
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    
    
    In order to log into MySQL to secure it, we'll need the current
    password for the root user.  If you've just installed MySQL, and
    you haven't set the root password yet, the password will be blank,
    so you should just press enter here.
    
    Enter current password for root (enter for none):
    OK, successfully used password, moving on...
    
    Setting the root password ensures that nobody can log into the MySQL
    root user without the proper authorisation.
    
    Set root password? [Y/n] - ENTER
    New password: - Ваш root SQL пароль
    Re-enter new password: - Ваш root SQL пароль
    Password updated successfully!
    Reloading privilege tables..
     ... Success!
    
    
    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] - ENTER
     ... 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] - ENTER
     ... 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] - ENTER
     - 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] - ENTER
     ... 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!
    
    
    [root@server1 ~]#

    Установка Apache2

    Apache2 доступен как пакет CentOS, поэтому мы можем установить его так:

    • yum install httpd

    Теперь настроить систему для запуска Apache при загрузке ...

    • chkconfig --levels 235 httpd on

    ... и запустим Apache:

    • /etc/init.d/httpd start

    Теперь перейдите в Вашем браузер http://192.168.2.222 , и Вы должны увидеть стандартную страницу Apache 2:

    111

    по умолчанию в корневой документ Apache в CentOS /var/www/html, и файл конфигурации /etc/httpd/conf/httpd.conf. Дополнительные конфигурации хранятся в /etc/httpd/conf.d/ каталоге.

    Установка PHP5

    Мы можем установить PHP5 и модуль Apache PHP5 следующим образом:

    • yum install php

    Теперь мы должны перезагрузить Apache:

    • /etc/init.d/httpd restart

    Обмениваться, хранить, передавать Ваши файлы стало просто как никогда.
    yandex-disk
    Читать подробнее: для чего Yandex-Диск проекту Mini-Server. Практика установки, настройки и использования сетевого хранилища на Ubuntu server LTS 12.04 в статье Резервное копирование сервера Ubuntu на Яндекс Диск.

    >> Ubuntu 12.04 + Nginx Скачать сервер
    >> Fedora 15 Скачать сервер
    >> Простой Debian 6.0.6 Скачать сервер
    >> CentOS 6.0 и
    + (5.6) другой
    Скачать сервер
    >> OpenSUSE 11.4
    MAX
    Скачать сервер

    Вход на сайт

    ВНИМАНИЕ!

    Регистрация на сайте только по согласованию с администратором ресурса. Обращаться через форму обратной связи.