Problems setting up mac OSX web sharing to host moodle locally

Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
Number of replies: 12
I’m trying to set a Moodle web server on an iMac G4 800Mhz (768MB RAM; 60GB HD) linked via built-in Ethernet to a D-Link DI-624 router. First, I reformatted the HD and transferred all my old files and applications to an external HD (which allows me to dismount or turn the disk off when connected and hence protect my files). Then, I installed Tiger with all available updates and setup Moodle. Even though the setup is running fine in my home network, I have not been able to properly set up access through the Internet. Thus far, I’ve done the following (not necessarily in this order): start Personal Web Sharing; setup the router to send requests to ports 80 and 21 to my iMac’s private IP (itself setup as a static IP address); setup a dynamic DNS service (both directly through www.no-ip.com using the router’s IP address [confirmed via www.whatismyip.com] and through the router’s DDNS setup page); checked firewall settings (both in mac preferences and within the router) to make sure that connections to the aforementioned ports were being allowed. I even tried the solution for Web Sharing Through Router (http://www.macosx.com/content/faq.php/q2742/Web-Sharing-Through-Router.html) using the router’s address within the network (i.e., 192.168.1.2). When trying to connect to the address (marchand.no-ip.org) from outside my network, I get the following message: Safari could not open the page “http://marchand.no-ip.org/” because the server stopped responding.
I would certainly appreciate any help on setting this up.
Average of ratings: -
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Tony Hursh -
Rosa, I just tried pinging marchand.no-ip.org and got back:

dh7-2:~ tonyhursh$ ping marchand.no-ip.org
PING marchand.no-ip.org (192.168.1.2): 56 data bytes


192.168.1.2 is a private IP address, not a public one. Make sure you're telling no-ip.com the public address from the ISP side of your router, then work from there.






In reply to Tony Hursh

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
Tony, Thanks for noting that problem. In fact, I originally had the router's external IP address (i.e., 65.23.194.168), but, trying every possible alternative, changed it to the address you note above. I just changed the settings back at no-ip.com. Please let me know if you can access the site (in fact, on a suggestion from MACOSX.com, I set the iMac's address to DMZ for the time being).
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Tony Hursh -
Okay, now I can ping your IP address, but don't see the web server.

Next thing: double-check that your router's "port forwarding" setting (what this is called varies somewhat depending on the brand) is indeed configured to forward external traffic on port 80 to the proper internal address.






In reply to Tony Hursh

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
The settings that are enabled in the Virtual Servers List are as follows:

Virtual Server FTP 192.168.0.101 TCP 21/21 always
Virtual Server HTTP 192.168.0.101 TCP 80/80 always

I had included others, but decided to disable them in the meantime. Thanks for your help.
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
When I run Apple's Network Utility and run a port scan for either the marchand.no-ip.org domain name or the public IP address 65.23.194.168, I get the same response:

Open TCP Port: 21 ftp
Open TCP Port: 23 telnet

Yet, I've set the D-Link utility to only open port 80 for a Virtual HTTP server. Is this an Apache problem? How can I fix it?
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Tony Hursh -
What happens if you browse to 192.168.0.101 from another machine on your LAN?

If you see the site (even if you get some errors) from within the LAN, the problem is most likely in your router config. If you don't see the site from within the LAN, the problem is almost certainly with the config on the machine running Moodle.



In reply to Tony Hursh

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
Yes, I do see the site within the LAN. However, what I thought was a static IP address (i.e., the router's) is not (today it shows as 64.237.133.87). Today I was told that the problem could be that, in fact, I may not have a static address through the DSL service I currently subscribed to. I tried connecting the computer directly to the DSL modem but could not get a connection, so that may be the problem [this was later confirmed by the strategy discussed below).

HELP! I just tried a different route and found a new problem. I disconnected the iMac from the router and connected to the Internet via dial-up. Using the IP address of that connection I was able to access the first page of the site (which I take to be the index), but when trying to move to other pages, the addresses would direct to "http://rosa-e-marchands-imac.local/" (e.g., for example, for the login page the address would read "http://rosa-e-marchands-imac.local/login/index.php"). I hope this latter problem can be easily fix through the terminal or some other programming alternative.

As for the other problem, I shall contact my DSL provider and explore other alternatives. Thanks for all the help.
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Tony Hursh -
I may not have a static address through the DSL service I currently subscribed to.

Rosa, this is exactly the problem that services like no-ip.com are designed to solve. Generally they provide some kind of client software that checks your IP address periodically and updates the DNS record to point to the new IP address.

Using the IP address of that connection I was able to access the first page of the site (which I take to be the index), but when trying to move to other pages, the addresses would direct to "http://rosa-e-marchands-imac.local/

That's because your computer doesn't have a real domain name.

There are a few ways to get around this problem, e.g., by editing the hosts file,  generally found at /etc/hosts on Unix-like systems such as OS X (Windows has a similar file that's location varies depending on the Windows version). If you add a hosts entry with your no-ip.com domain name and your LAN-side private IP address to all the computers on your LAN, you can make both computers on the public Internet (which get your public IP address from no-ip.com) and computers on your LAN (which get your private IP address from their hosts files) wind up on your Moodle server by using your no-ip.com domain name. This is a feasible way to go if you have only a few computers on your LAN, less feasible if you have a lot of them.

Is there some reason you're dead set on running your Moodle server on a home machine? You can get adequate hosting service for maybe $10/month, and not have to fool around with all this stuff. In addition, your users will get a much higher transfer speed than they'd get with an upstream DSL connection.




In reply to Tony Hursh

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
The reason for going through all the trouble: I wish to learn how to set this up. In fact, I could probably ask the university to set a server for me, but reliability would then be, regrettably, a bigger problem.

In any event, the serve issue has been solved; I got a new dynamic address (marchand.dyndns.org) and the first page is opening OK (not as well as in the original machine, but it opens). Now I would like to fix the problem with the local address. Would you be so kind as to tell me how to edit the /etc/hosts file? Thanks again for all the help.
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
Tony, I've decided to, once again, start from scratch. In my previous installation your tutorial (https://netfiles.uiuc.edu/hursh/www/installmoodleosx.html) has proven an invaluable tool, and I was wondering if there is any step (additional or modified) that I could take to avoid the pitfalls regarding outside access to the pages linked to the first (or index) one. In other words, what can I do during installation to get files "out" of the localhost folder (or "in" it, but accessible from anywhere. Also, I noticed that when accessing the site from outside my private LAN, some of the settings (including the theme) were not available (or, at least, viewable); is there any way to take steps during installation to avoid those problems? Greatly appreciate your help.
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rosa E. Marchand -
Got everything to work (finally!). Thanks for the help. While this is a work in progress, you can visit my moodle server at http://marchand.dyndns.org.
In reply to Rosa E. Marchand

Re: Problems setting up mac OSX web sharing to host moodle locally

by Rich Eng -
Hi, Rosa,

I am having the exact same problem trying to get the outside world to see my moodle site beyond the first page. All of the references point to "andrew-engs-computer.local" instead of the outside domain name or address (in this case it would be '70.226.62.243').

Would you be so kind as to tell me exactly what you did to make this work? Did you edit the "hosts" file? If so, what did you type in there?

Thanks!

Rich Eng