On Wed, 12 Oct 2016, StarX wrote:

> Thanks for the reply Charlie.  
> 
> Can you give me any pointers as to how I would set this up,

I see under https://github.com/kraih/mojo/wiki/Apache-deployment#apachecgi
some text:

"In this way you make Apache render static files from /public folder for 
you".

... which is what I am suggesting you should be doing.

> I don't have a lot of experience with Apache configuration

I am not sufficiently expert with apache configuration to tell you how to 
do it, but there do seem to be specific .htaccess instructions in the 
documentation which don't match what you are trying to use.

> - it's managed by our systems 
> admins so I'm currently stuck with CGI at the moment.
> 
> I managed to get it working by using:
> $ENV{SCRIPT_NAME} = "/dir/my_app/" in myApp.pm
> 
> Then in htaccess I have:
> AddHandler cgi-script .pl
> Options +ExecCGI
> 
> IndexIgnore *
> 
> RewriteEngine on
>      
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-l
> RewriteRule ^(.*)$ script/my_app.pl/$1 [L]
> 
> The code in my original question was based on the documentation in the 
> Apache Deployment info here: 
> https://github.com/kraih/mojo/wiki/Apache-deployment.  I really like 
> Mojolicious but I find that some of the documentation can be confusing for 
> someone that is relatively new to the framework.  I guess that this is what 
> this group is for though.  Thanks again.
> 
> On Tuesday, 11 October 2016 15:13:15 UTC+1, Charlie Brady wrote:
> >
> >
> > On Mon, 10 Oct 2016, StarX wrote: 
> >
> > > I've got a Mojolicious app running under CGI, but my css and js files 
> > are 
> > > not being served from the pubic directory. 
> > ... 
> > > My URLs appear correctly in the page source as /dir/my_app/css/file.css 
> > and 
> > > /dir/my_app/js/file.js but clicking them in the source just displays the 
> > > entire page content rather than the css/js.  I'm not quite sure how to 
> > > configure the rewrite correctly, can anyone help? 
> >
> > I think you should configure apache so that those files are served 
> > directly by apache, rather than attempt to have your application executed. 
> >
> 
> 

Reply via email to