I cant get Apache configure correctly El Capitan

Hi, I'm new to the forums and coding on a mac os x. I am trying to start coding in PHP and have gone through several guides to configure apache2 so that I can access my 'Sites' directory through my web browser. I have followed several configuration guides to configure my system but after making the changes to several files (httpd.conf, etc.) I still get the message Unable to Connect when accessing my localhost through browser.


No matter what I do when I try to access my local host through the web browser it says Unable to Connect. I have recently upgraded from Mavericks to El Capitan 10.11.6. I have no idea where to go from here, can someone please point me in the right direction, on how to configure Apache so that I access my localhost directory and begin programming in php.

MacBook Pro

Posted on Aug 17, 2016 4:45 PM

Reply
4 replies

Aug 21, 2016 10:57 AM in response to etresoft

I just went through the guide followed everything step by step. Still getting the 'Unable to Connect' message.


I tried accessing it through http://MacBook-Pro.local, and received the UtC (unable to connect) message

I also tried http://<your-local-host>, still nothing.


I even tried enabling File Sharing but I'm still not able to connect and see the "It Works!" message.


In Terminal I ran the command: apachectl configtest and this is what it returned:


'AH00526: Syntax error on line 20 of /private/etc/apache2/extra/httpd-mpm.conf:

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

What should I do? Appreciate your help

Aug 21, 2016 12:38 PM in response to wliam0807

Ok so I solved part of the problem. I am now able to access http://macbook-pro.local and it shows the message 'It Works!' instead of the unable to connect. I did this by commenting out the following lines in: etc/apache2/extra/httpd-mpm.conf


# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
<IfModule !mpm_winnt_module>
<IfModule !mpm_netware_module>
LockFile "/private/var/log/apache2/accept.lock"
</IfModule>
</IfModule>

I commented out the above lines and it has allowed me to connect to part of the server.


Now I still have a problem. When I try to connect to http://localhost/~<username>/ I get a '403 Forbidden' message saying 'You don't have permission to access /~<username> on this server.


After running apachectl -t this is the message Terminal returns:


AH00548: NameVirtualHost has no effect and will be removed in the next release /private/etc/apache2/extra/httpd-vhosts.conf:19

AH00112: Warning: DocumentRoot [/Users/~Programming/Sites/] does not exist

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

Syntax OK

--------


How can I resolve this issue now?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I cant get Apache configure correctly El Capitan

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.