Estoy perplejo sobre el problema que tengo y realmente agradecería la ayuda para resolverlo.
Tengo un iMac con Mac OS X Mavericks 10.9.2
He configurado mi apache para servir documentos desde la raíz del servidor / Volume / sites /
Estoy usando hosts virtuales dinámicos, por lo que al agregar un directorio con el sufijo * .dev, se convierte en un host virtual.
El archivo de mi host es bastante básico:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
Mi archivo httpd-vhosts.conf es el siguiente:
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#allow access to the Hosts directory where your sites are
<Directory "/Volumes/sites">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
#you could configure the following to only allow access from localhost
Order allow,deny
Allow from all
</Directory>
#get the server name from the Host: header
UseCanonicalName Off
VirtualDocumentRoot /Volumes/sites/%0/
Todo esto funcionó. Y no he cambiado nada en mi archivo httpd.conf.
Sin embargo, no puedo cargar localhost
Tampoco puedo cargar 127.0.0.1
Ejecuté el comando sudo lsof -i :80 | egrep "PID|LISTEN"
para ver si algún PID estaba escuchando en el puerto 80. Los resultados estaban vacíos.
He intentado reiniciar Apache y también detener y luego iniciar Apache usando
sudo apachectl stop
sudo apachectl start
sudo apachectl restart
Nada funciona.
Verifiqué si Apache se estaba ejecutando al emitir el comando httpd -v
La devolución fue:
Server version: Apache/2.2.26 (Unix)
Server built: Dec 10 2013 22:09:38
Intenté conectarme a localhost y 127.0.0.1 a través de la línea de comandos con el siguiente resultado:
alisamii at alisamii in ~
$ telnet localhost 80
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
telnet: Unable to connect to remote host
alisamii at alisamii in ~
$ telnet 127.0.0.1 80
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
alisamii at alisamii in ~
$ lynx http://localhost
Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://localhost/
alisamii at alisamii in ~
$ lynx http://127.0.0.1
Looking up 127.0.0.1
Making HTTP connection to 127.0.0.1
Alert!: Unable to connect to remote host.
lynx: Can't access startfile http://127.0.0.1/
alisamii at alisamii in ~
Por favor ayuda.