public access problem for my moodle server urgent

public access problem for my moodle server urgent

by ali munir -
Number of replies: 15

hi friends..

please I need an urgent help please..

iam using ubuntu desktop 12.04 and i installed moodle 2.1 and done all the configurations and it was working normally in localhose.

i tried to make it public access i followed ur instructions in the website

sudo nano /etc/moodle/config.php

and opened config.php and changed the

$CFG->wwwroot = 'http://109.224.5.29/moodle';


then i changed the apache.conf file using this command

sudo nano /etc/moodle/apache.conf

and i make it

allow from 109.224.5.29/255.255.255.240

allow from localhost

allow from all

after i done all of this when i write the address on the client it show me this message:

Incorrect access detected, this server may be accessed only through "http://localhost/moodle" address, sorry.
Please notify server administrator.

please urgent help

Average of ratings: -
In reply to ali munir

Re: public access problem for my moodle server urgent

by Colin Fraser -
Picture of Documentation writers Picture of Testers

What would happen if you were to swap the last two lines? Or delete the reference altogether? Forgive my ignorance ere but why is there an apache.conf file in the Moodle folder? I am not familiar with ubuntu server  or its structure, but I understood Apache controlled access to the Moodle, not the other way around... 

In reply to Colin Fraser

Re: public access problem for my moodle server urgent

by ali munir -

thanx alot for ur responce Mr. Colin.

well I tried the both i tried to remove the two lines or only keep "allow from all" but the problem still the same..

according to my basic knowledge i think that "apache.conf" can control how apache can give an access to moodle.

thanx again..

hope u help me if u know further information cause still have the same problem

In reply to ali munir

Re: public access problem for my moodle server urgent

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The only reason for this is that you did not change the wwwroot setting in config.php. Check it again!
In reply to Howard Miller

Re: public access problem for my moodle server urgent

by ali munir -
thanx alot Mr. Howard for your reply i do changed it several times but still have the same problem i even restarted the database and apache after change but still not working hope u help me if u have any further information cause i am still stuck with this problem
In reply to ali munir

Re: public access problem for my moodle server urgent

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've just noticed that you edited /etc/moodle/config.php

I've *never* heard of the moodle config being in that location. As Ken said, how did you install Moodle and why do you think that is the correct place for the config file.

I still think that it has not picked up the config file change. I suspect you are editing the wrong file.
In reply to Howard Miller

Re: public access problem for my moodle server urgent

by ali munir -

thanx alot for ur responce again...

well i used git tool to install the moodle i used the code below:

sudo su  (you will need to enter your password)
apt-get update
apt-get install git git-core git-doc
apt-get install php5-gd php5-curl php5-intl php5-xmlrpc
apt-get install php5 mysql-server mysql-client apache2  php5-mysql
cd /var/www
git clone git://git.moodle.org/moodle.git
cd moodle
git checkout -t origin/MOODLE_21_STABLE
chmod 0777 /var/www/moodle
so if u have any information about the correct location for config.php file please help
so i can fix the problem thanx alot again
In reply to ali munir

Re: public access problem for my moodle server urgent

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Presumably you just used the web based installation to create config.php?

In which case...

/var/www/moodle/config.php
Average of ratings: Useful (1)
In reply to Howard Miller

Re: public access problem for my moodle server urgent

by ali munir -

thanx alot Mr. Howard Miller you are the best i used ur answer and it is working

thanx alot for ur reply and attention my friend

best wishes

 

 

In reply to ali munir

Re: public access problem for my moodle server urgent

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Since this server is going public it may be sensible to put some though on file permissions.

Here is a sample http://moodle.org/mod/forum/discuss.php?d=206491&parent=901383 and the "theory" behind http://moodle.org/mod/forum/discuss.php?d=205671#p898030.

Since you are on Ubuntu, this http://docs.moodle.org/en/Installing_Moodle_on_Debian_based_distributions too might help.

On a side note, for a public server it is advisable to take the Ubuntu Server: http://www.ubuntu.com/business/server/overview.
In reply to Howard Miller

Re: public access problem for my moodle server urgent

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
/etc/moodle/config.php is what that brocken Debian package creates. The OP must have gone "apt-get install moodle".
sad

See:
- http://moodle.org/mod/forum/discuss.php?d=196512
- http://moodle.org/mod/forum/discuss.php?d=201308
In reply to Visvanath Ratnaweera

Re: public access problem for my moodle server urgent

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Those packages make me want to cry tongueout
In reply to ali munir

Re: public access problem for my moodle server urgent

by Ken Task -
Picture of Particularly helpful Moodlers

While one could install and configure apache to be served out from almost anywhere on a system, your config for apache is a little strange.  What did you use to install Moodle?  That might give a clue as to where to look for what.

What is the true IP address of your machine? /sbin/ifconfig [ENTER]

Use the IP address seen in the above command for your Moodle config.

Would also remove: allow from 109.224.5.29/255.255.255.240

That subnets 109.224.5.29 into 14 usable IP addresses:

Usable IP Addresses = .........: 14
First Usable IP Address = .....: 109.224.5.17
Last Usable IP Address = ......: 109.224.5.30

If behind a DSL connection, your provider might assign that IP to your DSL equipment, but doesn't mean port 80 is opened to use from the public internet to your desktop.

'spirit of sharing', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: public access problem for my moodle server urgent

by ali munir -
thanx alot Mr. Ken for ur response.. well actually i used git tool to install moodle i used codes below for installation: sudo su (you will need to enter your password) apt-get update apt-get install git git-core git-doc apt-get install php5-gd php5-curl php5-intl php5-xmlrpc apt-get install php5 mysql-server mysql-client apache2 php5-mysql cd /var/www git clone git://git.moodle.org/moodle.git cd moodle git checkout -t origin/MOODLE_21_STABLE chmod 0777 /var/www/moodle ---------------------------------------------------- my public address for the server is 109.224.5.29/28 actually iam ISP and i opened port 80 using Mikrotik RouterBoard. actually i am little bit confused cause i read alot of articles in the moodle doc's but still cant find the solution for this problem. thanx alot for ur relpy and i hope u can help me with any further information.
In reply to ali munir

Re: public access problem for my moodle server urgent

by Ken Task -
Picture of Particularly helpful Moodlers

Please re-read how you installed Moodle via git.  There's your path that goes into the moodle.conf.

Again, what does /sbin/ifconfig [ENTER] show as the IP address of the machine in question.  IF you are on a private network (a 192.168.1.x) then your Mikrotik RouterBoard needs to translate/allow port 80 traffic for the public IP address to go to the private IP address.

Not sure you are an ISP as the ip you've shared:

inetnum:         109.224.0.0 - 109.224.7.255
netname:         EARTHLINKTELE001

And, this gets interesting, IF you use the private IP in the moodle.conf then the server won't really function from outside.  If you use the public IP address in the moodle.conf then only visitors outside your private net can see the moodle render properly.

The only way to get both inside and outside is to register a hostname for a domain you own, and then once that is responding correctly in DNS, change the IP address in the moodle.conf to the fully qualified domain name.

There are apps one might have to install to get your private IP machine to announce itself to an outside DNS server as being available.  Something like noip DNS http://www.no-ip.com/

Am certain there are others who host a moodle in their high speed connection from home.  Maybe they could share how they have set up their network and Moodle!!!

'spirit of sharing', Ken