You are not logged in.
I have installed Apache before (on Ubuntu) and, usually, after install, I'd just go to http://localhost/ and a test page would appear... but not on Arch.
I routinely installed apache package, started apache by issuing "apachectl -k start", and tried to connect to localhost, but it didn't work. So I googled around for a while and tried again, this time changed a httpd.conf line to:
ServerName localhost:80
The error I'm getting is:
An error occurred while loading http://localhost/:
Could not connect to host localhost.
Is there something more I should do to get apache to start? (Well, obviously there is, or I wouldn't be here, duh!)
Offline
is localhost in your /etc/hosts?
I am a gated community.
Offline
I don't know wether this causes the problem, but all /etc/hosts I saw looked a little different from yours.
As far as I know localhost has to be replaced with the value for HOSTNAME made in /etc/rc.conf. If it's localdomain too, I didn't say anything but you are the first one I've seen who hasn't changed it. (Which is nothing bad at all but caused my attention.)
Hail to the thief!
Offline
@harlekin
Thanks for the info. I was totally unaware of that.
My hostname is foxen1.
So do I change /etc/hosts to:
#<ip> <hostname> <hostname>
127.0.0.1 foxen1 localhost
Or:
#<ip> <hostname> <hostname>
127.0.0.1 foxen1 foxen1
?
Offline
Did you
/etc/rc.d/httpd start
and what happens if you surf to
http://127.0.0.1
?
:?
Offline
@harlekin
So do I change /etc/hosts to:#<ip> <hostname> <hostname> 127.0.0.1 foxen1 localhost
Or:
#<ip> <hostname> <hostname> 127.0.0.1 foxen1 foxen1
?
I think it has to be:
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 foxen1.localdomain foxen1
Hail to the thief!
Offline
/etc/hosts
127.0.0.1 localhost.localdomain localhost
note: you can change this, i don't see any need to do so, apache runs fine like this as well.
/etc/httpd/conf/httpd.conf
Listen localhost:80
note: Listen not ServerName...
/etc/rc.conf
HOSTNAME="n501931pc"
note: that's my hostname, yours is fine
Ability is nothing without opportunity.
Offline
/etc/hosts
127.0.0.1 localhost.localdomain localhost
note: you can change this, i don't see any need to do so, apache runs fine like this as well.
Hehe, then I won't. The less I change, the easier to spot problems...
/etc/httpd/conf/httpd.conf
Listen localhost:80
note: Listen not ServerName...
Okay. But the ServerName shoud be what? "localhost:80" as well?
/etc/rc.conf
HOSTNAME="n501931pc"
note: that's my hostname, yours is fine
Okay, thanks. I'll go and try that out.
Offline
Okay, failing to follow my own advice (that I gave myself, too) I changed to /etc/hosts to this:
#<ip> <hostname> <hostname>
127.0.0.1 foxen1 foxen1
Then I changed Listen:
Listen foxen1:80
And that didn't work. Finally, I read the commented lines in httpd.conf. (Vim's fault, not mine. Vim displays commented lines as dark blue, very hard to read on a black background.) Noticed that if my server has not valid DNS entry (and it doesn't) then I should enter my IP address. So I entered:
ServerName 127.0.0.1:80
Tadaaaa! Works. Thanks everyone for feedback!
Offline