Tuesday, February 12, 2013

Vhosting the new moodle instance

I forgot the last step of readying my newest moodle site for the big wide world.  My network guy emailed me and told me that the site was all DNSed and ready to go. 

I browsed to the site and got the WAMP home page.  After a minute of "oh crap, what did I forget and did I kill the other instances on this server?"  I realized that I had not created an entry in my moodle vhost configuration file (httpd-vhosts.conf).  I added this entry to the bottom of the file, which among other things, includes a directive telling the DNS where to look for the moodle config.php file, the DocumentRoot directive.

Add a definition for your new moodle instance to the vhost conf. file

 VirtualHost *:80
    DocumentRoot "path_to_directory/directory"
    ServerName official_DNS_name
    ErrorLog "path_to_error_logs\error_logname.log"
 
    php_flag magic_quotes_gpc 1
    php_flag magic_quotes_runtime 0
    php_flag file_uploads 1
    php_flag session.auto_start 0
    php_value upload_max_filesize 250M
    php_value post_max_size 250M

    Directory "path_to_webroot/dirname"
           
           Options Indexes FollowSymLinks
            AllowOverride all
             Order Allow,Deny
           Allow from all

    Directory


VirtualHost

I also used my Iphone to browse the site flss.moodle.edutech.org to ensure the site was DNSed outside our network.  I also restarted the apache service to force a read of the updated vhost file.

Moral of the story?

If using virtual hosting, do not forget to create an entry for your new instance.

No comments:

Post a Comment