Question: I have created an ftp server using proftpd on my computer running Ubuntu Server. This ftp is currently accessible using the ip [192.168.x.x] and I have setup Portforwarding from port 21. My question is more than likely very basic but - how can i make a .html (website) accessible via a domain name (www.example.com).

Additional Info - I already have a domain registered at 123 reg and have setup the DNS to point to my ip.

Thanks In Advanced,
Matt

Answer: 
Assuming you already have Apache2 installed, you'll need to forward port 80 to your local IP address also.

On the server - you'll need to create a vhost file in /etc/apache2/sites-available/dummy-host.example.com. Of course, you'll need to replace dummy-host.example.com with your domain name and the DocumentRoot with the actual path to the appropriate folder in your FTP user's directory. It'll contain something similar to the following

```
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "/var/log/apache2/dummy-host.example.com-error_log"
    CustomLog "/var/log/apache2/dummy-host.example.com-access_log" common
</VirtualHost>

```

Then, you'll need to symlink it from the sites-enabled directory

```
sudo ln -s ../sites-available/dummy-host.example.com /etc/apache2/sites-enabled/dummy-host.example.com

```

Then - restart apache

```
sudo service apache2 restart

```
First you need a routeable IP address. Your 192.168.x.x address is an internal address on your local network. To serve on the Internet (have public DNS point to your server) you need a permanent IP address. Some ISPs will provide you one upon request or for a small monthly service fee, others will not. Call your ISP and ask them for a permanent IP address. If you get one, then you'll need to configure an A record for your DNS server and set up your router/firewall to forward traffic on the public network to your internal server. Most web pages and FTP servers on the internet are run from a web hosting service which handles most of this stuff for you.