LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 01-18-2013, 04:21 AM   #1
meows
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: Disabled
Question 3 web domains one displays local but web pages do not show on internet


Nightmare with 3 web domains one displays local but web pages do not show on internet

I ran the suggested program getinfo.sh network and the results are at PasteBin

After 2 weeks and a lot of reading I have One site loading on the localhost but the other 2 web sites error out. None show on the internet.
Centos 5.8 is what I installed on a standalone system.

I have a block of 5 IP addresses with 3 that I have domain names for. I just renewed the base IP address for another 5 years.
I need to run the 3 domains on Centos5.8, I also have 3 other computers. 2 XP boxes, one a laptop and a Win7 box.
I did have 78ez.com running from a win95 then a XP and finally win7 all with Apache. but the attacks killed me so I now need more security so I put centos5.8 on a separate computer.

I can pull files to/from the windows boxes and Centos 5.8
What I need to know is how to get these web sites to show on the internet please.
AND/OR if anyone knows the
1.basic setup needed to run a Linux web-server
I think way too much software is installed. Granted I do not know what most of it is and internet research for 258 programs is mind numbing at best.
2. when your web pages show on local-host but not on the internet what is the most likely reason. Or is there a step by step resource you can follow to trouble shoot the reason?
I did add to IPTABLES.conf
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
the boot log says it can't find the command?

nslookup 78ez.com
Server: home
Address: 192.168.0.1
Non-authoritative answer:
Name: 78ez.com
Address: 75.160.145.121
yet I have the dns but do not know how to set them up
75.160.145.124 78hosting.com ## Name servers 205.178.190.9 - 206.188.198.9
75.160.145.122 couch-potato-sales.com ##Name servers ns57.worldnic.com 205.178.190.29 ns58.worldnic.com 206.188.198.29
78ez.com 75.160.145.121
Domain servers in listed order:
AUTHNS1.MPLS.QWEST.NET 63.231.205.1 63.231.205.1 63.224.0/12
AUTHNS2.DNVR.QWEST.NET 206.196.128.12
AUTHNS3.STTL.QWEST.NET 206.81.192.11

ipconfig
Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : gateway.2wire.net
Link-local IPv6 Address . . . . . : fe80::258f:1440:3eab:cf8a%11
IPv4 Address. . . . . . . . . . . : 192.168.0.64
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1

Tunnel adapter isatap.gateway.2wire.net:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : gateway.2wire.net

Tunnel adapter Teredo Tunneling Pseudo-Interface:

Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e76:1c8e:f02:b45f:6e81
Link-local IPv6 Address . . . . . : fe80::1c8e:f02:b45f:6e81%12
Default Gateway . . . . . . . . . : ::
Hosts file
127.0.0.1 www.couch-potato-sales.com www localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

192.168.0.1 www.78ez.com
192.168.0.1 www.78ezhosting.com
192.168.0.1 www.couch-potato-sales.com
75.160.145.121 www.78ez.com
75.160.145.124 www.78ezhosting.com## Name servers 205.178.190.9 - 206.188.198.9
75.160.145.122 mail.couch-potato-sales.com
75.160.145.121 78ez.com
75.160.145.121 EZHOSTING.78ez.com
75.160.145.121 gaming.78ez.com
75.160.145.121 money.78ez.com
75.160.145.121 recipes.78ez.com
75.160.145.121 smtp.78ez.com
75.160.145.121 waterworks.78ez.com

75.160.145.121 sub.78ez.com # Older PHP server
75.160.145.121 host.78ez.com
75.160.145.122 www.couch-potato-sales.com##Name servers ns57.worldnic.com 205.178.190.29 ns58.worldnic.com 206.188.198.29


Reading another post I found this information is valuable.
ifcfg-eth0
# NVIDIA Corporation MCP61 Ethernet
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=20:CF:30:6F:05:52
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes


[root@www ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 20:CF:30:6F:05:52
inet addr:192.168.0.65 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:52543 errors:0 dropped:0 overruns:0 frame:0
TX packets:30538 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:63597339 (60.6 MiB) TX bytes:2718484 (2.5 MiB)
Interrupt:50 Base address:0xa000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3803 errors:0 dropped:0 overruns:0 frame:0
TX packets:3803 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3804455 (3.6 MiB) TX bytes:3804455 (3.6 MiB)

[root@www ~]#



APACHE short Config

http://pastebin.com/xDGNqBCJ
Code:
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile "/var/run/httpd.pid"
TimeOut 200
KeepAlive on
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 50
MaxRequestsPerChild 50
</IfModule>
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25 
MaxRequestsPerChild  0
</IfModule>
# also tried Listen 75.160.145.121:80
# also tried Listen 75.160.145.122:80
# also tried Listen 75.160.145.124:80
Listen *:80

Include conf.d/*.conf

ServerAdmin meows@techie.com
ServerName localhost
UseCanonicalName off
DocumentRoot "/var/www/html"
DirectoryIndex index.html
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>
##################### VIRTUAL HOSTS ################################

#====== DEFAULT VIRTUAL HOST ===========
# LOCALHOST
<VirtualHost _default_:80>
   ServerName localhost
   DocumentRoot "/var/www/html/"
</VirtualHost>


# Virtual host 1
# also tried <VirtualHost 75.160.145.121>
<VirtualHost *:80>
 	ServerAdmin meows@techie.com
 	ServerName www.xxxxx.com
	DirectoryIndex index.php index.html index.htm index.shtml 
	<Directory "/var/www/html/">
		Options all
	 	AllowOverride all
		Allow from all
		Deny from all
		Order Deny,Allow
	</Directory> 
 	LogLevel debug
 	HostNameLookups on
</VirtualHost>

# Virtual host 2
# also tried <VirtualHost 75.160.145.122>
<VirtualHost *:80>
DocumentRoot "/var/www/html/xxx/" 
ServerName www.xxx.com
DirectoryIndex index.php index.html index.php index.htm index.shtml 
 	ErrorLog logs/xx/error_log
 	ServerAdmin meows@techie.com
	TransferLog logs/xx/access_log
	<Directory "/var/www/html/xxx/">
		Options all
		
	 	AllowOverride all
 		Allow from all
		Deny from all
		Order Deny,Allow
	</Directory> 
 	TransferLog logs/xxxez/access_log
 	ErrorLog logs/xxxez/error_log
 	LogLevel debug
 
</VirtualHost>

# also tried  Virtual host www.xxxezhosting.com
# also tried <VirtualHost 75.160.145.124>
#<VirtualHost xxxx>
<VirtualHost *:80>
ServerName www.xxxezhosting.com
 	DocumentRoot "/var/www/html/xxxhosting/" 
 	ErrorLog logs/xxxhosting/error_log
 	ServerAdmin meows@techie.com
  	TransferLog logs/xxxhosting/access_log
	DirectoryIndex index.php index.html index.htm index.shtml 
	<Directory "/var/www/html/xxxhosting/">
		Options all
	 	AllowOverride all
 		Allow from all
		Deny from all
		Order Deny,Allow
	</Directory> 
 	LogLevel debug
</VirtualHost>

<Directory "/">
        Options FollowSymLinks
        AllowOverride None
</Directory>
<Directory "/var/www/html">
        Options Indexes Includes FollowSymLinks
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>

<Directory "/var/www/icons">
        Options Indexes MultiViews
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>

<Directory "/var/www/cgi-bin">
        Options ExecCGI
        AllowOverride None
        Allow from all
        Order allow,deny
</Directory>
Many Thanks for your consideration of help.

Last edited by meows; 01-18-2013 at 04:39 AM. Reason: adding config information
 
Old 01-19-2013, 02:11 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,985

Rep: Reputation: Disabled
From what I understand, you have a web server with the private (non-routeable) IP address 192.168.0.65, and you wish this server to serve web pages for three different domains, and for these sites to be available from the Internet.

This is what you need to do:
  1. Install the necessary web server software on the server

    You've done this already. As for exaxtly what software you need, the answer is "it depends". You will always need the web server siftware itself, such as Apache, LigHTTPD or Nginx. In addition, you may need to install languages like PHP, Python or Perl if your web pages uses server side scripting (most do), and perhaps a database engine like PostgreSQL or MySQL, if the scripts make use of a database.

    I quite agree with your assessment that your CentOS server probably has a lot of unneeded software installed, and that the number of installed packages should be kept at a minimum for maintenance and security reasons.

  2. Configure your web server to serve the sites in question

    You've done this too, using the Apache VirtualHost directive. Whenever a client requests a web page from a server, it specifies both the file name and the site name. This is how a web server can serve multiple sites using a single IP address.

  3. Make the server accessible for Internet clients

    Your server needs a public (routeable) IP address for this to work. You can either connect the server directly to a network using public IP addresses, or you can forward a port from a router/server with such an address.

    According to the information you've posted, your server has a private IP address. This is fine, as long as you can forward ports 80 and 443 from a host or router that has the desired public IP address.

  4. Make an DNS A record that points from the server name (typically www.domain.com or somesuch) to the IP address of the server

    You need to add this record to the authoritative DNS server for the domain(s) in question. This is most likely a DNS server run by the registrar with whom you registered your domain. The A record must point to a public IP address. If your server has a private IP address and you wish to forward port 80 from a router, the A record should point to tha IP address of that router.

    I see that for testing purposes, you've added the domain name to the hosts file of a local PC and pointed it at the private IP address of the server. This makes it possible to perform necessary testing without exposing the server to the Internet, which is great, but as mentioned, you also need to add a record to the domain zone on the public Internet.
If you do this, your sites should be visible to anyone on the Internet.

Quote:
Originally Posted by meows View Post
2. when your web pages show on local-host but not on the internet what is the most likely reason. Or is there a step by step resource you can follow to trouble shoot the reason?
Missing DNS records or firewall/port forwarding issues. Here are some tests you can run:

1. Run nslookup www.yourdomain.com authoritative.dns.server

This command works on both Linux and Windows. "www.yourdomain.com" should obviously be replaced with the name you wish to test, while "authoritative.dns.server" should be the name or IP address of the DNS server responsible for that domain. (You can find the IP address of that server with nslookup -q=NS domain.name - note that the "www" part should not be included, just the domain.)

The command should return the public IP address of your server (or the server/router doing the port forwarding). It should NOT return a private IP address.

2. Test the availability of the HTTP/HTTPS service (port 80 and 443 respectively) using an external service like ShieldsUP!

If run from the web server, the test should report ports 80 and 443 as open. If not, your server can't be accessed from the Internet.

Quote:
Originally Posted by meows View Post
I did add to IPTABLES.conf
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 443 -j ACCEPT
the boot log says it can't find the command?
I'm not sure what iptables.conf on CentOS is supposed to contain, but according to the CentOS documentation you can add the necessary rules to the firewall from the command line and then run service iptables save.

Quote:
Originally Posted by meows View Post
Code:
# also tried Listen 75.160.145.121:80
# also tried Listen 75.160.145.122:80
# also tried Listen 75.160.145.124:80
Listen *:80
You need to specify an address that is actually assigned to the server in question. Unless one of the network interfaces on the server has one of those IP addresses, it won't work.

If your server is to have a private IP (as it has now), you could enter that IP address or just leave the asterisk.

Quote:
Originally Posted by meows View Post
Code:
# also tried  Virtual host www.xxxezhosting.com
# also tried <VirtualHost 75.160.145.124>
#<VirtualHost xxxx>
<VirtualHost *:80>
ServerName www.xxxezhosting.com
 	DocumentRoot "/var/www/html/xxxhosting/" 
 	ErrorLog logs/xxxhosting/error_log
 	ServerAdmin meows@techie.com
  	TransferLog logs/xxxhosting/access_log
	DirectoryIndex index.php index.html index.htm index.shtml 
	<Directory "/var/www/html/xxxhosting/">
		Options all
	 	AllowOverride all
 		Allow from all
		Deny from all
		Order Deny,Allow
	</Directory> 
 	LogLevel debug
</VirtualHost>
This should cause the server to accept requests for web pages in the site "www.xxxezhosting.com" and look for those pages in the /var/www/html/xxxhosting directory.

BTW, you have another virtual host serving pages from the /var/www/html directory. Unless you specifically want it for some reason, it probably isn't a great idea to have one site serving pages from a subdirectory of another site.

Last edited by Ser Olmy; 01-19-2013 at 02:14 PM.
 
1 members found this post helpful.
  


Reply

Tags
apache2, webserver


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 do I get local htdocs images to show on a web page. Usalabs Linux - Server 14 07-10-2012 08:17 PM
I cant open internet web pages. tirengarfio Linux - Networking 2 08-01-2009 09:48 AM
I can log on to the internet but not certain web pages. wbond_6489 Linux - Wireless Networking 2 06-08-2006 10:10 AM
ADSL Router Web configuration pages appears instead of Personal Web Server Pages procyon Linux - Networking 4 12-20-2004 05:44 PM
Can't access Linux web server web pages from LAN client jaydave Linux - Networking 4 03-16-2003 02:38 AM


All times are GMT -5. The time now is 09:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration