Forums | Mahara Community

Support /
User sub-domains stopped working


Patric Lougheed's profile picture
Posts: 97

28 October 2014, 7:50

I had to move my site to a new server as the VM it was running became corrupted. I moved everything over to an identical setup but the user sub-domains refuse to render. I only get php code.

I am running Apache 2.4 with PHP 5.5 and php-fpm using the proxy instead of sockets. Worked like a dream before. I had to move it to an existing server that has other vhosts and I noticed the other sites running Jooma have become unstable. The Mahara site is very stable just no user domains. 

Any ideas?

Aaron Wells's profile picture
Posts: 896

29 October 2014, 14:48

If you're seeing PHP code when you try to access the page in your web browser, it means that the file isn't being processed by PHP. Perhaps the part of your Apache config where you tell it to send *.php files to the PHP engine, is located inside a context where it only applies to the base domain?

Cheers,

Aaron

Patric Lougheed's profile picture
Posts: 97

04 November 2014, 5:04

Yes, I managed to get it to start processing but it only redirects back to the dashboard. It will not display any user profiles. I have found some strange behavior since the last update to PHP Version 5.5.9-1ubuntu4.5 with FPM/FastCGI. The rewrite rules for user domains will not work at all but regular clean URLs will work. I had the setup and working flawlessly for two years on another server but this upgrade has created a great deal frustration. From some of the reading I have done it looks like using proxy_fcgi causes rewrite rules to be ignored.

I have also confirmed that if you are running Mahara and Joomla on the same server something causes PHP corruption in the display of Joomla sites. 

Aaron Wells's profile picture
Posts: 896

07 November 2014, 15:20

Hi Patric,

Regarding the Joomla issue, there's a PHP bug where the function "libxml_disable_entity_loader()" leaks through to other PHP processes. It has been known to cause interference between Mahara and Moodle, and I wonder if that's what is causing your Joomla problems as well. See https://bugs.launchpad.net/mahara/+bug/1340151

Try commenting out the part in htdocs/init.php on line 66 where we call libxml_disable_entity_loader(), and see if that fixes things. (We also call that function a couple of times in import/leap/lib.php, but that's only used while you're generating a LEAP2A export.)

Cheers,

Aaron

Patric Lougheed's profile picture
Posts: 97

07 November 2014, 17:08

The xml error is exactly what is happening... thanks for shedding light on that. I usually run Moodle on the same server so I am worried this will happen with Moodle.

Aaron Wells's profile picture
Posts: 896

10 November 2014, 20:27

We're hoping to get a fix for this in the next minor release, so that Mahara will play nice with other PHP apps until PHP fixes the bug.

Aaron Wells's profile picture
Posts: 896

07 November 2014, 15:22

Regarding the user subdomains... are you saying that when you try to access http://aaronwells.example.com, you see the same page as http://example.com instead of the aaronwells user's profile page?

The way those rewrites are meant to work, http://aaronwells.example.com should show you the same thing as http://example.com/view/view.php?profile=aaronwells . If you are instead seeing the same thing as http://example.com/, then it suggests that your Apache rewrites aren't working at all.

Cheers,

Aaron

Patric Lougheed's profile picture
Posts: 97

07 November 2014, 17:06

Rewrites work fine until I enable user domains in the config. Then it only loads the dashboard and not individual user profiles. Clean urls are functioning just fine and I have tried everything to enable user domains. I suspect something in php5-fpm is causing this as I tried fastcgi without the mod_proxy and the same thing happened. I have tried Ubuntu builds and Dot Deb builds with no change. All my attempts involved using 127.0.0.1:9000 tcp/ip and not sockets as Apache will not support it yet with the build I have.

I am trying to move to Nginx so i can use sockets but the config is confusing to get user domains working.

Patric Lougheed's profile picture
Posts: 97

16 December 2014, 10:56

I think I found the problem:

RewriteRule of "^$" broke

https://issues.apache.org/bugzilla/show_bug.cgi?id=53929

This all started when I moved to an upgraded server that had Apache 2.2.4 but this does not seem to be fixed until 2.4.9

9 results