4.1 local www directory

36 views
Skip to first unread message

Steve

unread,
Feb 13, 2012, 5:17:44 PM2/13/12
to Reason Discussion
Hi, all.

Has anyone else upgraded to 4.1 and lost access to their local www
directory? I've lost custom ui icons, stylesheets, and javascripts in
that directory.

I have a symlink

local -> ../../../reason_package_local/local/www

at reason_package/reason_4.0/www. The code no longer seems to be
checking the local folder first.

Thanks,
Steve

Nathan White

unread,
Feb 14, 2012, 12:04:57 AM2/14/12
to reason-d...@googlegroups.com
Hi Steve -

When a request comes in for a resource in /reason_package/reason_4.0/www/, /reason_package/reason_4.0/www/local/ should be checked first. The way that is done is via an .htaccess file that lives here - /reason_package/reason_4.0/www/.htaccess. That file should contain a directive that performs and serves the resources from the local folder if available. In Reason 4.0 and below, that file contains absolute paths to the /reason_package/reason_4.0/www/local/ folder. In Reason 4.1, the .htaccess file is actually in the github repository, and uses relative paths. You can look at what should be in that .htaccess file here:


If you could check whether or not that .htaccess file exists and confirm that is looks like the one I linked above, that would be great. If it exists and doesn't work, let me know and we can try to find out why.

Another thing to try:

1. Delete reason_package/reason_4.0/www/.htaccess.
2. Run setup.php and see if it auto generates a new one - the setup.php script will try to create one, and it uses the old format with absolute paths.

Let me know how things go.

Nate


--
You received this message because you are subscribed to the Google Groups "Reason Discussion" group.
To post to this group, send email to reason-d...@googlegroups.com.
To unsubscribe from this group, send email to reason-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reason-discussion?hl=en.


Steve

unread,
Feb 14, 2012, 11:04:40 AM2/14/12
to Reason Discussion
Hi Nate,

Thanks for the reply. The .htaccess file was there and is a copy of
the one in the repo. After deleting and running the setup script
again, I do get access to my local www folder.

Here is the diff of the two files.

< RewriteCond local/$0 -F
---
> RewriteCond /usr/local/webapps/reason/reason_package/reason_4.0/www/local/$0 -f


Thanks,
Steve

On Feb 13, 11:04 pm, Nathan White <n...@natewhite.com> wrote:
> Hi Steve -
>
> When a request comes in for a resource in /reason_package/reason_4.0/www/,
> /reason_package/reason_4.0/www/local/ should be checked first. The way that
> is done is via an .htaccess file that lives here -
> /reason_package/reason_4.0/www/.htaccess. That file should contain a
> directive that performs and serves the resources from the local folder if
> available. In Reason 4.0 and below, that file contains absolute paths to
> the /reason_package/reason_4.0/www/local/ folder. In Reason 4.1, the
> .htaccess file is actually in the github repository, and uses relative
> paths. You can look at what should be in that .htaccess file here:
>
> https://github.com/carleton/reason_package/blob/master/reason_4.0/www...

Nathan White

unread,
Feb 14, 2012, 4:52:35 PM2/14/12
to reason-d...@googlegroups.com
Glad you have it working ... I wonder why the .htaccess file in the repo doesn't work for you. I tried to mimic the directory structure you are using and the github relative version of the .htaccess file works just fine here. What version of apache are you using?

Nate

Steve

unread,
Feb 14, 2012, 5:57:41 PM2/14/12
to Reason Discussion
I was running Ubuntu 10.10 which was running apache 2.2.16. This
afternoon I updated Ubuntu which updated apache to 2.2.17. The
new .htaccess file now works under 2.2.17.

Thanks for your advice and help.
Steve

Steve

unread,
Feb 17, 2012, 5:38:24 PM2/17/12
to Reason Discussion
OK, I lied. It's not working. I must have accidentally left the
setup.php-generated file there.

Anyway, I've now completely updated the server to Ubuntu 11.10, which
runs Apache 2.2.20.
Steve

Nathan White

unread,
Feb 17, 2012, 11:17:36 PM2/17/12
to reason-d...@googlegroups.com
Hi Steve -

I've attached two files, import.zip and www_import.zip. They each contain a folder called import.

Extract import.php to /reason_package/reason_4.0/lib/local/scripts/

Extract www_import.php to /reason_package/reason_4.0/www/local/scripts/

From there, you can visit /reason/scripts/import/wordpress.php to try the wordpress importer. It handles a bunch of stuff. I built it for a particular site and aimed to make it work for others, but it doesn't necessarily understand everything that might be found in the wordpress xml format.

If you dig into the code a bit, I think you'll see how the general framework could be adopted to something else, like a Drupal import. Basically, the idea with the import framework I've attached is that we define a bunch of possible jobs in an abstract way, and then create a script which runs those jobs. The jobs themselves are run by an ImportJobStack class, which is able to cycle through a set of jobs, and push those that cannot yet be run to the bottom of the stack. In this manner, one job can depend upon the results of some other job, but you don't have to overly concern yourself with the order in which things take place when writing the import script. I've created a form to gather data, but the meat of the actual setup of jobs into a JobImportStack, which could be done in simple procedural script, can be seen in the process method in the file reason_package/reason_4.0/lib/local/scripts/import/wordpress/SetupForm.php.

The jobs I've created, such as EntityCreationJob, are right now defined in the file reason_package/reason_4.0/lib/local/scripts/import/jobs/basic.php. You could likely reuse these jobs if you use this framework. You'll also likely have to write some more.

I'd be very curious to stay posted on your progress with this. It would be nice to package this up a bit more cleanly and with more documentation and put some importers into the Reason core.

Nate
import.zip
www_import.zip

Steve

unread,
Feb 21, 2012, 3:21:56 PM2/21/12
to Reason Discussion
Thanks, Nate,

I think this last post was meant for another discussion we were
having.

However, getting back to this problem. Both Brian and I are having the
same problem on our local machines as well. Brian is running Apache
2.2.21 and I am running 2.2.20.

Beloit, Kalamazoo, are you running 4.1 and having this problem with
this particular .htaccess file?

Thanks,
Steve
>  import.zip
> 29KViewDownload
>
>  www_import.zip
> 1KViewDownload

Nathan White

unread,
Apr 19, 2012, 3:04:36 PM4/19/12
to reason-d...@googlegroups.com
Hi Steve - so I have an instance of the latest reason_package master running Apache 2.2.19 on Ubuntu 10.04.3 LTS and the .htaccess file with relative paths seems to work fine. At some point it might be useful to do some rewrite debugging to see where things are going wrong in a spot where you see this behavior. If you add these lines a virtual host definition in your apache config you should get some detailed output that might help figure out why the .htaccess rule in the repo isn't working for you.

RewriteLog "/tmp/rewrite.log"
RewriteLogLevel 4

If you get a chance to try it sometime, please do. It would be nice to just distribute a single .htaccess file that works for everyone if we can.

Thx,

Nate

Steve

unread,
Apr 24, 2012, 3:48:12 PM4/24/12
to Reason Discussion
Hi Nate,

I've tried again as well. I started with a clean install of the newest
Ubuntu 12.04, Apache 2.2.22. I cloned the master branch. Same
problem.

Here's the output from the rewrite_log:

192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d62058/initial] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] strip per-dir prefix: /var/
www/reasondev.luther.edu/htdoc/reason/setup.php -> setup.php
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d62058/initial] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] applying pattern '^(.*)$'
to uri 'setup.php'
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d5e058/subreq] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] strip per-dir prefix: /var/
www/reasondev.luther.edu/htdoc/reason/local/setup.php -> local/
setup.php
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d5e058/subreq] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] applying pattern '^(.*)$'
to uri 'local/setup.php'
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d6b058/subreq] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] add path info postfix: /
var/www/reasondev.luther.edu/htdoc/reason/local/local -> /var/www/
reasondev.luther.edu/htdoc/reason/local/local/local/setup.php
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d6b058/subreq] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] strip per-dir prefix: /var/
www/reasondev.luther.edu/htdoc/reason/local/local/local/setup.php ->
local/local/local/setup.php
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d6b058/subreq] (3) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] applying pattern '^(.*)$'
to uri 'local/local/local/setup.php'
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d6b058/subreq] (4) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] RewriteCond: input='local/
local/local/local/setup.php' pattern='-F' => not-matched
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d6b058/subreq] (1) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] pass through /var/www/
reasondev.luther.edu/htdoc/reason/local/local
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d5e058/subreq] (4) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] RewriteCond: input='local/
local/setup.php' pattern='-F' => not-matched
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d5e058/subreq] (1) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] pass through /var/www/
reasondev.luther.edu/htdoc/reason/local/setup.php
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d62058/initial] (4) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] RewriteCond: input='local/
setup.php' pattern='-F' => not-matched
192.203.196.236 - - [24/Apr/2012:13:24:28 --0500]
[reasondev.luther.edu/sid#b73e9d60][rid#b6d62058/initial] (1) [perdir /
var/www/reasondev.luther.edu/htdoc/reason/] pass through /var/www/
reasondev.luther.edu/htdoc/reason/setup.php

Thanks for looking into this.
Steve

Nathan White

unread,
Apr 27, 2012, 4:40:56 PM4/27/12
to reason-d...@googlegroups.com
Hi Steve - will you try this .htaccess file:

RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/reason/local/$0 -f
RewriteRule ^(.*)$ ./local/$0

Let me know if it works. Thx,

Nate

Steve

unread,
May 4, 2012, 3:42:18 PM5/4/12
to reason-d...@googlegroups.com
Yes, Nate.
That file does work.
Steve

> > > > > > > > > To unsubscribe from this group, send email to

> > > > > > > > > For more options, visit this group at
> > > > > > > > >http://groups.google.com/group/reason-discussion?hl=en.
>
> > > > > > > --
> > > > > > > You received this message because you are subscribed to the
> > Google
> > > > Groups
> > > > > > > "Reason Discussion" group.
> > > > > > > To post to this group, send email to

> > > > > > > To unsubscribe from this group, send email to

> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/reason-discussion?hl=en.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Reason Discussion" group.
> > > > To post to this group, send email to

> > > > To unsubscribe from this group, send email to

> > > > For more options, visit this group at
> > > >http://groups.google.com/group/reason-discussion?hl=en.
>
> > >  import.zip
> > > 29KViewDownload
>
> > >  www_import.zip
> > > 1KViewDownload
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Reason Discussion" group.
> > To post to this group, send email to reason-discussion@googlegroups.com.

> > To unsubscribe from this group, send email to

> > For more options, visit this group at
> >http://groups.google.com/group/reason-discussion?hl=en.

--
You received this message because you are subscribed to the Google Groups "Reason Discussion" group.
To post to this group, send email to reason-discussion@googlegroups.com.
To unsubscribe from this group, send email to reason-discussion+unsubscribe@googlegroups.com.

Nathan White

unread,
May 4, 2012, 5:07:56 PM5/4/12
to reason-d...@googlegroups.com
Great I have fixed it in master:


Also cherry-picked the commit for the 4.1 branch:


I think what is in there now will work for most environments out of the box provided you follow the install instructions.

Thx!

Nate

To view this discussion on the web visit https://groups.google.com/d/msg/reason-discussion/-/dQtQ8Bgd-ZQJ.

To post to this group, send email to reason-d...@googlegroups.com.
To unsubscribe from this group, send email to reason-discuss...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages