Running 2 servers on different ports

Running 2 servers on different ports

by Anthony Williams -
Number of replies: 6

Hi

I have just installed a 1.5 Moodle installation at http://trainingbeta.servehttp.com:81/moodle

alongside my existing installation on the same address but on port 80

I thought everything was fine but if I try to restore a backed up course, the submit buttons ignore the specified port and send me to the original site.

I've specified the port in config.php, and all seems fine everywhere else.

Any ideas?

Anthony

Average of ratings: -
In reply to Anthony Williams

Re: Running 2 servers on different ports

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You *should* be able to do that although it seems a bit of overkill. What's wrong with simply installing it in a different directory, ie:

http://trainingbeta.servehttp.com/moodle2

???

I would also check you don't have a sessions conflict - make sure that they are both given their own (different) session names in the admin=>variables page. This is pretty much essential however you run parallel Moodles.
In reply to Howard Miller

Re: Running 2 servers on different ports

by Anthony Williams -

Thanks for the quick reply. I need them on completely seperate machines as one of them is fairly critical

I'd forgotten about session variables, so thanks for that.

I've since spotted that backup and restore both have the same behaviour of ignoring the port.

In reply to Anthony Williams

Re: Running 2 servers on different ports

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 still don't buy it smile

We run multiple moodles on the same port on the same servers. They have discrete databases and data areas - not even a glimmer of a problem.
In reply to Howard Miller

Re: Running 2 servers on different ports

by Anthony Williams -

I understand what you're saying, and I'd like to do it that way too, but my boss insists that the development server be physically seperate from the live server.

I'm also having problems with moodlelib.php that I thought was the extra lines in config.php problem, but it isn't

 Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp\www\moodle\theme\poweraid\header.html:66) in c:\program files\easyphp\www\moodle\lib\moodlelib.php on line 1820

Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp\www\moodle\theme\poweraid\header.html:66) in c:\program files\easyphp\www\moodle\lib\moodlelib.php on line 1821

Seems to be a cookie problem, but I'm stumped


In reply to Anthony Williams

Re: Running 2 servers on different ports

by David Scotson -

The headers already sent thing is a common problem. There should be an explanation if you click on the highlighted text in your, or this, forum post. If, as I think you suggest, you've already ruled this out, then there was fix put into CVS recently that fixed a cookie problem with the Login Block, maybe that is the cause.

My answer to your original question is the same as Howard's i.e. don't do that. But I think Howard got the idea that you were running two instances on the same machine (a perfectly normal thing to do, though most people give them different URLs). In fact, it seem that you are running them on two different machines. The question then is why you don't give the two machines different names e.g. www.yourmoodle.com and test.yourmoodle.com and leave both on port 80.

Hope that helps, at least a little bit.

In reply to David Scotson

Re: Running 2 servers on different ports

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Mmmm.... are you behind a masquerading router of some sort and you are using port forwarding to direct to two different machines? I can't think of any other way that using a port would choose the actual host machine. If so accessing Moodle sitting on an NAT system is fun all by itself and worth a search through past forums.