- Assign a static IP to your computer (with web server)
Each computer in a network has its own internal IP address. That IP address may be static, which means that it never changes. Or, as is likely if you share an Internet connection with other computers, the internal IP address may be assigned dynamically and may change from time to time.
Note: in a network configuration, the internal IP is not the same as the IP assigned by your ISP. The IP assigned by your ISP can be either static or dynamic.
When you are opening ports to allow incoming connections to your computer, your computer must be assigned a static internal IP address, to ensure that the incoming connections always go to the correct computer.
There are several steps:- See your current IP address
Find your current IP address and whether it is static or dynamic:
- Open Windows Start menu
- Select Run. Type: command and click OK.
- At the blinking cursor, type: ipconfig /all and press Enter.
- Look for these entries near the end of the list:
- Dhcp Enabled. No means your IP address is static. Yes means it is dynamic.
- IP Address. This is your current IP address.
- To exit, at the blinking cursor, type: exit and press Enter.
- Static, then make note of the IP address. You need the IP address when you open ports in your router or firewall.
- Dynamic, then assign a static IP address instead.
- Choose a static IP address
Choose an IP address, and collect other information needed in order to assign a static IP address to your computer.
- In your router administration program, find and remember this information:
- Router (Gateway) IP address
- Subnet Mask
- IP addresses of your DNS servers
- In your router administration program, find an IP address that can be assigned as a static IP. The address:
- Must not be one that might be assigned to someone as a dynamic address.
- Must not be one that has been assigned to another device (often these are the low numbers).
- Must be lower than the range of dynamic addresses.
- In your router administration program, find and remember this information:
- Assign the static IP address
To set a static IP address:- Open Windows Start menu.
- Open Control Panel.
- Classic view: Open Network Connections
Category view: Select Network and Internet Connections, and then Network Connections. - Double-click on your active LAN or Internet connection.
- Click Properties.
This opens the Local Area Connections Properties window. - In the General tab, highlight the Internet Protocol (TCP/IP) item, and click Properties. This opens the Internet Protocol (TCP/IP) Properties window.
- In the General tab, click Use the following IP address, and enter:
- IP address. The static IP address you want to assign to this computer.
- Subnet mask. Subnet mask used by your router.
- Default gateway. IP address of your router's default gateway.
- In Use the following DNS server addresses, enter all the IP addressses for the DNS servers your router uses.
- Click OK. Then:
- Click OK to close each window.
- Restart your computer.
- Then, check your IP address again, to make sure that the changes were applied.
- Configure Port Forwarding on your router
We need to forward all packets that are coming to port 80 (web server) to your machine. This is done through port forwarding.
This is done very easily by following steps.
- Login to you router
- Enable Port Forwarding (If there is a tick box)
- Go to Port Forwarding page and set Port 80 (Web Server) to be forwarded to your machine (Put your PC's IP there).
- Find your WAN IP
If you look up your IP address (such as http://www.ip-adress.com/), the IP you see is actually the IP of your router (WAN IP). When your friend accesses your website, you'll give him this IP. Having done all that, your friend should now be able to access your web page by going to his web browser on his machine and entering http://IP.address.of.your.computer (the same one you see when you go here ). - Assign a domain name to your IP
Since DSL users usually get a dynamic IP, you have to always give your IP to your friend to access your web page. There is anice solution to come up with this. You can assign a domain name to your IP with a service called DynDns.
After going through registration and email verification, finally you can see your domain is activated as below. Finally, download the DynDNS update client software and install it in your PC. Using an update client with your Dynamic DNS hostname allows you to make sure you can always reach your home network, because it makes sure that your hostname is always up-to-date with the latest IP address. The update client runs in the background, so once you have it properly configured you don't have to worry about it; you only need to remember your hostname to reach your files and services. - Check access to localhost is allowed through internet
In some cases we need to configure our web server to allow access to web server from internet.
For example, on Apache server, you may have to do the following steps (If those are not already configured).
- Edit file C:\www\vhosts\localhost\.htaccess
There will be these lines within:Comment all of them out by placing a # sign at beginning of each line.Code: Select all
order deny,allow deny from all allow from 127.0.0.1
- Edit file C:\www\Apache22\conf\extra\httpd-vhosts.conf
Find the first VirtualHost block... Which is the "localhost" block.
You will see lines:Code: Select all
<VirtualHost *:80> DocumentRoot "C:/www/vhosts/localhost/_" ServerName localhost ServerAlias 127.0.0.1
Update line 'ServerAlias 127.0.0.1' to 'ServerAlias 127.0.0.1 my.domain.com'
Note that you can add more domains and IP addresses [such as your LAN system IP] to this line.
Save file. Restart Apache.
The reason you have to make the changes to httpd-vhosts.conf to bind "localhost" to additional IP addresses is a technical one. There is a conflict with a default Virtual Host and the dynamic domains feature of the Suite. - Edit file C:\www\vhosts\localhost\.htaccess
How to access website hosted in localhost from internet
How to access website hosted in localhost from internet
Following steps will allow you to access a website hosted on your machine (localhost) from internet (no matter you have a ADSL modem that brings you a dynamic WAN IP).
Re: How to access website hosted in localhost from internet
the title sounds pretty interesting.... let me read in detail now
Re: How to access website hosted in localhost from internet
When Somebody Enters my WAN IP into their BROSWERS ADDRESS BAR they get an error saying :
When i enter MY WAN IP in my address bar i get redirected to my ROUTER Admin Panel !!
Please Help ME !!
Code: Select all
This Address may be temporarily down ...
Please Help ME !!
Re: How to access website hosted in localhost from internet
Foe me, it seems that you have not correctly setup port forwarding (Step 2). Can you check on that?
If you do not correctly forward port 80 (Web Server) to your machine, obviously you will expereince the issue you explained earlier.
If you do not correctly forward port 80 (Web Server) to your machine, obviously you will expereince the issue you explained earlier.
Re: How to access website hosted in localhost from internet
Actually , I had a Little Confusion ...Neo wrote:Foe me, it seems that you have not correctly setup port forwarding (Step 2). Can you check on that?
If you do not correctly forward port 80 (Web Server) to your machine, obviously you will expereince the issue you explained earlier.
I wanted to Ask U ...
I have a DHCP connection , So my Default Gateway is 192.168.1.1 // This is Shown in MY CMD //
If i Go to IP-ADDRESS.com , I get a Different IP // You Know U Are the ADMIN //
If enter Both of them in my Address Bar Both Take me to the Router Authentication Page ...
Which one should i login to and edit ?
I'm Using Window 7 + XAMPP !!
Thanks ...
Re: How to access website hosted in localhost from internet
If you want to forward port 80 to your web server, you will have to off the DHCP server on router and assign a static IP to your PC. Read the first post on that.I have a DHCP connection , So my Default Gateway is 192.168.1.1 // This is Shown in MY CMD //
If i Go to IP-ADDRESS.com , I get a Different IP
Use the LAN IP to login to the admin page since all WAN IPs are then transfered to your PC.If enter Both of them in my Address Bar Both Take me to the Router Authentication Page ...
Which one should i login to and edit ?
I recommend WAMP since I'm working with that for years now without any issue.
Re: How to access website hosted in localhost from internet
Thank You Very much my Website is up and Running on my IP ...
Can u tell me how can i configure my web mail , FTP .. etc.
Thank You !!
Can u tell me how can i configure my web mail , FTP .. etc.
Thank You !!
Re: How to access website hosted in localhost from internet
Download FileZilla Server and install.FTP
Then forward Port 21 (FTP port) to your PC.
If you need to use FTPS, then you will also have to forward ports 989 and 990.
Code: Select all
989 TCP UDP FTPS Protocol (data): FTP over TLS/SSL
990 TCP UDP FTPS Protocol (control): FTP over TLS/SSL
Since webmail is operated through port 80 (Web Server), you don't need to do port forwarding for this.web mail
However, you will have to find a mail server such as MDaemon. See http://www.altn.com/ for their products. They offer a free version for home users. See http://www.altn.com/Products/Free-Windows-Mail-Server/.
Hope that helps !
Re: How to access website hosted in localhost from internet
Okay ,Neo wrote:Download FileZilla Server and install.FTP
Then forward Port 21 (FTP port) to your PC.
If you need to use FTPS, then you will also have to forward ports 989 and 990.Code: Select all
989 TCP UDP FTPS Protocol (data): FTP over TLS/SSL 990 TCP UDP FTPS Protocol (control): FTP over TLS/SSL
Since webmail is operated through port 80 (Web Server), you don't need to do port forwarding for this.web mail
However, you will have to find a mail server such as MDaemon. See http://www.altn.com/ for their products. They offer a free version for home users. See http://www.altn.com/Products/Free-Windows-Mail-Server/.
Hope that helps !
I have downloaded FileZilla Server.
I have to use NAT to port forward.
So i entered a new entry :
Code: Select all
Name "FileZilla"
IP "192.168.1.11"
Input Port "21"
Output "21"
Connection Type "TCP"