# Apache + Virtualbox + Hardened Gentoo Problem

## regomodo

Hi, I've set up an Apache server in Gentoo via Virtualbox. I know it works locally via links2 but i'm having issues getting it to work in my HostOS, Funtoo.

I've setup the NAT port-forwarding for Virtualbox and I have a feeling something works. 

```
reg@funtoo-pc ~ $ VBoxManage getextradata genserv enumerate

VirtualBox Command Line Management Interface Version 3.0.12

(C) 2005-2009 Sun Microsystems, Inc.

All rights reserved.

Key: GUI/SaveMountedAtRuntime, Value: yes

Key: GUI/ShowMiniToolBar, Value: yes

Key: GUI/MiniToolBarAlignment, Value: bottom

Key: GUI/LastCloseAction, Value: powerOff

Key: GUI/LastWindowPostion, Value: 391,25,720,452

Key: GUI/Fullscreen, Value: off

Key: GUI/Seamless, Value: off

Key: GUI/AutoresizeGuest, Value: on

Key: GUI/MiniToolBarAutoHide, Value: on

Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol, Value: TCP

Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort, Value: 80

Key: VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort, Value: 8888

```

If I try to navigate to http://localhost:8888 my browser eventually timesout. If I use a different port, like 8000, it instantly times out. 

I have a feeling the issue is at  the GuestOS' end. Does anyone have any pointers?

----------

## Inodoro_Pereyra

Use nmap to test both. On the host:

```
nmap -vv localhost -p 8888
```

On the guest:

```
nmap -vv localhost -p 80
```

This will give you a clue on wich of the both parts are failing.

Try curl on guest:

```
curl localhost
```

And if it works, try the same on the host. Let us know the results.

Cheers!

----------

## regomodo

```
reg@funtoo-pc ~ $ nmap -vv localhost -p 8888

Starting Nmap 5.00 ( http://nmap.org ) at 2010-01-23 17:55 Local time zone must be set--see zic manual page

Initiating Ping Scan at 17:55

Scanning 127.0.0.1 [2 ports]

Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 1 undergoing Ping Scan

Ping Scan Timing: About 100.00% done; ETC: 17:55 (0:00:00 remaining)

Completed Ping Scan at 17:55, 0.00s elapsed (1 total hosts)

Initiating Connect Scan at 17:55

Scanning localhost (127.0.0.1) [1 port]

Discovered open port 8888/tcp on 127.0.0.1

Completed Connect Scan at 17:55, 0.00s elapsed (1 total ports)

Host localhost (127.0.0.1) is up (0.000035s latency).

Scanned at 2010-01-23 17:55:22 Local time zone must be set--see zic manual page for 0s

Interesting ports on localhost (127.0.0.1):

PORT     STATE SERVICE

8888/tcp open  sun-answerbook

Read data files from: /usr/share/nmap

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
```

For the guestos nmap

http://imgur.com/EdWjr.png

The curl command gave me the contents of /var/www/localhost/htdocs/index.html

curl on the host does nothing. 

```
reg@funtoo-pc ~ $ curl localhost:8888

curl: (56) Failure when receiving data from the peer
```

----------

## regomodo

Bump

----------

## regomodo

Bump

----------

## regomodo

Bump

----------

## cach0rr0

Goose!

----------

## regomodo

Bump.

----------

## regomodo

Bump?

----------

## regomodo

It has to be the virtualised Gentoo at fault as i've just installed Debian and that worked straight off the bat.

Cheers again Gentoo forums for your always brilliant contributions.

----------

