# apache connection refused

## ferris5

Hi People,

I emerged cacti for graphing traffic en stuff.

After emerge it told me to open my browser and type my hostname and cacti as dir.

So i typed in http://localhost/cacti/ and get "connection refused"

So i typed http://localhost/ again connection refused.

Looked in the forum for anyane with the same problem, but only in french and that is not my cup of thea.

Can anyone help me with this?

cheers

Ferris

----------

## gnuageux

Did you start httpd via init.d?

----------

## ferris5

there is no httpd in de /etc/init.d/ ???

what now? emerge httpd?

----------

## gnuageux

Nah dont do that, hang on one second. The title of your post indicates that your using apache to serve webpages. The package you emerged is cacti? Which is a gui to map bandwidth utilization right? I dont know wether cacti works as a stand alone service, or whether it needs to work in conjunction with apache. (I'd imagine the later, but I could be wrong) Let me check into it really quick...........

----------

## gnuageux

What happens if you try to spawn cacti from bash, then browse to localhost?

----------

## ferris5

spawn?

How do i do that?

----------

## gnuageux

Type the command in from a bash shell, (just type cacti, if that doesnt work try typing cac then hitting tab to see what completes) then try to browse to localhost.

----------

## ferris5

nothing it does not know the command spawn.

but cacti is installed in /var/www/localhost/htdocs/cacti/

----------

## gnuageux

Not spawn  :Smile:  cacti, try typing cacti, what happens?

----------

## ferris5

oooh   :Embarassed:     , but still command not found

----------

## gnuageux

You want to view bandwidth graphs, correct? Not serve webpages, sorry still a lil confused as the 1st post had a different app listed than the title.

----------

## gnuageux

Yeah, just from glancing on their homepage 

(http://www.raxnet.net/products/cacti/) it looks like typically people run this along with apache, and cacti populates php graphs etc. So youd need to emerge apache, then start httpd as stated above, and probably edit a config file somewhere (dont know for sure) to tell cacti what to poll.

----------

## ferris5

i emerged apache, started it up, but still no go

same measage

----------

## gnuageux

Ok, if you 

```
/etc/init.d/httpd status 
```

 what is returned? From a shell 

```
telnet localhost 80
```

 returns what?

----------

## ferris5

bash /etc/init.d/httpd no such file or directory

----------

## gnuageux

emerge -s apache 

returns what?

----------

## AggieEmpeg

When you emerge apache, the startup script is not httpd, it is apache (for Apache 1.3x) and apache2 (for Apache2.x)

----------

## gnuageux

Really? I havent used apache on gentoo, but on all of the other linux distros ive used its httpd. Or maybe I just havent used a really recent version of it. Curious.

----------

## ferris5

ok this is strange:

# /etc/init.d/apache2 status

status stopped

# /etc/init.d/apache2 start

starting apache ......

apache2: culd not determine the server fully qualified domain name, using 127.0.0.1 for server name

# /etc/init.d/apache2 status

status stopped

----------

## AggieEmpeg

This is actually pretty typical.  You need to do one of the following:

1) Uncomment/add a line in your /etc/apache2/conf/apache.conf file that reads:

```
ServerName <name of your server>
```

2) Add an entry in your /etc/hosts file that maps your IP to a hostname

```
192.168.1.10   <hostname here>
```

----------

## ferris5

ok what ip address i got dhcp on this system so the ip address could change.

 i got now  127.0.0.1 localhost

----------

## AggieEmpeg

Since you have a DHCP IP, you are going to have to make the change to your apache.conf file as described in my previous post.

----------

## ferris5

ok but what should i type in?  dhcp <hostname here>

sorry for not understanding   :Embarassed: 

----------

## AggieEmpeg

Let's say that you named your computer "tango".

In the /etc/apache2/conf/apache2.conf file (around line  :Cool: 

you would uncomment the line (remove the # sign) and make sure the line read:

```
Servername tango
```

Restart apache (if it ever even started) and you should be good to go.

----------

## Mankale

try this:

/etc/init.d/apache2 start

then in your browser:

http://127.0.0.1/cacti

----------

## ferris5

ok i have changed my apache2.conf but still i am not able to start apache, i get apache with big !! behind it and when i do a status its saying it stopped.

----------

## fatshady

you may need to add you're PC name and IP into /etc/hosts

I had to add:

```
192.168.7.3     neo.the_matrix neo

```

which is

```
 ip-addres [comp-name.domain comp-name
```

HTH

D

----------

## ferris5

ok guys, its solved.    :Smile: 

I edited the /etc/hosts and changed 127.0.0.1 localhost to the right hostname of my computer.

Now i have to get php up and running, i think i have to load a module in the conf from apache aint it?

thanks

----------

## fatshady

I tried getting PHP to emerge last night and it bunked out on me during mcal patch emerge...

Let me know if you come across the same...

----------

