# Help me set up a server at home

## Tuxido

I already have Gentoo installed, and I'm going to make a LAMP-server. I have no previous experience with setting up a home server, and as suggested I need it for mail, web hosting, databases and file hosting. 

First of all, I'm going to host at least two simple websites that I'm going to make and maintain myself. I have no experience with programming PHP, Perl or Python, what are the advantages of each one, and is there any difference to which one I choose? (I have some programming experience in java, if that makes a difference)

What do I need to think about before going "live" with my box? What kind of security features do I need? Is there some kind of check list I should have for myself?

How would I go about going live? (Online guide?) Do I need to have some sort of dns-server-thingy? Port forwarding? Magic?

Is there anything I need to consider that I probably won't come up with all by myself as a brand noob?

I'm hoping to use this thread to ask more specific questions as they arise, for now I just need some general tips and pointers.

----------

## elgato319

some first comments...

 *Tuxido wrote:*   

> I already have Gentoo installed, and I'm going to make a LAMP-server. I have no previous experience with setting up a home server, and as suggested I need it for mail, web hosting, databases and file hosting.
> 
> 

 

mail: postfix and dovecot/courier

web hosting: apache is your friend

databases: mysql

file hosting: apache and/or webdav

 *Tuxido wrote:*   

> 
> 
> First of all, I'm going to host at least two simple websites that I'm going to make and maintain myself. I have no experience with programming PHP, Perl or Python, what are the advantages of each one, and is there any difference to which one I choose? (I have some programming experience in java, if that makes a difference)
> 
> 

 

if it's going to be for the website stick with php

good dokumentation and easy to learn

 *Tuxido wrote:*   

> 
> 
> What do I need to think about before going "live" with my box? What kind of security features do I need? Is there some kind of check list I should have for myself?
> 
> 

 

a firewall would be nice  :Smile: 

be paranoid

if you are going to put something online YOU are responsible for it

 *Tuxido wrote:*   

> 
> 
> How would I go about going live? (Online guide?) Do I need to have some sort of dns-server-thingy? Port forwarding? Magic?
> 
> 

 

if you don't have a static ip for your ISP you well need a dynamic-dns (dyndns.org) or something you prefer

if you have a firewall/router you will need to port forward every service you like to offer (e.g. TCP Port 80 for HTTP)

----------

## Tuxido

Okay, thanks. I'll probably be back with more questions as the arise.

----------

## timeBandit

Be sure to review your ISP's terms of service and ensure you are allowed to host a web server or any other kind of publicly-accessible server. Here in the States that's often not the case for residential (non-business) service.

----------

## Tuxido

The terms of service didn't mention it, so I assume it's okay. As far as I understand it's not a usual thing to do here.

Just to satisfy my curiosity, why aren't you usually allowed to in the states, why does it matter to the ISP what you use your line for?

----------

## DrekAlots

ISP's in the states charge more for business accounts. Therefore, you want a server and a static IP (or block of IP's), you'll have to pony up the dough. Most ISP's also limit the kind of content you can have on your website as well.

----------

## Hu

Typically, a server will be sending more traffic than it receives.  US ISPs lay out their network based on the idea that their customers will download substantially more than they upload.  Servers go against that design, and are therefore deemed undesirable.  This is also why US ISPs try so hard to disrupt peer-to-peer technologies: such technologies imposes substantially more upload demand than the ISPs have built their networks to handle.

----------

## Tuxido

When I redirect my browser to the server's ip I get Apaches standard "It Works".

I have emerged php and added 

```
-D php4 -D php5
```

to /etc/conf.d/apache2, restarted apache

and added the following to /var/www/localhost/htdocs/index.html:

```

<?php

ehco 'Child of Dunwhich Rise';

?>

```

"It works" appears, but not my php-hello world program.

----------

## Tuxido

My setup is this: 

MightyInternet --> Router (with static ip) --> Wireless Router --> Server

I've set the router to forward all traffic to port 80 to the wireless router, which I've set to forward all incoming traffic to the server's IP (also static).

How can I test if this works? People outside the network can't access it through my outside IP, and when I try my outside IP I go straight to the router's interface.

What to do, and how to test?

----------

## aztech

 *Tuxido wrote:*   

> When I redirect my browser to the server's ip I get Apaches standard "It Works".
> 
> I have emerged php and added 
> 
> ```
> ...

 

If you are running with the default PHP/Apache settings, you need to name all you PHP-files to *.php

Ex. index.php, instead of index.html

----------

## Tuxido

 *aztech wrote:*   

>  *Tuxido wrote:*   When I redirect my browser to the server's ip I get Apaches standard "It Works".
> 
> I have emerged php and added 
> 
> ```
> ...

 

That did the trick, thank you.

----------

## Tuxido

I understand that the line

Listen [port]

is used to tell apache which port to listen to, but where do I put ut?

I tried putting it in /etc/conf.d/apache2/httpd.conf after wchich I stopped seeing the "It works" page upon typing the ip and the ip followed by the portnumber (eg. 10.0.0.6:85)

And yes, I did restart apache after changing the the file.

----------

## timeBandit

 *Tuxido wrote:*   

> I understand that the line
> 
> Listen [port]
> 
> is used to tell apache which port to listen to, but where do I put ut? I tried putting it in /etc/conf.d/apache2/httpd.conf after wchich I stopped seeing the "It works" page....

 

1. On my systems, /etc/conf.d/apache2 is a file, not a directory, and httpd.conf lives in /etc/apache2/. These were set up some years ago and the locations may have changed, but it's worth checking.

2. I found the Listen directives in these files:/etc/apache2/vhosts.d/00_default_ssl_vhost.conf

/etc/apache2/vhosts.d/00_default_vhost.conf

----------

