help getting my Apache 2.4 on Ubuntu image back up and running

As part of the Linode migration to KVM I was asked to upgrade my kernel image. I then chose to upgrade my Ubuntu image as well. As a result my Apache was upgraded and I haven't been able to get it restarted despite much effort in configuration hell.

My procedure has been essentially

A) service apache2 start

B) look at error that presents. Go to /etc/apache2/mods-enabled and fiddle with the symbolic link pointing to ../mods-avaiilable. Often I flipped the link to the dpkg-new version of the file and the error migrated to a new place. Sometimes I simply removed the link for the .conf and .load to discipate the error.

C) repeat A

Now I'm stymed on an error point into my apache2.conf itself

===

service apache2 start

  • Starting web server apache2 AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/ports.conf:8

AH00526: Syntax error on line 156 of /etc/apache2/apache2.conf:

Invalid command 'Require', perhaps misspelled or defined by a module not included in the server configuration

Action 'start' failed.

The Apache error log may have more information.

===

The line 156 in apache2.conf is

===

147 # Sets the default security model of the Apache2 HTTPD server. It does

148 # not allow access to the root filesystem outside of /usr/share and /var/www.

149 # The former is used by web applications packaged in Debian,

150 # the latter may be used for local directories served by the web server. If

151 # your system is serving content from a sub-directory in /srv you must allow

152 # access here, or in any related virtual host.

153 154 Options FollowSymLinks

155 AllowOverride None

156 Require all denied

157

158

===

There doesn't seem to be anything in the error log related to this error.

Any help would be appreciated.

Bob

4 Replies

The require command is from mod_auth* modules that are not enabled in your configuration. Given your description, I am assuming that your mods-enabled setup is screwed. The error you are seeing is because the default configuration relies on modules that were not loaded due to the above issue. Do yourself a favor and follow the distribution-specified layout instead of symlinking directories and manipulating symlinks manually.

Typically this occurs when Apache 2.2 is upgraded to 2.4. At a guess, the upgrade replaced the default configuration with new 2.4 versions but failed to install the new module configuration (possibly because it was messed around with in defiance of the distribution rules before the upgrade).

If there is nothing intricate in your configuration, the best bet would be a complete removal of Apache and all related packages, removal (after backup) of /etc/apache2 and letting the reinstall produce a correct default configuration.

Thanks. That helped a lot.

However now my webpages can't be found.

eg. icanprogram.ca gets the default ubuntu page but icanprogram.ca/simpl says can't find pages. They are at /var/www/simpl on my system.

What do I have to reconfigure to bring things back up online.

Thanks in advance for your help.

bob

OK. I see that in the new configuration the DocumentRoot as specified in site-enabled/000-default.conf is set to

/var/www/html

When I symlink my simpl directory to that place the website comes up. yeh!!!

Thanks for all your help. I guess it is a small price to relocate my pages.

bob

You should set up a separate virtual host configuration in sites-available and then enable it with a2ensite. Don't use the default configuration to serve pages.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct