# Problem with opened ports



## onehitxzibit (May 30, 2009)

I am using a clean install of FreeBSD, but when I try to connect to my web server using telnet (telnet localhost 80) it says "connection refused". I didn't install any firewalls and the same command works fine for port 22 (ssh), so I guess FreeBSD comes with ports closed by default. My question is - how can I open them?


----------



## Nokobon (May 30, 2009)

Are you shure that your Webserver is running?
Is it listed in the output of

```
sockstat -4
```
?

As far as I know neither TCP Wrapper nor Paket Filter deny traffic on any ports by default...


----------



## DutchDaemon (May 30, 2009)

Is Apache set to actually listen on all interfaces (including loopback), or is it bound to a specific IP address on your system?


----------



## phoenix (May 31, 2009)

`$ netstat -an | grep LIST` will show open TCP ports as well.


----------



## SirDice (Jun 1, 2009)

If you install apache it will not start automatically. You will need to add *apache22_enable="YES"* to /etc/rc.conf. After that you can start it using `# /usr/local/etc/rc.d/apache22 start` (this is assuming you've installed apache 2.2.x).

Just remember, anything you install will not start automatically, you will have to edit something (usually /etc/rc.conf) to get it to start.


----------



## onehitxzibit (Jun 1, 2009)

It turned out that the Apache wasn't running. Thank you all for the help. *@SirDice* - after I enable it will it start automaticly after system restart?


----------



## SirDice (Jun 1, 2009)

onehitxzibit said:
			
		

> *@SirDice* - after I enable it will it start automaticly after system restart?


Yes, if you add *apache22_enable="YES"* to /etc/rc.conf, apache will start automatically when the system is booted.


----------

