LinuxForum.Fans
Тема

Настройка локального сервера на Ubuntu 14.04

Автор: golovenkin 25 сообщений 3030 просмотров В конец обсуждения ↓
#416646

Такая же фигня, кстати.

Вот конфиг виртуального хоста - site1.tst.conf

text
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName site1.tst
        ServerAlias www.site1.tst

DocumentRoot /var/www/site1.tst

<Directory /var/www/site1.tst/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

ErrorLog /var/www/site1.tst/logs/mysite-error.log CustomLog /var/www/site1.tst/logs/mysite-access.log common <Directory /var/www/site1.tst> Options All AllowOverride All Require all granted </Directory> </VirtualHost>

Вот hosts:

text
127.0.0.1    localhost
127.0.0.1    site1.tst

Всё благополучно включается и ребутится, без ошибок и прочего.

text
sudo a2ensite site1.tst
sudo service apache2 reload

localhost - открывается, не вопрос. А вот http://site1.tst - "белый лист".

Было дело, работало, правда пришлось шаманить прямо в 000-default.conf другие конфиги он просто на отрез отказывался цеплять. Но сейчас и это не помогает.
Я поисковик уже затеребонькал - решения так и не нашёл.

А вот, кстати, error.log апача. Но тут я буратино ( Может кто что разглядит?

text
[Fri Mar 06 18:10:37.955643 2015] [mpm_event:notice] [pid 16621:tid 140536985692032] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:10:37.955942 2015] [core:notice] [pid 16621:tid 140536985692032] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 18:18:00.812796 2015] [mpm_event:notice] [pid 16621:tid 140536985692032] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 18:18:01.894991 2015] [mpm_event:notice] [pid 17024:tid 140130977421184] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:18:01.895294 2015] [core:notice] [pid 17024:tid 140130977421184] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 18:19:09.971167 2015] [mpm_event:notice] [pid 17024:tid 140130977421184] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 18:19:11.050582 2015] [mpm_event:notice] [pid 17168:tid 140660313884544] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:19:11.050840 2015] [core:notice] [pid 17168:tid 140660313884544] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 18:47:58.003243 2015] [mpm_event:notice] [pid 17168:tid 140660313884544] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 18:48:01.631581 2015] [mpm_event:notice] [pid 18061:tid 139654897547136] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:48:01.631842 2015] [core:notice] [pid 18061:tid 139654897547136] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 18:48:06.414766 2015] [mpm_event:notice] [pid 18061:tid 139654897547136] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 18:48:07.499149 2015] [mpm_event:notice] [pid 18166:tid 140035166054272] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:48:07.499431 2015] [core:notice] [pid 18166:tid 140035166054272] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 18:52:05.140104 2015] [mpm_event:notice] [pid 18166:tid 140035166054272] AH00493: SIGUSR1 received.  Doing graceful restart
[Fri Mar 06 18:52:05.149034 2015] [mpm_event:notice] [pid 18166:tid 140035166054272] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:52:05.149062 2015] [core:notice] [pid 18166:tid 140035166054272] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 18:54:20.926495 2015] [mpm_event:notice] [pid 18166:tid 140035166054272] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 18:54:22.007309 2015] [mpm_event:notice] [pid 18416:tid 140231594059648] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 18:54:22.007565 2015] [core:notice] [pid 18416:tid 140231594059648] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 19:00:13.722417 2015] [mpm_event:notice] [pid 18416:tid 140231594059648] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 19:00:14.807299 2015] [mpm_event:notice] [pid 18675:tid 140076723836800] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 19:00:14.807788 2015] [core:notice] [pid 18675:tid 140076723836800] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 19:04:39.705977 2015] [mpm_event:notice] [pid 18675:tid 140076723836800] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 19:04:40.786919 2015] [mpm_event:notice] [pid 18854:tid 139756413278080] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 19:04:40.787212 2015] [core:notice] [pid 18854:tid 139756413278080] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 19:05:00.414818 2015] [mpm_event:notice] [pid 18854:tid 139756413278080] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 19:05:01.498407 2015] [mpm_event:notice] [pid 18997:tid 139848667068288] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 19:05:01.498685 2015] [core:notice] [pid 18997:tid 139848667068288] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 19:06:08.973471 2015] [mpm_event:notice] [pid 18997:tid 139848667068288] AH00491: caught SIGTERM, shutting down
[Fri Mar 06 19:06:10.052877 2015] [mpm_event:notice] [pid 19131:tid 140069596641152] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 19:06:10.053167 2015] [core:notice] [pid 19131:tid 140069596641152] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 06 19:06:29.585450 2015] [mpm_event:notice] [pid 19131:tid 140069596641152] AH00493: SIGUSR1 received.  Doing graceful restart
[Fri Mar 06 19:06:29.594946 2015] [mpm_event:notice] [pid 19131:tid 140069596641152] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Fri Mar 06 19:06:29.594983 2015] [core:notice] [pid 19131:tid 140069596641152] AH00094: Command line: '/usr/sbin/apache2'
#416649

KuckucL# - я бы оставил только 1 блок Directive и посмотрел логи ErrorLog и CustomLog

#416682
Marley написал:
KuckucL# - я бы оставил только 1 блок Directive и посмотрел логи ErrorLog и CustomLog

Убрал.
ErrorLog пустой, а в CustomLog вот:

text
127.0.0.1 - - [06/Mar/2015:17:44:56 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:17:44:56 +0300] "GET /favicon.ico HTTP/1.1" 404 504
127.0.0.1 - - [06/Mar/2015:17:44:56 +0300] "GET /favicon.ico HTTP/1.1" 404 504
127.0.0.1 - - [06/Mar/2015:17:50:23 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:17:50:24 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:17:50:24 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:17:50:24 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:17:50:53 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:17:50:54 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:17:52:44 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:17:52:44 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:17:52:58 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:17:53:06 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:17:53:07 +0300] "GET /favicon.ico HTTP/1.1" 404 494
127.0.0.1 - - [06/Mar/2015:17:53:07 +0300] "GET /favicon.ico HTTP/1.1" 404 494
localhost - - [06/Mar/2015:17:59:27 +0300] "GET / HTTP/1.1" 200 425
localhost - - [06/Mar/2015:17:59:28 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:18:48:32 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:18:48:40 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:18:49:00 +0300] "GET /index.html HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:18:49:07 +0300] "GET /index.php HTTP/1.1" 200 5313
127.0.0.1 - - [06/Mar/2015:18:55:37 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:19:00:44 +0300] "GET /www HTTP/1.1" 404 491
127.0.0.1 - - [06/Mar/2015:19:02:16 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:19:05:17 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:19:05:17 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:05:18 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:14:18 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:19:14:21 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:14:22 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:15:15 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:19:15:15 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:15:15 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:15:16 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:15:24 +0300] "GET / HTTP/1.1" 200 425
127.0.0.1 - - [06/Mar/2015:19:15:25 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [06/Mar/2015:19:15:25 +0300] "GET / HTTP/1.1" 200 424
127.0.0.1 - - [07/Mar/2015:10:01:23 +0300] "GET /favicon.ico HTTP/1.1" 404 499
127.0.0.1 - - [07/Mar/2015:10:01:23 +0300] "GET /favicon.ico HTTP/1.1" 404 498
#416723

KuckucL# - видео, ссылки на которые я дал выше не смотрели?
Попробуйте. Если не получится, попробую у себя поднять на виртуалке.
Сам использую для этих целей centos.

#416777
Marley написал:
KuckucL# - видео, ссылки на которые я дал выше не смотрели?
Попробуйте. Если не получится, попробую у себя поднять на виртуалке.
Сам использую для этих целей centos.

Посмотрел.
В общем, начал править как в видео. Перенёс папку с сайтом в /var/www/html

В конфиге хоста, к ServerName добавил .local

text
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName site1.tst.local

DocumentRoot /var/www/html/site1.tst

<Directory /var/www/html/site1.tst/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog /var/www/html/site1.tst/logs/mysite-error.log CustomLog /var/www/html/site1.tst/logs/mysite-access.log common </VirtualHost>

В hosts тоже:

text
127.0.0.1       localhost site1.tst.local
127.0.1.1       nashville-station

Как итог - всё по прежнему не работает )) Но есть одно но! При переходе по адресу - http://site1.tst/index.php - предлагает сохранить php файл )))
http://site1.tst/index.html - так же, белый лист )

UPD: Я немного поспешил просто набрав старый адрес сайта site1.tst
Отключил дефолтный конфиг - 000-default.conf

text
sudo a2dissite 000-default.conf

Набрал site1.tst.local - полёт нормальный! )

Вот почему он цепляет сайты в папке /var/www/html, а в /var/www не хочет? Мне конечно не принципиально, но понять, всё же хотелось бы )
(Судя по всему нужно было просто затолкать сайт в html, все остальные манипуляции не обязательны. Хотя проверять не хочу :D)

P.S. Marley, спасибо, видео натолкнуло на хорошую мысль )

Войдите или зарегистрируйтесь, чтобы ответить.