Sono perplesso per il problema che sto riscontrando e apprezzerei molto l'aiuto per risolverlo.
Ho un iMac con Mac OS X Mavericks 10.9.2
Ho impostato il mio apache per pubblicare documenti dal server root / Volume / siti /
Sto usando host virtuali dinamici, quindi semplicemente aggiungendo una directory con il suffisso * .dev, diventa un host virtuale.
Il mio file hosts è piuttosto semplice:
##
# 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
Il mio file httpd-vhosts.conf è il seguente:
#
# 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/
Tutto ha funzionato. E non ho cambiato nulla nel mio file httpd.conf.
Tuttavia non riesco a caricare localhost
Inoltre non riesco a caricare 127.0.0.1
Ho eseguito il comando sudo lsof -i :80 | egrep "PID|LISTEN"
per vedere se qualche PID era in ascolto sulla porta 80. I risultati erano vuoti.
Ho provato a riavviare apache e anche a interrompere e quindi avviare apache utilizzando
sudo apachectl stop
sudo apachectl start
sudo apachectl restart
Niente funziona.
Ho verificato se Apache era in esecuzione eseguendo il comando httpd -v
Il ritorno è stato:
Server version: Apache/2.2.26 (Unix)
Server built: Dec 10 2013 22:09:38
Ho provato a connettermi a localhost e 127.0.0.1 tramite la riga di comando con il seguente risultato:
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 ~
Per favore aiuto.