# Apache 2.2



## CosmicUnix (Nov 8, 2012)

Hey Gang,

Okay, it's time for me to get into BSD, and yes: I am completely new here, and the best way (I know how) is to actually get a DVD and get to it...setting up a webserver. So, I enter the /usr/ports/www/apache22 (after *portsnap fetch update*) and issue
`# make clean`
and 
`# make install` 
and...get coffee. After that, I issue 
`# echo apache22_enabled="YES" >> /etc/rc.conf`
and try the apache server with the onestart...and...zip, nothing. Upon inspection of the /etc/rc.d folder, I cannot find httpd or apache22 start-up scripts. Did I miss something  :\ (of ourse I did, hence this post :e ) and what documentation do I read to find the light here.

Thanks

Thor
PS - I hope to not have double-posted, but I didn't directly find a similar topic here.


----------



## SirDice (Nov 8, 2012)

CosmicUnix said:
			
		

> Upon inspection of the /etc/rc.d folder, I cannot find httpd or apache22 start-up scripts. Did I miss something?


Yes, it's not supposed to be there.


```
> ll /usr/local/etc/rc.d/apache22
-r-xr-xr-x  1 root  wheel  5627 Jul 19 11:47 /usr/local/etc/rc.d/apache22
```


----------



## CosmicUnix (Nov 8, 2012)

Thanks for this info, SirDice.

Oh, and by the way, I seem to have made some style mistakes, my apologies...
Please allow me to digest your input.

Thor


----------



## SNK (Nov 8, 2012)

service(8) also scans /usr/local/etc/rc.d.


----------



## UNIXgod (Nov 9, 2012)

CosmicUnix said:
			
		

> Upon inspection of the /etc/rc.d folder, I cannot find httpd or apache22 start-up scripts. Did I miss something  :\ (of ourse I did, hence this post :e ) and what documentation do I read to find the light here.



Cosmic ~ FreeBSD organizes third party installed software by using /usr/local as a separation from base.

Feel free to look at man hier(7) which will give some insight to the layout of FreeBSD filesystem hierarchy.


----------



## CosmicUnix (Nov 9, 2012)

Thanks UNIXgod, that explains why I did'nt find what I was looking for. My main distro was Arch Linux (*was*, because I'd like to learn something new, maybe it'll come back) so, hence my somewhat newbie questions.
I fired up the server now, let's learn something here 

Cosmic


----------



## CosmicUnix (Nov 9, 2012)

Confusion....

I ran 
`#  service -e`
and apache seems to be in the list... I also checked the document root and there is an index.html available. Hmm, I may get to do some research here. I tried to pick up the index page from an other PC in the network, but it doesn't give anything back, my first thought was that apache wasn't running, upon inspection it seems to be in there...

By the way, sorry if I don't get it right the first time round... FreeBSD seems the next logical step, and maybe even my next choice of desktop...

Thanks for your patience...

Cosmic


----------



## usdmatt (Nov 9, 2012)

What does the following tell you?


```
# service apache22 status
```

Just because a service is enabled doesn't mean it is actually running, although if it's listed as enabled it should start on boot. If Apache is actually running you'll see it in the process list as well. If you've just installed Apache and it won't run with the default config files the most likely problem is it not being able to determine the correct hostname. Easiest fix for that is to uncomment the ServerName directive in the main config file and set it.

Either way it should output errors if you try to start/restart it or write them to /var/log/httpd-error.log


----------



## SirDice (Nov 9, 2012)

Try starting it with
`# service apache22 start`


----------



## CosmicUnix (Nov 9, 2012)

Back from the day-time job, hello everyone 
@ usdmatt 

issuing `# service apache22 status` sends back that apache22 is not running, something I already learned in the form of diagnostics (I'll have to start making notes here...  )
On to the error log, something I checked just before going off to work, yields that the hostname canot be found



> hostname nor servname provided, or not known: mod_unique_id: unable to find IPV4 address of "Kibou"



...by the way, Kibou seems to be japanese for Hope...unless I'm mistaken 

Settings I did in /usr/local/etc/apache22/httpd.conf :


```
Listen 192.168.1.76:80
```


```
ServerName http://192.168.1.76:80
```

And I tried to disable IPV6 in the /etc/rc.conf as well...but that setting seems deprecated...I'll have to snip it out again.

@ SirDice

Of course, trying to start apache22 with

`# service apache22 start`

did nothing, the sanity check was survive, though...

Thanks for reviewing this...

Cosmic


----------



## icecoke (Nov 16, 2012)

try to fix your /etc/hosts - that's where the address of your host should be found - like:

```
your.ip.add.ress Kibou
```
Dunno why it asks for 'Kibou' and not 'kibou' but give it a try to check the /etc/hosts which is examinated by apaches start.

greetings
Jimmy


----------



## SirDice (Nov 16, 2012)

DNS is not case sensitive so Kibou or kibou shouldn't matter. It's probably looking for 'Kibou' because that's what's set as the hostname in /etc/rc.conf.


----------



## icecoke (Nov 16, 2012)

SirDice said:
			
		

> DNS is not case sensitive so Kibou or kibou shouldn't matter. It's probably looking for 'Kibou' because that's what's set as the hostname in /etc/rc.conf.



The insensitivity was the reason I was wondering about the capital. Now I'm wondering why the system does not lowercase dns relevant strings... 

jimmy


----------



## CosmicUnix (Nov 17, 2012)

Hi everyone!

Oof, weekend, finally some quality time for me. Okay, I seem to have messed up the install altogether, as I tried all the suggestions that qshould work...in a system that was properly set up to begin with. So, right now, I'm re-installing, and reviewing all the suggestions given here, applying these to a properly (as per documentation) set up system...
I really need to read the documentations...but, i've learned some thing here too, so, that's a plus... 

Cosmic


----------



## icecoke (Nov 17, 2012)

Did a clean install of a apache22 just today and 'forced' to have the error message you had:


```
hostname nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "testvs"
```

and as I said (assuming a correct Listen and ServerName entry in httpd.conf) a missing /etc/hosts entry caused it.  

On the other hand you could stop using this mod in question, but there are some more mods staring at /etc/hosts... 

Be aware that it wants the entry it complains, so in your case 'kibou'. The full qualified domainname could be there in addtion, but not alone.

greetings
jimmy


----------



## CosmicUnix (Nov 18, 2012)

Well,

(drumroll) it works...the culprit? Me, for not reading the manuals to begin with 

I stuck to the defaults, installed Apache 2.0, mySQL and Nano (I know, REAL roots use VI, but hey  ) and had to tweak the listen and servername, I also added the IP address to the /etc/hosts file...

There is still a complaint from the mail sender (I think) _sm-mta[1080]_ and _sm-msp-queue[1027]_ about an unqualified host name, possibly an other conf file to tweak 

All in all I'm happy. This box will possibly have to survive the REAL www, so better start of with a *rock-solid OS*...

Okay, so, now the actual site (read: files) - is there a BEST location for them, or can I simply (best) stick to the defaults in the conf file?

By the way, is freeBSD even feasable as a desktop OS? I saw some DE's flashing by during the portsnap update, stuff one would not really install on a server...so I was wondering. My previous OS was Arch Linux, due to a crash, I had to choose something else (long story...)

Thanks for (patiently) leading me, and allowing me into your "tribe" 

Cosmic


----------

