# Apache2.. How to.

## diabx0r

Alright, it's been a while since I've used Apache...

I emerged the latest Apache.. now I just need to know what to do just to get it up and running, basically... LIke for pic hosting and such.

I tried apache2 -k start but I don't think it did anything.

When I try and connect to my IP in Firefox it just says connection refused.

What all is needed?

Thanks guys and gals!

-Alex

----------

## DecoR

Have you read the howto on www.apache.org ?

You have to do some basic setup in /etc/apache2/conf/apache2.conf

If you dont want to write your own file, copy commonapache2.conf to apache2.conf and edit it to suit your needs.

Try

```
apache2ctl start
```

then post your output on

```
ps ax | grep apache2
```

here.

Henrik.

----------

## monotux

```
/etc/init.d/apache2 start
```

is the proper way to start apache in gentoo...

anyways - I have the same problem, with "Connection Refused" when I try to contact my computer...

Sometimes (when I'm lucky) I get "No route to host" when trying to connect through ssh (ftp and http won't work at all...)

I think this has something to do with the /etc/hosts and /etc/resolv.conf, but I'm not sure.

I'll be back later with a solution, I hope  :Smile: 

----------

## Draven

i was having the same connection problems.

I had to edit my /etc/hosts file to match up with my /etc/hostname file.

basically where

"127.0.0.1  <localhost>"       // where <localhost> was the name of my computer within my /etc/hostname file.

hope that helps.

----------

## thecooptoo

the basic Apache config comes with very restrictive permissions

the first <Directory />

....</Dirfectory> will deny access to everybody

Whilst testing try changing it to 

..Allow from all

and see what you get with http://localhost

If it serves web pages then change it back to being very  restrictive  and add another one eg

<Directory /var/www/localhost>

Allow from all/127.0.0.1/192.168.0.0/24 

</Directory>

----------

## cottonmouth

If your logs (/var/log/apache/error.log) talks about mod_rewrite, check out jethromann's solution

 *jethromann wrote:*   

> I had the same error cause I cut too much out of the kernel.
> 
> Try adding System V IPC support to your kernel.
> 
> ```
> ...

 

----------

