Error while starting Apache

Asked

Viewed 1,340 times

-1

inserir a descrição da imagem aquiHow do I solve this kind of mistake?

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A unidade apache2.service está sendo iniciada.
Out 28 13:41:53 fabiano-ubuntu apache2[2786]:  * Starting Apache httpd web server apache2
Out 28 13:41:53 fabiano-ubuntu apache2[2786]:  *
Out 28 13:41:53 fabiano-ubuntu apache2[2786]:  * The apache2 configtest failed.
Out 28 13:41:53 fabiano-ubuntu apache2[2786]: Output of config test was:
Out 28 13:41:53 fabiano-ubuntu apache2[2786]: AH00526: Syntax error on line 1 of /etc/apache2/sites-enabled/000-default.conf:
Out 28 13:41:53 fabiano-ubuntu apache2[2786]: <VirtualHost> directive missing closing '>'
Out 28 13:41:53 fabiano-ubuntu apache2[2786]: Action 'configtest' failed.
Out 28 13:41:53 fabiano-ubuntu apache2[2786]: The Apache error log may have more information.
Out 28 13:41:53 fabiano-ubuntu systemd[1]: apache2.service: Control process exited, code=exited status=1
Out 28 13:41:53 fabiano-ubuntu systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: A unidade apache2.service falhou
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A unidade apache2.service falhou.
-- 
-- O resultado é failed.
Out 28 13:41:53 fabiano-ubuntu systemd[1]: apache2.service: Unit entered failed state.
Out 28 13:41:53 fabiano-ubuntu systemd[1]: apache2.service: Failed with result 'exit-code'.
Out 28 13:41:53 fabiano-ubuntu polkitd(authority=local)[951]: Unregistered Authentication Agent for unix-process:2773:92828 (system bus name 

I stand by.

Filing cabinet 000-default.conf

<VirtualHost> 
    #rName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This i*:80>
    # The Serves used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn
    AllowOverride All
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  • the directory /var/www/html exists? apache or www-data has permission in it?

1 answer

2

You have edited the file /etc/apache2/sites-enabled/000-default.conf and forgot to specify the door, and to close the directive Virtualhost.

AH00526: Syntax error on line 1 of /etc/apache2/sites-enabled/000-default.conf
<VirtualHost> directive missing closing '>'

Open the file

sudo gedit /etc/apache2/sites-enabled/000-default.conf

In the first line, just change

<VirtualHost

To

<VirtualHost *:80>

This virtual host section corresponds to any requests that are made on the port 80, the standard door HTTP.

  • Thank you, dear, but the error still persists. I fixed what you gave me, but it seems that the error continues. What should I do in this case?

  • The same mistake ? Edith your question and puts a Screenshot ( Printscreen ) from the terminal. Also put the whole file 000-default.conf.

  • As requested I sent the image and the file I edited.

  • @Fabianomaximiano see now, how it turned out

Browser other questions tagged

You are not signed in. Login or sign up in order to post.