LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2013, 12:27 AM   #1
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Rep: Reputation: Disabled
Exclamation Apache2 website not public - confused on set up


Hi, I have created and installed LAMP and on my apache2 webserver I have trouble with the whole virtualhost and things I need to change and also creating a static-IP and what a LAN port is and how someone would go about port forwarding on a westell A90-750060-07
 
Old 07-12-2013, 01:07 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,477

Rep: Reputation: Disabled
That's actually a whole range of questions. I'll start with the IP related ones.

About getting a static IP address: First of all, you don't "create" a static IP, your ISP allocates one for you.

The idea is that you have a domain name for your site ("www.somedomain.com") and it points to an IP address on the Internet. If you're a private broadband customer, chances are your ISP has given you a dynamically allocated address. This means that if your router is rebooted, it may come back with a different address. Your previous address may then be given to another customer.

This is a problem if the domain name still points to your previous address, which it normally will. Getting a static, public IP on your router eliminates this problem, but most ISP's charge extra for this service.

(Strictly speaking, you don't need a static address if you register your domain with dyndns.org, no-ip.com or another provider of a dynamic DNS service. Instead, you install a small program on your server, and it will update the domain host record whenever your public IP address changes. It's not quite as good as having a fixed IP address, but it may suffice for a small, private web site.

About port forwarding: Since users on the Internet will be connecting to your public IP address, which technically is allocated to your router, while the web site resides on your server with another, internal IP address, you need to set up "port forwarding".

Web traffic (HTTP and HTTPS) use the TCP protocol with specific port numbers (80 and 443 to be exact), and luckily it is possible to tell the router to forward incoming traffic to these ports to a server on the inside.

I wasn't able to find specific instructions for your router, but here's a guide for the Westel A90-750015-07. Perhaps your model is similar.

One thing about forwarding ports 80 and 443: Most routers use at least one of these ports for their built-in web-based management interface, and may not permit you to forward the port unless you first change the port of the internal web server. In that case, you should look for an option to do this, and select a port in the "high" range (between 1024 and 65535).

Once this is done, you will need to specify that port number when you connect to the router's web interface. For isntance, if your router has the internal IP address 192.168.1.1 and you move the web interface to port 8000, you will need to type "http://192.168.1.1:8000" to log in to the router.

See if you can get the port forwarding to work first. You can use an external port probing service like this to see if the port is open.
 
Old 07-12-2013, 09:57 AM   #3
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
That's actually a whole range of questions. I'll start with the IP related ones.

About getting a static IP address: First of all, you don't "create" a static IP, your ISP allocates one for you.

The idea is that you have a domain name for your site ("www.somedomain.com") and it points to an IP address on the Internet. If you're a private broadband customer, chances are your ISP has given you a dynamically allocated address. This means that if your router is rebooted, it may come back with a different address. Your previous address may then be given to another customer.

This is a problem if the domain name still points to your previous address, which it normally will. Getting a static, public IP on your router eliminates this problem, but most ISP's charge extra for this service.

(Strictly speaking, you don't need a static address if you register your domain with dyndns.org, no-ip.com or another provider of a dynamic DNS service. Instead, you install a small program on your server, and it will update the domain host record whenever your public IP address changes. It's not quite as good as having a fixed IP address, but it may suffice for a small, private web site.

About port forwarding: Since users on the Internet will be connecting to your public IP address, which technically is allocated to your router, while the web site resides on your server with another, internal IP address, you need to set up "port forwarding".

Web traffic (HTTP and HTTPS) use the TCP protocol with specific port numbers (80 and 443 to be exact), and luckily it is possible to tell the router to forward incoming traffic to these ports to a server on the inside.

I wasn't able to find specific instructions for your router, but here's a guide for the Westel A90-750015-07. Perhaps your model is similar.

One thing about forwarding ports 80 and 443: Most routers use at least one of these ports for their built-in web-based management interface, and may not permit you to forward the port unless you first change the port of the internal web server. In that case, you should look for an option to do this, and select a port in the "high" range (between 1024 and 65535).

Once this is done, you will need to specify that port number when you connect to the router's web interface. For isntance, if your router has the internal IP address 192.168.1.1 and you move the web interface to port 8000, you will need to type "http://192.168.1.1:8000" to log in to the router.

See if you can get the port forwarding to work first. You can use an external port probing service like this to see if the port is open.


Alright thank you so much for this I am glad there are still people willing to help.....This post explained a lot to me but I have a few questions to get it up and running......
  • What ports do I forward? 80? If not how can I tell which to use?
  • How do I set it so when people enter my domain, it is sent to my public IP and forwarded to my private.........So basically how does it know when someone type in the URL to go to my public IP(which would then get forwarded)
  • And what(most confusing part) do I have to put in apache2's VirtualHost configs and other things like the httpd.conf and the default.com in te Sites-Available section
 
Old 07-12-2013, 10:27 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,477

Rep: Reputation: Disabled
Quote:
Originally Posted by bengalman211 View Post
  • What ports do I forward? 80? If not how can I tell which to use?
You forward port 80 if your website is to use regular, unencrypted web traffic (http://www.yoursite.com). If you're going to use HTTPS (https://wwww.your-secure-site.com), port 443 needs to be forwarded.

You can theoretically use any port, but if you use ports other than 80 for HTTP or 443 for HTTPS, the users will have to enter the port number manually in their browsers (http://www.alternative-port.com:2000).

Quote:
Originally Posted by bengalman211 View Post
  • How do I set it so when people enter my domain, it is sent to my public IP and forwarded to my private.........So basically how does it know when someone type in the URL to go to my public IP(which would then get forwarded)
DNS takes care of that. You need to register (buy) a domain name, and then create (or have the registrar create) a so-called "A record", a DNS record pointing from your server name to your public IP address.

Quote:
Originally Posted by bengalman211 View Post
  • And what(most confusing part) do I have to put in apache2's VirtualHost configs and other things like the httpd.conf and the default.com in te Sites-Available section
Virtual hosts are nothing but instructions telling the web server "if the client asks for a web site called such-an-such, serve files from this particular directory". You can serve multiple web sites with different names with the same web server behind the same public IP address.

The exact steps to configure a VirtualHost depends on the web server. You are using Apache, which is by far the most common web server, so there's no shortage of tutorials. Here's an example of an extremely simple VirtualHost definition:
Code:
<VirtualHost *:80>
        Servername www.mysite.com
        DocumentRoot "/var/www/htdocs/www.mysite.com/"
</VirtualHost>
What it says, is: "Bind to all IP addresses (the asterisk), and use port 80. This web site is called www.mysite.com, and the html files are in the /var/www/htdocs/www.mysite.com directory."
 
Old 07-12-2013, 11:18 AM   #5
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
And when I port forward it asks me which LAN IP I want to use for it...would that be my laptops internal ip or my routers internal ip

192.168.200.X (router)

192.168.200.XXX (laptop)
 
Old 07-12-2013, 11:19 AM   #6
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
It also asks me for a LAN port? What would I put there?
 
Old 07-12-2013, 11:34 AM   #7
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Here is what my first port forwarding screen looks like
 
Old 07-12-2013, 11:37 AM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,477

Rep: Reputation: Disabled
The "LAN IP" is the IP address of your webserver. If the server is running on your laptop, you enter the laptop's IP address.

The "LAN port" is the TCP port number the web server is running on. It is possible to forward a port on the router to an entirely different port number on an internal server, but in your case the port number is the same as on the router, 80.
 
Old 07-12-2013, 12:04 PM   #9
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
Ok I think I did everything right....but for some reason it still won't come up when people(not on my internet) type www.mydomain.com as a URL :O


Here is what the port forward looks like
 
Old 07-12-2013, 12:07 PM   #10
bengalman211
Member
 
Registered: Jul 2013
Location: Ohio, USA
Distribution: Linux
Posts: 36

Original Poster
Rep: Reputation: Disabled
---------------nevermind

Last edited by bengalman211; 07-12-2013 at 12:29 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change permissions for public access to website? sergioq Linux - Server 1 03-03-2012 10:42 PM
Apache2 serving documents that are not for public access lhiggie Linux - Enterprise 3 05-27-2010 08:35 AM
How to Stop Website theft with Apache2 lucastic Linux - Security 4 08-27-2007 08:08 PM
Making a website public IanThePetRock Linux - General 33 08-01-2005 03:41 PM
Managing website and Apache2 gfx Linux - General 5 06-02-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration