I've been using the tutorials here as well as here in order to host a web page using Apache on macOS Catalina Version 10.15.1. The problem was that I couldn't access the localhost and kept getting a 404 error.

Upon entering the line sudo /usr/sbin/apachectl configtest in the terminal, I get the following error message:

AH00526: Syntax error on line 21 of /private/etc/apache2/extra/httpd-autoindex.conf: Invalid command 'Alias', perhaps misspelled or defined by a module not included in the server configuration.

This was the line that was giving me trouble:

Alias /icons/ "/usr/share/apache2/icons/"
  • Welcome to Ask Different. Please see How to Ask for important info on asking questions here. You should not include your own answer inside your question. Add the answer, with all relevant details, in the Answer section.
    – fsb
    Nov 30, 2019 at 6:12

1 Answer 1


TL;DR I turned the offending line into a comment by adding a ˋ#ˋ in the first column and restarted Apache.

To fix this, I followed the Youtube tutorial and opened up the file "httpd-autoindex.conf" using Finder and navigated down to line 21 which has the error. It reads Alias /icons/ "/usr/share/httpd/icons/".

Then I found this tutorial by just searching the erroring line in the file on Google. I followed the instructions up until the fourth step because upon trying that line in the terminal I get the message "-bash: service: command not found". So then I simply restarted the apache web server by entering sudo apachectl restart.

Finally, I tried writing sudo /usr/sbin/apachectl configtest and received the "Syntax OK" message, so I went back to the final step in the first tutorial. I entered

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

At last, I type "localhost" into the search bar, hit enter, and get the "It works!" message.

  • Please see How to Answer for important info on answering questions on this site.
    – fsb
    Nov 30, 2019 at 6:12
  • So basically you just turned the Alias line into a comment and restarted Apache?
    – nohillside
    Nov 30, 2019 at 9:47
  • @nohillside Yep, turns out it was that simple! Dec 1, 2019 at 5:52
  • Good if this works for you. It. It might not be enough for people requiring this line though.
    – nohillside
    Dec 1, 2019 at 7:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .