LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2011, 08:55 AM   #1
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Rep: Reputation: Disabled
website showing ipaddress


i created a apache web server and hosted website in it , website is working fine but when resolving it shows ip address.
Please tell me how i can avoid it.
these are the details:
Server : RHEL5
port forwarding : port 80 has been forwarded.
Server is having public ip address.
 
Old 10-03-2011, 09:07 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
In your index.html file you put a <title> in the <head> section. Something like
Code:
<head>
<title>This is displayed instead of the IP address</title>
</head>
Might be useful to find a HTML tutorial.

Or, in your httpd.conf file give the server a name:
Code:
ServerName name.what:80
Hope this helps some.

Last edited by tronayne; 10-03-2011 at 09:10 AM.
 
Old 10-03-2011, 03:22 PM   #3
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
i have done all u suggested but nothing has changed ,
when i type my website name from browser (cypherlogics.com) , and press enter it shows the content but in address bar it shows ip address instead of website name
 
Old 10-03-2011, 04:29 PM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
Well, yup, it does show the address.

Your page source is
Code:
<html>
<title> Welcome to cypherlogis.com </title>
<body> 
<font size=7>
<b>THIS SITE IS UNDER CONSTRUCTION</b>
</body>
</html>
You're missing
Code:
<html>
<header>
<title> Welcome to cypherlogis.com </title>
</header>
Did you stop and restart HTTPD after you added
Code:
ServerName cypherlogis.com:80
Anytime you make a change in your httpd.conf file, you need to stop and restart the daemon.

Hope the helps some.
 
Old 10-03-2011, 05:40 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,810

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
Web browsers display the title in a window’s title bar when the window is open, and in the task bar when the window is minimized. The title has nothing to do with the URL but severname is most likely the problem.

Check your httpd.conf. My first guess is if you have the directive UseCanonicalName set to on the URL will be whatever is set for the servername. If off whatever is supplied by the client. If no server name is defined the default AFAIK is the IP address.

Last edited by michaelk; 10-03-2011 at 06:07 PM.
 
Old 10-04-2011, 08:04 AM   #6
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
Here's the default ServerName section of httpd.conf:
Code:
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
You probably should set that as
Code:
ServerName www.cypherlogics.com:80
It seems that you do have a registered DNS name (I can get to your server with http://cypherlogics.com) and when it connects I see the IP address).

As michaelk suggests, the default setting for UseCanonicalName is
Code:
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client.  When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off
You probably want to check that and set it On if it's not.

Don't forget to stop and restart HTTPD (the daemon) -- and, when you connect you might want to clear your browser's cache (or "force reload the page"); sometimes the browser cache can trip you up even though you've fixed the problem you won't see it without a force reload or cache clear.

Hope this helps some.
 
Old 10-04-2011, 12:32 PM   #7
mlnm
Member
 
Registered: Jun 2011
Posts: 96

Original Poster
Rep: Reputation: Disabled
No friends i tried putting usecononicaName but did'nt work out , i tried changing my html file also but no solution.
i already mentioned that i have port forwarded 80 in my router i think it is the problem but without port forwarding site will not open because the router has a dhcp pool for local systems.
what i mean is my router has public ip but my servers address is dhcp ipaddress.
 
  


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
[SOLVED] Screen not showing on laptop but showing on projector when connected someshpr Linux - General 3 04-18-2011 04:58 PM
IPaddress of wireless pangcake Linux - Newbie 2 07-19-2008 03:49 PM
IPaddress packet xeon123 Linux - Networking 1 03-25-2007 07:01 PM
getting the location through the ipaddress deepclutch Linux - Networking 2 02-11-2007 01:10 AM
ipaddress and hostname groverrajiv Linux - Networking 1 04-24-2004 08:29 AM


All times are GMT -5. The time now is 08:21 AM.

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