# [SOLVED] Installing Apache

## mvelez215

Hello everyone:

I am VERY new at gentoo and I am sure this is something easy to do if I am pointed to the right direction. I have a box at home that I would like to install Apache on so I may have a PERSONAL web server for my self and things such as viewing sites that I make and stuff like that and for other things as well.

What I want to know is how to I install apache, it seems like it does when I do emerge apache but then how do I configure it and set it to the way I want it to be so it can work, thank you in advance for all your replies!

----------

## Sadako

I'd prefer lighttpd for something like that, but hopefully this will be of use to you.

----------

## mvelez215

 *Hopeless wrote:*   

> I'd prefer lighttpd for something like that, but hopefully this will be of use to you.

 

I really wanted to use apache cause I have used it before so I know how to use it BUT I have never used it in linux till now that 1. I am now suing linux as my main OS and I work for a hosting company that uses nothing but Linux and Apache but I will give this a shot, thank you for your help!

----------

## poly_poly-man

emerge apache, clean up the config (should default close to what you want, with webroot in /var/www/localhost/htdocs iirc), use the documentation/wiki if you need more info (will help to read), and make sure it's started.

----------

## mvelez215

 *poly_poly-man wrote:*   

> emerge apache, clean up the config (should default close to what you want, with webroot in /var/www/localhost/htdocs iirc), use the documentation/wiki if you need more info (will help to read), and make sure it's started.

 

I am sorry for all the questions as I said I am very new to Gentoo or linux it self. How would I "clean" up the config file and how do I know it is started? I will do emerge apache and see what happenes, thank you very much.

----------

## poly_poly-man

 *mvelez215 wrote:*   

>  *poly_poly-man wrote:*   emerge apache, clean up the config (should default close to what you want, with webroot in /var/www/localhost/htdocs iirc), use the documentation/wiki if you need more info (will help to read), and make sure it's started. 
> 
> I am sorry for all the questions as I said I am very new to Gentoo or linux it self. How would I "clean" up the config file and how do I know it is started? I will do emerge apache and see what happenes, thank you very much.

 by "clean up", I mean, make sure it is listening on the right interfaces and stuff like that - google will help you find the setup documentation.

/etc/init.d/apache2 start 

rc-update add apache2 default

If you don't know vaguely what those mean, re-read the manual, especially the part at the end.

----------

## mvelez215

 *poly_poly-man wrote:*   

>  *mvelez215 wrote:*    *poly_poly-man wrote:*   emerge apache, clean up the config (should default close to what you want, with webroot in /var/www/localhost/htdocs iirc), use the documentation/wiki if you need more info (will help to read), and make sure it's started. 
> 
> I am sorry for all the questions as I said I am very new to Gentoo or linux it self. How would I "clean" up the config file and how do I know it is started? I will do emerge apache and see what happenes, thank you very much. by "clean up", I mean, make sure it is listening on the right interfaces and stuff like that - google will help you find the setup documentation.
> 
> /etc/init.d/apache2 start 
> ...

 

Thank you very much for your help I will try this as soon as I can and let you know the outcome.

----------

## mvelez215

 *mvelez215 wrote:*   

>  *poly_poly-man wrote:*    *mvelez215 wrote:*    *poly_poly-man wrote:*   emerge apache, clean up the config (should default close to what you want, with webroot in /var/www/localhost/htdocs iirc), use the documentation/wiki if you need more info (will help to read), and make sure it's started. 
> 
> I am sorry for all the questions as I said I am very new to Gentoo or linux it self. How would I "clean" up the config file and how do I know it is started? I will do emerge apache and see what happenes, thank you very much. by "clean up", I mean, make sure it is listening on the right interfaces and stuff like that - google will help you find the setup documentation.
> 
> /etc/init.d/apache2 start 
> ...

 

I have done everything that you told me I think. Apache is running. MySQL is running and PHP is running but when I try to go to my IP or the dyndns address I have set up for it, I get a failed to connect error. Is there something else I can check or maybe something I am missing here?

----------

## poly_poly-man

make sure your Listen statement covers everything you want it to... probably Listen *:80

----------

## mvelez215

 *poly_poly-man wrote:*   

> make sure your Listen statement covers everything you want it to... probably Listen *:80

 

It is set to port 80 Shold I add other ports such as 8080 and try and use that? Maybe port 80 is being blocked?

----------

## mvelez215

This is how I have it.

###

### IP Address/Port

###

BindAddress *

Listen 80

----------

## Mousee

Are you trying to access it via local IP address or your external IP address? If you're trying via your external IP (aka. internet IP) then your firewall/router may be blocking your access. Assuming you have a firewall or router of course. You'd need to setup port forwarding if that were the case.

----------

## mvelez215

Yea I guess I would have too because the IP address is the one I got when I got my connection here. How can I do this in linux (Gentoo)

----------

## Mousee

 *mvelez215 wrote:*   

> Yea I guess I would have too because the IP address is the one I got when I got my connection here. How can I do this in linux (Gentoo)

 

Well I guess first I'd need to know if you have a router/firewall setup at home or not. Assuming you do, I would suggest looking on http://portforward.com/ to figure out how to go about forwarding your ports. It should be a relatively painless process.

Otherwise you could always try to access your webserver via internal/LAN IP, like http://192.168.0.100 or such.

----------

## mvelez215

It is just a cable modem from comcast unless it comes with a built-in firewall or they are blocking it

----------

## Mousee

 *mvelez215 wrote:*   

> It is just a cable modem from comcast unless it comes with a built-in firewall or they are blocking it

 

I'm not really sure what to tell you then as that could mean several things. Some cable modems come with built-in routing functions and others don't, allowing only 1-2 PC's to connect to the internet at a time. The PortForward site I linked you to before might have your cable modem listed in their database though, so you may give still give it a try. Otherwise I'd suggest Googling around to see if you can find any documentation on your cable modem that might suggest it does have a built-in router and, if you do find said documentation, how to go about accessing its configuration so that you can forward the port for Apache.

----------

## mvelez215

I got it all working now! Thank you everyone for all your help you guys are great!!! 

----------

