A
A
Arseniy Latypov2019-12-01 00:50:43
Apache HTTP Server
Arseniy Latypov, 2019-12-01 00:50:43

How to remove default apache2 virtual host config?

Good day to all!
I decided to get rid of the standard configuration file of virtual hosts 000-default.conf, after disabling it through a2dissite and connecting a new one, but when the service is restarted, apache gives the following:

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

By executing journalctl -xe, I got information about what swears on ports.conf, but the bottom line is that if I take the contents of the new virtual host and re-create 000-default.conf and push its contents there, the error will disappear
-- Юнит apache2.service начал процесс перечитывания своей конфигурации.
ноя 30 20:19:08 prxsrv apachectl[3805]: AH00526: Syntax error on line 12 of /etc/apache2/ports.conf:
ноя 30 20:19:08 prxsrv apachectl[3805]: Cannot define multiple Listeners on the same IP:port
ноя 30 20:19:08 prxsrv apachectl[3805]: Action 'graceful' failed.
ноя 30 20:19:08 prxsrv apachectl[3805]: The Apache error log may have more information.
ноя 30 20:19:08 prxsrv systemd[1]: apache2.service: Control process exited, code=exited status=1
ноя 30 20:19:08 prxsrv systemd[1]: Reload failed for The Apache HTTP Server.
-- Subject: Юнит apache2.service завершил перечитывание своих настроек
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Юнит apache2.service завершил процесс перечитывания своей конфигурации.
--
-- Результат: RESULT.
ноя 30 20:23:00 prxsrv systemd-timesyncd[702]: Network configuration changed, trying to establish connection.
ноя 30 20:23:00 prxsrv systemd-timesyncd[702]: Synchronized to time server 91.189.89.198:123 (ntp.ubuntu.com).
ноя 30 20:28:00 prxsrv systemd-timesyncd[702]: Network configuration changed, trying to establish connection.
ноя 30 20:28:00 prxsrv systemd-timesyncd[702]: Synchronized to time server 91.189.89.198:123 (ntp.ubuntu.com).
ноя 30 20:28:09 prxsrv systemd[1]: Reloading The Apache HTTP Server.
-- Subject: Юнит apache2.service начал перечитывать свои настройки
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Юнит apache2.service начал процесс перечитывания своей конфигурации.
ноя 30 20:28:09 prxsrv apachectl[3858]: AH00526: Syntax error on line 3 of /etc/apache2/ports.conf:
ноя 30 20:28:09 prxsrv apachectl[3858]: Invalid command '/etc/apache2/sites-enabled/corp.conf', perhaps misspelled or defined by a module not included in the server configuration
ноя 30 20:28:09 prxsrv apachectl[3858]: Action 'graceful' failed.
ноя 30 20:28:09 prxsrv apachectl[3858]: The Apache error log may have more information.
ноя 30 20:28:09 prxsrv systemd[1]: apache2.service: Control process exited, code=exited status=1
ноя 30 20:28:09 prxsrv systemd[1]: Reload failed for The Apache HTTP Server.
-- Subject: Юнит apache2.service завершил перечитывание своих настроек
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

Ports.conf content:
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/corp.conf
Listen 80
Listen 14799
<IfModule ssl_module>
        Listen 443
</IfModule>
<IfModule mod_gnutls.c>
        Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

I already tried to prescribe ServerName in apache.conf and in the new virtual host config, but nothing helps
. Tell me where to dig?
Server version: Apache/2.4.29 (Ubuntu)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
akelsey, 2019-12-01
@ceh9_lat

He writes to you in English in white:

Nov 30 20:19:08 prxsrv apachectl[3805]: AH00526: Syntax error on line 12 of /etc/apache2/ports.conf:
Nov 30 20:19:08 prxsrv apachectl[3805]: Cannot define multiple Listeners on the same IP:port

Bring your own config:
Listen 80
Listen 14799

Listen to either 80 or 14799.

V
Vitaly Karasik, 2019-12-01
@vitaly_il1

Show the configuration of your Wirth. hosta

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question