Installing to Subdomain

Installing to Subdomain

by Shamil Nunhuck -
Number of replies: 7
Hi, I've installed Moodle to a subdomain (http://revision.thinkteen.co.uk).

Initially, I installed it to http://thinkteen.co.uk/revision since that's where the document root for that subdomain is.

The reason I installed it there was because during installation, the first step would redirect me to the domain site (http://thinkteen.co.uk)

After installing to the subdirectory, I changed the wwwroot to http://revision.thinkteen.co.uk and updated the MySQL database using replace.php in the admin folder.

Using Moodle at the subdomain still redirects users to the domain site. Users cannot login or create accounts due to this.
Average of ratings: -
In reply to Shamil Nunhuck

Re: Installing to Subdomain

by Marc Grober -
What about the config.php file? http://docs.moodle.org/en/Moodle_migration

However, you have some strangeness going on as far as root directories and subdomains which I am reluctant to comment further on without additional information. Does your your subdomain have the same address as your domain? Are you running multiple IPs on one server? Do you have your httpd listening on more than one IP? What is the root address of the webserver running on your subdomain? Have you configured your httpd.conf and related files to have webservers on the domain and subdomain use the same roots?

By way of example, I do install Moodle in subdomains regularly, so going to moodle.mydomain.com takes you right to the moodle. I could also install at moodle.mydomain.com/moodle, which would be installed in the subdomain but not in the subdomains root. I could of course use httpd.conf to specify any directory as root, so I could set up my subdomain root to be http://mongo.com/moodle (with a couple of caveats regarding filesystems which we need not discuss at the moment.....)

Your problem may be that you just forgot about the config file, but if that is not it I would post the additional details suggested above.....
In reply to Marc Grober

Re: Installing to Subdomain

by Richard Enison -
MG,

SN said he (forgive me if I guessed the wrong gender!) changed wwwroot. That to me connotes a change to config.php.

SN,

This post is another example of MG's suggested modification: http://moodle.org/mod/forum/discuss.php?d=102970#p454668

RLE
In reply to Richard Enison

Re: Installing to Subdomain

by Marc Grober -
Richard,

I see what you mean, just thought that he might have been mixing references to his httpd.conf root directory with the php.config and fiddled one without the other.....

Looking forward to hearing from Shamil ;=}

GoG
In reply to Richard Enison

Re: Installing to Subdomain

by Shamil Nunhuck -
Hi, I originally had to install there, and placing it there, makes some of the images not load on the subdomain. (Just tested it twice).
In reply to Marc Grober

Re: Installing to Subdomain

by Shamil Nunhuck -
Hi - the subdomain has the same IP as the domain, though the server has 2 IP addresses, the other IP is used to house another site. httpd is running on both ports.

How would I configure httpd.conf to use the same roots? (I'm on a VPS).
In reply to Shamil Nunhuck

Re: Installing to Subdomain

by Marc Grober -
SN, Sorry but I am still not very clear on your configuration so it is difficult to comment..... you have multiple issues, some of which apparently go beyond moodle configuration.....

If you want to learn how to configure Apache you can go to the Apache web site and there is a wealth of information there. As far using DocumentRoot for more than one instance of webserver, you could use your browser to search for appropriate resources....

for example, in about twenty second, using the query below, I found half a dozen articles explaining how to do this.....
http://www.google.com/search?q=same+documentroot+multiple

Please note.... I am not stating that making any specific changes to your configuration will resolve your problems as I do not have enough information to address your issues comprehensively..... all I know so far is that you seem to have one web server with two ips. I don't know if you are managing both webservers with the same instance of httpd, in fact I am note sure what web server you are running. You can have one httpd listening on different ports and managing different web sites for different domains, and you can have those domains share document root, which also means that they can share moodle, moodledata and db..... however, the php configuration file would have to be able to differentiate between the two domains (see wwwroot setting in http://docs.moodle.org/en/Configuration_file) , which will present you with some configuration issues. Additionally, since the db stores wwwroot you will need to resolve this as well (see explanation concerning using replace.php here: http://docs.moodle.org/en/Moodle_migration).

You might ask, "Why isn't Moodle designed such that it will use relative addressing totally, i.e. pull wwwroot from httpd.conf?" Well, frankly, I am not sure that you can't hack something up to manage, but I have never delved into that question and it might be something to pose to a core developer...... This may soimply be a matter of no one has pursued this because the product developed with the expectation that each instance of moodle will have its own moodledata and db..... I think Mauno and I have both tried to determine if there is any documentation specifically address alternative configurations and though Mauno has tested and suggested that sharing of the data directory and db does not appear to present obstacles, that is a far cry from confirming full functionality.....


In reply to Shamil Nunhuck

Re: Installing to Subdomain

by sushumna rao -
Hi Shamil,


Could you guide me on how to install in subdomain step by step as I could do easily in my root but not really understanding how to do when I create a subdomain and if I want to install there, please guide me.