Super basic: can't access files

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Super basic: can't access files

Postby danwoods » 16. September 2009 23:38

Hello, I'm trying to set up my first server and these are the components I have set up so far: XAMPP, the latest version of ubuntu desktop, under System>Administration>Network Tools when I preform a port scan port 80 comes back open to www, a domain name hosted with dyndns.com, and my wireless router connecting to dyndns.com. When I try to connect to the domain they gave me at dyndns.com into an external computer's browser it tries to connect to my localhost page. It says it can't, "establish a connection to the server" but the url changes to "http://localhost/musicneverstopped/index.php" which is where I'm trying to get to! So now, how do I get it to connect to the server? Where could mistakes lie?

also:
typing "addressIGotFromDyndns.com".com into mozzilla's url bar tries to access my local host

typing www. into mozzilla's url bar just returns "can't find the server"

Don't know if that's relevant, just adding information.

Also, when I use "addressIGotFromDyndns.com".com the favicon turns into the xampp favicon just for a second before I get "Firefox can't establish a connection to the server at localhost." and then changes into the exclamation point thingy...

Thanks to all in advance
danwoods
 
Posts: 3
Joined: 15. September 2009 14:10

Re: Super basic: can't access files

Postby Nobbie » 17. September 2009 11:54

danwoods wrote:Where could mistakes lie?


When installling youur "musicneverstopps" you surely have been asked for the host (domain) name, where you probably entered "localhost". If you would like to run that application from outside, you must not enter "localhost" there, but instead the dyndns domain name. Obviously, the software triggers a redirect to the specified host, which fails in case of "localhost" when running from outside.

You also should supply a valid virtualhost, which points to the LAN IP of the network adapter and where servername is you dyndns domain (and restart Apache after). Example for httpd-vhosts.conf:

Code: Select all
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot /opt/lampp/htdocs
...
</VirtualHost>

<VirtualHost 192.162.0.10>
ServerName yourdomain.dyndns.org
DocumentRoot /opt/lampp/htdocs
...
</VirtualHost>


where 192.162.0.10 is your servers LAN IP (same as the port forwarding for port 80 in your router)
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Super basic: can't access files

Postby danwoods » 17. September 2009 12:53

Thanks Nobbie. I didn't 'install' musicneversopped, just copied the files over from where I had been developing locally on a development server on my laptop. I've been reading about virtualhost, let me read some more and I'll try what you suggest. Thanks for the reply...
danwoods
 
Posts: 3
Joined: 15. September 2009 14:10

Re: Super basic: can't access files

Postby Axanon » 18. September 2009 23:33

Edit your hosts file.. something like this:
Code: Select all
sudo gedit /etc/hosts


You will see something like this:
Code: Select all
127.0.0.1   localhost
127.0.1.1   yourcomputername

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Add a line to it like this: (You need to know your IP address on your router, I used 192.168.0.10 as an example, replace it with your address)
Code: Select all
192.168.0.10 yourcomputername theaddress.dyndns.gaveyou


You can also have multiple hostnames (like DynDNS) tied to that IP address. You just add them as needed:
Code: Select all
192.168.0.10 yourcomputername yourdns1.homeip.com yourdns2.homeip.com yourdns3.homeip.com


For more than one address make sure you edit your http-vhosts.conf file properly. Also as a note, anybody on your network who wants to access your sever will need to edit their hosts file the same way.

The reason you are having trouble getting to the dyndns address is because your router has no way to access your outside IP address from the local (internal) network. There's a real technical reason behind this... I'm just not geek enough to remember :P.. hopefully this helps :).
Axanon
 
Posts: 7
Joined: 15. September 2009 16:36

Re: Super basic: can't access files

Postby danwoods » 22. September 2009 23:17

When entering the addy dyndns.com gave me should I prepend it with http:// or www. ?
danwoods
 
Posts: 3
Joined: 15. September 2009 14:10

Re: Super basic: can't access files

Postby Nobbie » 23. September 2009 09:42

danwoods wrote:When entering the addy dyndns.com gave me should I prepend it with http:// or www. ?


No, dont prepend http://

Simply enter what you called "addressIGotFromDyndns.com" above.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 70 guests