Starting built in Apache server in Mac OS X 10.9 (Mavericks)
-
21-12-2019 - |
Pregunta
I'd like to start my apache server in my Mac OSX Mavericks. Here is what I did:
- launch the terminal application
- sudo apachectl start
- The server started without problem. But I got the following problem when I tried to open the localhost in web browser:
You don't have permission to access / on this server.
Here is my /etc/apache2/httpd.conf: (I didn't change anything here)
DocumentRoot "/Library/WebServer/Documents"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all </Directory>
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Can anybody advise what could be the cause ? Thanks
Solución
First, point to a file you know is present. By default there is no index.html or similar file (it produces the "It Works!" page from index.html.en
ls /Library/WebServer/Documents
PoweredByMacOSX.gif
PoweredByMacOSXLarge.gif
index.html.en
http://xxx.xxx.xxx.xxx/PoweredByMacOSX.gif
Next, try repairing permissions. If that doesn't work:
sudo chown -R root.wheel /Library/WebServer/Documents
sudo chmod -R a+rX /Library/WebServer/Documents
When in doubt:
sudo tail /var/log/apache2/error_log
Otros consejos
Easy way to start apanche server in mavrick
execute this command
sudo apachectl start
sudo apachectl stop
sudo apachectl restart
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow