PDA

View Full Version : apache 2 problems


3dcandy
January 21st, 2008, 11:49 AM
Hi all,
I have a problem with my apache setup. I have a server setup called homeserver, which is perfectly accessable over my lan. I have set up no-ip which works fine, I can access the server, but any sites I serve which have css styles referenced as homeserver don't work....

Any ideas guys and gals? I have come from windows and I had similiar problems there too

thanks in advance

Ade

:)

cdenley
January 21st, 2008, 03:33 PM
I'm guessing that what you mean is you have a line like this in your html:


<LINK href="http://homeserver/style.css" rel="stylesheet" type="text/css">


The url given for the css file must be accessible from the user's computer. Obviously, if someone's browser sees this link, it won't know where to find a server named "homeserver". You should change this to a domain name that resolves to your IP (homeserver.no-ip.com?), or better yet, use a relative path so it will work regardless of what domain you are using.


<LINK href="style.css" rel="stylesheet" type="text/css">

3dcandy
January 22nd, 2008, 04:57 AM
cheers, that was what I was thinking....
problem is, how do I go about changing that as it's generated by a script?
I need the name to be visible on my lan too if possible...

cdenley
January 22nd, 2008, 10:03 AM
You can edit the script which generates that line of html, or you can change the homeserver to your no-ip one.

I need the name to be visible on my lan too
Which name are you referring to? If you want your LAN computers to resolve homeserver to your LAN server, you can:
-edit each computers /etc/hosts file (c:\windows\system32\drivers\etc\hosts for windows)
-set up your own dns server

If you want your LAN computers to resolve homeserver.no-ip.com, you can:
-any of the above
-configure your router to route connections from the LAN to it's WAN IP back to the LAN server if configured for port forwarding, if such an option is available

3dcandy
January 22nd, 2008, 03:53 PM
Right, I would like homeserver to be visible on the lan, so typing in http://homeserver/ would serve the default page, which it does fine now.

However, I would like the default page to be served when I goto http://3dcandy.no-ip.com which it also does correctly. However, scripts assume the server name is homeserver, so when I use them via no-ip they fail because the viewing computer can't resolve homeserver.

I could log in via the no-ip address and setup the scripts which should work I think, will try that shortly. Is there another way, or shall I set up a dns server, which is a new thing for me to do, and would that work via no-ip.com!?!?!

Or I could try and work the scripts so they use relative links...