AgiliaLinux: настройка Apache
Пишет, Nikita, 16.01.2012Недавно решил на своей рабочей машине реализовать такие более устойчивую схему сервера, чем «Сервер за 5 мин на Ubuntu». Походу экспериментов над Agilia, стал ставить на ней.
Устанавливаем всё, что надо:
mpkg install httpd mysql php
Настроить /etc/httpd/httpd.conf:
-
<IfModule dir_module>
-
DirectoryIndex index.html index.htm
-
</IfModule>
Заменить на
-
<IfModule dir_module>
-
DirectoryIndex index.html index.htm index.php
-
</IfModule>
Строку
-
#Include /etc/httpd/mod_php.conf
раскомментрировать
что было
-
Include /etc/httpd/mod_php.conf
Строку:
-
#Include /etc/httpd/extra/httpd-vhosts.conf
так же раскомментировать
Создаём каталоги и файлы, делаем их читаемыми и записываемыми группе, в которой запущен apache, либо всем, если не страшно.
/home/nikita/server/domain/www
/home/nikita/server/domain/log/error.log
/home/nikita/server/domain/log/custom.log
/home/nikita/server/localhost/www
/home/nikita/server/localhost/log/error.log
/home/nikita/server/localhost/log/custom.log
В данном примере: domain — имя нашего домена
Путь и структуру каталогов вы можете выбрать сами. Для меня удобней такая.
В файле:
/etc/httpd/extra/httpd-vhosts.conf
добавляем 2 виртуальных хоста, а все виртуальных хосты, что были раньше, удаляем. То есть получится такое содержание, не учитывая комментарии:
-
<VirtualHost tariel-2.ru:80>
-
NameVirtualHost tariel-2.ru
-
ServerAdmin captain@tariel.ru
-
DocumentRoot "/home/nikita/server/tariel-2.ru/www"
-
ServerName tariel-2.ru
-
-
ErrorLog "/home/nikita/server/tariel-2.ru/log/error.log"
-
CustomLog "/home/nikita/server/tariel-2.ru/log/custom.log" common
-
<Directory "/home/nikita/server/tariel-2.ru/www/">
-
AllowOverride All
-
Order allow,deny
-
Allow from all
-
</Directory>
-
</VirtualHost>
-
-
<VirtualHost localhost:80>
-
ServerAdmin captain@tariel.ru
-
DocumentRoot "/home/nikita/server/localhost/www"
-
ServerName localhost
-
-
ErrorLog "/home/nikita/server/localhost/log/error.log"
-
CustomLog "/home/nikita/server/localhost/log/custom.log" common
-
<Directory "/home/nikita/server/localhost/www/">
-
AllowOverride All
-
Order allow,deny
-
Allow from all
-
</Directory>
-
</VirtualHost>
В файле /etc/hosts прописываем дополнительные строки:
domain 127.0.0.1
Запускаем apache и mysql:
sudo /etc/init.d/apache2 start
sudo /etc/init.d/mysql start
Первоначальная настройка mysql:
mysql -u root mysql
UPDATE user SET Password=PASSWORD('new_password') WHERE user='root';
new_password — ваш новый root пароль
FLUSH PRIVILEGES;
exit








Свежие комментарии