To run a web server (or any server) from your home network and publishing your website to the wider world you will need the following:
In order to ensure that your router forwards traffic to your web server correctly you must ensure that the web server runs on a machine in your network with a static IP address. You must ensure that your IP Address is set to a static value. This must be outside the range which your router uses to allocate dhcp addresses (with the Linksys Router on default settings, this means the IP address should not be in the range 192.168.1.100 to 192.168.1.149 (this information is available on the main setup page - usually at 192.168.1.1). If your router runs on 192.168.1.1, you might consider setting your web server PC to the IP address 192.168.1.2. These instructions show how to do this:
If your router offers DNS (as the Linksys one does):
Use route to discover your default gateway (in the windows instructions above we guessed). The output will be something like this:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 loopback * 255.0.0.0 U 0 0 0 lo default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
This tells us that the default gateway is 192.168.1.1 (as we used above in the windows instructions)
Set the computer's IP address, subnet mask and gateway in /etc/conf.d/net using the following (for IP address 192.168.1.2, subnet mask 255.255.255.0 and gateway address 192.168.1.1):
config_eth0=( "192.168.1.2 netmask 255.255.255.0" ) routes_eth0=( "default gw 192.168.1.1" )
To add your DNS server (presuming your router runs DNS on 192.168.1.1), open /etc/resolv.conf and edit it so that it reads the following:
# Generated by dhcpcd for interface eth0 nameserver 192.168.1.1 domain homenetwork
Now reboot and move to set up port forwarding on your router.
(these instructions were adapted from the Gentoo Wiki here and here.
Now you will need to set up port forwarding on your router.