ошибка состояния apache2 при создании виртуальных хостов - PullRequest
0 голосов
/ 10 ноября 2019

, поэтому я пытаюсь настроить виртуальные хосты.

Я сделал ламповый сервер и пытаюсь установить несколько страниц WordPress. проблема начинается, когда я создаю файл виртуального хоста. после включения apache не хочет перезагружаться.

выдает этот errorr.

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

команда systemctl status apache2.service показывает это

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) (Result: exit-code) since Sat 2019-11-09 19:11:47 CET; 19h ago
  Process: 23833 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 28860 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=1/FAILURE)
  Process: 23838 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 23850 (apache2)
    Tasks: 7 (limit: 2299)
   CGroup: /system.slice/apache2.service
           ├─23850 /usr/sbin/apache2 -k start
           ├─28782 /usr/sbin/apache2 -k start
           ├─28783 /usr/sbin/apache2 -k start
           ├─28784 /usr/sbin/apache2 -k start
           ├─28785 /usr/sbin/apache2 -k start
           ├─28786 /usr/sbin/apache2 -k start
           └─28790 /usr/sbin/apache2 -k start

journalctl -xe команда показывает это

Nov 10 14:52:18 ozols01 apachectl[28773]: AH00558: apache2: Could not reliably determine the server's fully q
Nov 10 14:52:18 ozols01 systemd[1]: Reloaded The Apache HTTP Server.
Nov 10 15:00:30 ozols01 systemd[1]: Reloading The Apache HTTP Server.

Nov 10 15:09:05 ozols01 apachectl[28892]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Nov 10 15:09:05 ozols01 apachectl[28892]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/$var/log/apache2/' for error log of vhost defined at /etc/apache2/sites-enabled/example1.conf:1
Nov 10 15:09:05 ozols01 apachectl[28892]: AH00014: Configuration check failed
Nov 10 15:09:05 ozols01 apachectl[28892]: Action 'graceful' failed.
Nov 10 15:09:05 ozols01 apachectl[28892]: The Apache error log may have more information.
Nov 10 15:09:05 ozols01 systemd[1]: apache2.service: Control process exited, code=exited status=1
Nov 10 15:09:05 ozols01 systemd[1]: Reload failed for The Apache HTTP Server.
-- Subject: Unit apache2.service has finished reloading its configuration
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit apache2.service has finished reloading its configuration
--
-- The result is RESULT.
Nov 10 15:09:05 ozols01 systemd[1]: Started Clean php session files.
-- Subject: Unit phpsessionclean.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit phpsessionclean.service has finished starting up.
--
-- The start-up result is RESULT.

это мой файл виртуального хоста

<VirtualHost *:80>
    ServerAdmin admin@example1.com
    ServerName example1.com
    ServerAlias www.example1.com
    DocumentRoot /var/www/html/example1.com/public_html
    ErrorLog $var/log/apache2/error.log
    CustomLog $var/log/apache2/access.log combined
</VirtualHost>

как решить эту проблему?

...