0

I tried to install apache2 on ubuntu 16.04 lts by:

sudo apt-get install apache2 -y

And the output says:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  apache2-data apache2-utils
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-data apache2-utils
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 330 kB of archives.
After this operation, 1,718 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-utils amd64 2.4.18-2ubuntu3.9 [81.8 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2-data all 2.4.18-2ubuntu3.9 [162 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apache2 amd64 2.4.18-2ubuntu3.9 [86.6 kB]
Fetched 330 kB in 0s (439 kB/s)   
Selecting previously unselected package apache2-utils.
(Reading database ... 470444 files and directories currently installed.)
Preparing to unpack .../apache2-utils_2.4.18-2ubuntu3.9_amd64.deb ...
Unpacking apache2-utils (2.4.18-2ubuntu3.9) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../apache2-data_2.4.18-2ubuntu3.9_all.deb ...
Unpacking apache2-data (2.4.18-2ubuntu3.9) ...
Selecting previously unselected package apache2.
Preparing to unpack .../apache2_2.4.18-2ubuntu3.9_amd64.deb ...
Unpacking apache2 (2.4.18-2ubuntu3.9) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.16) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Rules updated for profile 'Apache Full'
Rules updated for profile 'OpenSSH'
Firewall reloaded
Setting up apache2-utils (2.4.18-2ubuntu3.9) ...
Setting up apache2-data (2.4.18-2ubuntu3.9) ...
Setting up apache2 (2.4.18-2ubuntu3.9) ...
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Sat 2019-03-02 18:07:41 CET; 5ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 17497 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Mar 02 18:07:41 gervis apache2[17497]:  *
Mar 02 18:07:41 gervis apache2[17497]:  * The apache2 configtest failed.
Mar 02 18:07:41 gervis apache2[17497]: Output of config test was:
Mar 02 18:07:41 gervis apache2[17497]: apache2: Syntax error on line 219 of...d.
Mar 02 18:07:41 gervis apache2[17497]: Action 'configtest' failed.
Mar 02 18:07:41 gervis apache2[17497]: The Apache error log may have more i...n.
Mar 02 18:07:41 gervis systemd[1]: apache2.service: Control process exited,...=1
Mar 02 18:07:41 gervis systemd[1]: Failed to start LSB: Apache2 web server.
Mar 02 18:07:41 gervis systemd[1]: apache2.service: Unit entered failed state.
Mar 02 18:07:41 gervis systemd[1]: apache2.service: Failed with result 'exi...'.
Hint: Some lines were ellipsized, use -l to show in full.

Line 219 of /etc/apache2/apache2.conf is as below

enter image description here

And I don't know how to use this information:

Some lines were ellipsized, use -l to show in full.

Any help on this issue will be appreciated.

Ps. I also tried

systemctl status apache2.service

and the output is as follows:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Sat 2019-03-02 19:36:17 CET; 1min 44s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 24739 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Mar 02 19:36:17 gervis apache2[24739]:  *
Mar 02 19:36:17 gervis apache2[24739]:  * The apache2 configtest failed.
Mar 02 19:36:17 gervis apache2[24739]: Output of config test was:
Mar 02 19:36:17 gervis apache2[24739]: apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Syntax error on line 21 of /etc/apache2/sites-enabled/squirrelmail.conf: /etc/apache2/sites-enabled/squirrelmail.conf:21: <VirtualHost> was not closed.
Mar 02 19:36:17 gervis apache2[24739]: Action 'configtest' failed.
Mar 02 19:36:17 gervis apache2[24739]: The Apache error log may have more information.
Mar 02 19:36:17 gervis systemd[1]: apache2.service: Control process exited, code=exited status=1
Mar 02 19:36:17 gervis systemd[1]: Failed to start LSB: Apache2 web server.
Mar 02 19:36:17 gervis systemd[1]: apache2.service: Unit entered failed state.
Mar 02 19:36:17 gervis systemd[1]: apache2.service: Failed with result 'exit-code'.

So I tried looking at /sites-enabled/squirrelmail.conf as @steeldriver suggested. Line 21 says:

enter image description here

is there some problem there?

4
  • 1
    The error may be in one of the files included by the line (i.e. one of the .conf files in the sites-enabled directory), rather than in the line itself I think Mar 2 '19 at 17:39
  • I was so blind I didn't see the # on line 24 of /sites-enabled/squirrelmail.conf .. thanks for all the help.
    – mm-crj
    Mar 2 '19 at 18:53
  • please post the complete squirrelmail.conf as the error saying that Virtualhost tag was not closed like missing </VirtualHost>
    – Alpy
    Mar 2 '19 at 19:28
  • It's fixed no? The #on line 24 should not be there.
    – mm-crj
    Mar 2 '19 at 19:30
1

Remove the # from line 24 of /sites-enabled/squirrelmail.conf file, where the closing tag of VirtulaHost is.

1
  • It's line 24 I guess.
    – mm-crj
    Mar 2 '19 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.