[FreeBSD] Can't get Apache2 running

j79zlr

Glaanies script monkey
Political Access
Joined
16 Feb 2003
Messages
2,725
hmm, haven't tested it, but you had set apache to listen to 192.168.0.4:80 but you don't have the hosts file pointing to that IP, might cause a problem. I suggest changing httpd.conf to just Listen 80 [without IP] and adding the relevant sections in hosts

192.168.0.4 server1.thuisnet.lan server1.thuisnet server1
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
Hmm, that sounds logical. I was gonna try it (I am at work now), but it seems that the SSH port is blocked. Damn.
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
Hmm, sounds logical. But what I still don't understand, is why I can't ping to a hostname, while the hosts file has an entry for it. Or did I edited it wrong?
 

j79zlr

Glaanies script monkey
Political Access
Joined
16 Feb 2003
Messages
2,725
I don't get it either, I just messed with my hosts file here and it worked like yours should've.

Code:
root@daemonode# ee /etc/hosts
 
^[ (escape) menu  ^y search prompt  ^k delete line   ^p prev li   ^g prev page
^o ascii code     ^x search         ^l undelete line ^n next li   ^v next page
^u end of file    ^a begin of line  ^w delete word   ^b back 1 char
^t begin of file  ^e end of line    ^r restore word  ^f forward 1 char
^c command        ^d delete                          ^z next word
L: 3 C: 34 ================                         ===========================
::1                     localhost.darkstar localhost
127.0.0.1               localhost.darkstar localhost
127.0.0.1               daemonode
192.168.1.7             daemonode.darkstar daemonode
192.168.1.7             daemonode.darkstar.
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
"/etc/hosts" 5 lines, 171 characters
root@daemonode# ping daemonode
PING daemonode (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.048 ms
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
I see you placed a <tab> between the IP and it's hostname, while I placed a <space> between them. Can this be the reason?
 

j79zlr

Glaanies script monkey
Political Access
Joined
16 Feb 2003
Messages
2,725
nope, just for organization, wouldn't make a difference.
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
Damn weird this stuff. I just can't make the hosts file work. When I change the localhost IP to 127.0.0.2 it works, but when I add my own, it doesn't work.
Just for fun, here it is:
Code:
# $FreeBSD: src/etc/hosts,v 1.11.2.4 2003/02/06 20:36:58 dbaker Exp $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/host.conf for the resolution order.
#
#
::1                     localhost localhost.thuisnet.lan
127.0.0.1               localhost localhost.thuisnet.lan
#
# Imaginary network.
#10.0.0.2               myname.my.domain myname
#10.0.0.3               myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#       10.0.0.0        -   10.255.255.255
#       172.16.0.0      -   172.31.255.255
#       192.168.0.0     -   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#

192.168.0.4     server1.thuisnet.lan server1.thuisnet server1
192.168.0.2     glenn.thuisnet.lan glenn.thuisnet glenn

Can someone find anything wrong?
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
Ah, found the answer. The lines of code I showed in the previous code, wasn't the exact code that I used to test all this. I added the 192.168.0.2 part to it, assuming it wouldn't matter. I didn't test the file after the adding of that line.
Well, I decided to give it another go 2 mins ago and it turned out I could ping every server1 alias, but not the glenn aliases. After some thinking I decided to put a newline (Enter) after the last line, leaving a blank line at the end of the file. And, as you may guess, that worked!
I tested some more, so I removed the blank line and the 192.168.0.2 part and now I couldn't ping server1 aliases anymore. Added a newline at the end of the file and now it did work. Very strange indeed, I don't understand why you need to put a newline at the eof, but hell, it works now!

Oh, Apache2 works too now, or at least, it starts up. I am going to test now.
 

Geffy

OSNN Veteran Addict
Joined
18 Mar 2002
Messages
7,805
how odd, were you editting these files over ssh or in the BSD console or with Notepad or something??
 

Xie

- geek -
Joined
29 Sep 2003
Messages
5,275
Yeah alot of *nix stuff is picking about having or not having spaces :p

-edit- kinda off topic but I really like to use "ee" as an editor.
 

Geffy

OSNN Veteran Addict
Joined
18 Mar 2002
Messages
7,805
in continuance of the off topic theme, I prefer nano
 

j79zlr

Glaanies script monkey
Political Access
Joined
16 Feb 2003
Messages
2,725
EasyEditor is nice, but I'm pretty used to vi now and use that on linux.
 

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
I know how to use Joe and I don't know how to use either ee or vi. As long as I can edit my text, I don't mind.

btw I also managed to get Samba to work! I now have a shared network drive on my Windows box, directing to my home userfolder in FreeBSD :D I am proud of myself :D
 

X-Istence

*
Political Access
Joined
5 Dec 2001
Messages
6,498
Wow, with the conf files that come with it that is nice :p

I know how to use:

vi
nano
edit (ee)
pico

and perl :p.
 

Geffy

OSNN Veteran Addict
Joined
18 Mar 2002
Messages
7,805
I compiled and installed Apache2 and PHP 5 rc2 on my laptop today, its all workin fine, well sorta phpSysInfo dont work, and I havent tried phpMyAdmin or phpPgAdmin, but I will let you know how those go
 

Geffy

OSNN Veteran Addict
Joined
18 Mar 2002
Messages
7,805
dunno yet I havent really messed with it, going to mess with it over the weekend I think
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,014
Messages
673,490
Members
5,613
Latest member
robertwnielsenIA