简体   繁体   中英

cannot access my own moodle from public ip address

I have installed Moodle by a LAMP package (Linux, Apache, MySql and php) on Hyper-v and as far as I am inside the LAN everything is working fine and by entering the IP address 192.168.1.83 I can see the main page of Moodle. Since one week ago I have been trying to access the Moodle from outside LAN and checked other similar questions but I was not able and it has made me so disappointed :(

Can anybody share any experience with me, please?

It is good to mention that I have set up port forwarding on the router in order to forward :8010 to 192.168.1.83:80 and :8011 to 192.168.1.83:8080.

I also has changed wwwroot in the file config.php from localhost to http:192.168.1.83

I have inactivated firewall on Linux server which Moodle is located.

When I try :8010 on a browser from outside LAN, the address in the URL gets changed to 192.168.1.83 but there is an error like:

This site cannot be reached. 192.168.1.83 took too long to respond.

Has anybody had such an experience to give me any comment?

Thanks!

So when you try to access http://192.168.1.83:8010 , moodle returns an HTTP 303 which tells the browser that it should redirect another url, which is the one that you configure in moodle's config.php . Because your moodle config has the wwwroot configured to be http://192.168.1.83 , it sends that as the url to which your browser should redirect. So now your browser tries to load http://192.168.1.83 but because it does not have access to that LAN address, it is unable to connect.

What I believe would work is if you changed your wwwroot in config.php to http://192.168.1.83:8010 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM