Starman and MovableType 5.2

757 Views Asked by At

MovableType 5.2 has builtin PSGI support (via a mt.psgi in the main directory) and I've been trying to take advantage of it using starman/plackup.

Starman w/ MT fires up, but I get odd Not Founds and a silent hang & fail when I run mt-upgrade.cgi.

How I am running starman:

cd /home/ec2-user/mysite/perl/components/movabletype
plackup -s Starman --port 8045 --error-log /home/ec2-user/mysite/perl/logs/starman.log --pid /home/ec2-user/mysite/perl/var/starman.pid -a mt.psgi

Mystery 1: My browser returns "Not Found" for index.html, but mt-static and mt.cgi is reachable.

X http://mysite:8045/mt/index.html ... Not Found 
✓ http://mysite:8045/mt-static ... listing of static assets 
✓ http://mysite:8045/mt/mt.cgi ... redirects to ... 
X http://mysite:8045/mt/mt-upgrade.cgi?__mode=install ... fails

Mystery 2: Due to the redirect I believe that MT code is running. But it is mostly silent in the starman log even though I have tried different MT debug options. Worse, the mt-upgrade.cgi seems to be reached then fails with this lone message to the starman log:

[mypid] Bootstrap CGI script in non-buffering mode: /home/ec2-user/mysite/perl/components/movabletype/mt-upgrade.cgi

This non-buffering message seems informational and normal, and is coming from the MT codebase.

I have also run directly under starman and get the same result.

Any ideas or help would be appreciated!

System/Environment:

MT_HOME='/home/ec2-user/mysite/perl/components/movabletype'

linux AMI on an amazon ec2.

perl-5.16.0 under perlbrew.

CPAN modules:

cpanm starman
cpanm CGI::PSGI
cpanm CGI::Parse::PSGI
cpanm CGI::Compile
yum install expat-devel
cpanm XML::Parser
cpanm SOAP::Lite
cpanm SOAP::Transport::HTTP
cpanm XMLRPC::Transport::HTTP::Plack
cpanm DBI
sudo yum install postgresql9-devel
cpanm DBD::Pg
cpanm Task::Plack

MT config:

CGIPath    http://mysite:8045/mt

StaticWebPath    http://mysite:8045/mt-static

PIDFilePath /home/ec2-user/mysite/perl/var/starman.pid

DebugMode 1

ObjectDriver DBI::postgres
Database db
DBUser dbuser
DBPassword dbpass
DBHost dbhost.mysite
4

There are 4 best solutions below

4
On

Try to change your paths in mt-config.cgi to relative paths, not URLs. Like so:

CGIPath /mt/
StaticWebPath /mt-static/

Just curious: although it does work now, are you aware that PG isn't supported and that you're taking a risk that a future version of MT might break with it?

P.S. also don't forget the PIDFilePath directive mentioned in the documentation.

1
On

BTW, a 404 on http://mysite:8045/mt/index.html looks quite normal. You're not supposed to have your site index at the same level than MT (you could, but that's not the recommended setup and it won't work in a stock MT install that assumes that MT and the produced sites are clearly separated).

1
On

I'm Yuji Takayama, lead engineer of Movable Type. I did try to reproduce your steps but I was not able to reproduce this. (this means I got initial install screen)

So, Can you try with mysql? also can you try "tools/upgrade" script? I think you can get error messages when some errors occurs.

ex.) cd MT_HOME; perl -Ilib -Iextlib tools/upgrade --username --password --nickname --email --preferred_language --site_name --site_url --site_path --site_theme --site_timezone

And, I have answer about "index.html was not found".

Reason: MT will never mount MT_HOME as static files directory like a mt_static, because we think that MT_HOME must not be possible to list.

0
On

If you are trying to run Movable Type under Starman, I would seriously recommend running the upgrade script that comes with Movable Type using the command-line equivalent of your choice. There is no good reason for mt-upgrade.cgi to become persistent in the manner that Starman and Plack permit.