localhost refused to connect

localhost refused to connect

by Abu Ali -
Number of replies: 5

hi dear moodle experts;

i have installed a new server with ubuntu 18.X.X and php7.2 and mysql. after configuration of LAMP package all things going to be smooth. i have tried to access a default php file from client computer and it was working fine.

after this i have installed Moodle  package on the server and installation was going smooth and installed the moodle. After installation i checked everything is fine on server computer but it shows me an error while accessing it to client computer.  The error is like this " localhost refused to connect". please help me what i have to do to remove the error .

Average of ratings: -
In reply to Abu Ali

Re: localhost refused to connect

by James Steerpike -
If you were trying to access the localhost from the client computer, it will look for a webserver on the client machine, not on the server. Your server needs to be set up to point to an IP address - something like 192.168.0.100 if you are on a local network only. Check your IP on the server with the ifconfig command.
Next check your services are running on the server.
sudo service mysql status
sudo service apache2 status
If they are not running, substitute start for status in the command to get them going.
In reply to James Steerpike

Re: localhost refused to connect

by Abu Ali -

Thanks dear James;

i am accessing my server through ip address that is like that 192.168.1.138. i checked all the services are running properly and moodle is also working in server computer. But problem is that when i used to try the moodle or an other file on another computer that is a part of that local network by giving the ip address of server machine

In reply to Abu Ali

Re: localhost refused to connect

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Check to see if selinux is blocking it...sounds like a firewall issue...
In reply to Abu Ali

Re: localhost refused to connect

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Your question is unclear to me. You are talking of two computers. In one, the Ubuntu machine (server), you've installed Moodle. In another machine, the client, you are running a browser and trying to visit the Moodle instance in the server. Right? If so then "localhost" is completely out of place. It is the name each computer use to call itself!

And then you talk of a LAMP package and a Moodle package. What are they? Could you post the links to the tutorials you used in installing both?
In reply to Visvanath Ratnaweera

Re: localhost refused to connect

by Shamsuddeen Adamu -
Login as administrator.
Locate > Site Administrator.
Click > User > Permissions > Define roles.
Select > Authenticated user.
Filter type > Private.
Set the following to prohibit;