thebtcfuture
thebtcfuture

Reputation: 37

macOS Sierra Apache 2: Set the 'ServerName' directive globally to suppress this message

OSX 10.12, Apache 2.4.28, PHP 7.1.12 I am trying to enable a .htaccess file in my project directory. In order for it to work I have to adjust some Apache 2 configuration files. I have gone through a handful of tutorials and code adjustments, and they are all pretty much the same thing. A roadblock has been reached and I lack the knowledge to figure out. I am receiving the error

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, 
using thebtcfuture-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress 
this message

I have edited ServerName and the correct Directory information for httpd.conf /etc/apache2/httpd.conf, /usr/local/etc/httpd/httpdf.conf, /usr/private/etc/apache2/httpd.conf. Where is the global declaration? I am receiving a 500 Internal Server error in my browser

Pertinent changes in httpd.conf:

ServerName localhost:8080

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

DocumentRoot "/Users/development/workspace/html"
<Directory "/Users/development/workspace/html">
    Options FollowSymLinks Multiviews Indexes
    MultiviewsMatch Any
    AllowOverride All
    Require all granted
</Directory>

The tutorials that I have gone through guided me to uncomment several LoadModule lines. These include:

LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule include_module libexec/apache2/mod_include.so

Include /private/etc/apache2/extra/httpd-userdir.conf
Include /private/etc/apache2/extra/httpd-vhosts.conf

Currently /private/etc/apache2/extra/httpd-userdir.conf looks like:

UserDir Sites

Include /private/etc/apache2/users/*.conf
<IfModule bonjour_module>
   RegisterUserSite customized-users
</IfModule>

While /private/etc/apache2/users/development.conf looks like:

<Directory "/Users/development/workspace/html/">
    AllowOverride All
    Options Indexes MultiViews FollowSymLinks
    Require all granted
</Directory>

And /etc/apache2/users/development.conf is written:

<Directory "/Users/development/workspace/html">
    AllowOverride All
    Options Indexes MultiViews FollowSymLinks
    Require all granted
</Directory>

I gave permissions to the user file with:

sudo chmod 644 /etc/apache2/users/development.conf

Terminal repeats the error probably more than a dozen times. Preceding the ServerName error, there is a small output of information on the operation(s) while running:

[mpm_prefork:notice] [pid 110] AH00163: Apache/2.4.28 (Unix) PHP/7.2. configured 
-- resuming normal operations
[Tue Apr 17 01:02:53.753891 2018] [core:notice] [pid 110] AH00094: Command line: 
'/usr/sbin/httpd -D FOREGROUND'
[Fri Apr 20 22:24:34.067265 2018] [mpm_prefork:notice] [pid 110] 
AH00169: caught SIGTERM, shutting down 
AH00558: httpd: Could not reliably determine the server's fully qualified domain name ...

The default location for my Apache server is localhost:8080, and it has ran before. .htaccess is critical to the project I am doing. To utilize its functions locally would save me a tremendous amount of time. What changed the connection to my server? Why is there no qualified domain when I have declared it in all the supporting files that I know of? No past solutions have made a difference in this global declaration error.

I have been restarting the server.

Upvotes: 0

Views: 4047

Answers (1)

J-M.D
J-M.D

Reputation: 189

Your server is not starting because of dso modules problems: php7, despite being called from your conf file, does not seem to be installed, or it is and aprutils prevents it from loading as it should. If you do not need the latter, you can try to comment the line that loads it and try to restart your server.

However, as this is not programmation related, I suggest you remove your question here on StackOverflow and open a new one with that specific new error message on ServerFault.com

We’ll try and solve your problem there.

Upvotes: 0

Related Questions