HELP! Permission denied - /opt/nginx/html/railsapp/public/javascripts/less_routes.js

122 views
Skip to first unread message

Chad

unread,
Oct 28, 2009, 2:11:01 AM10/28/09
to Lovd by Less
For some reason I can't get this app to run!!! I did a little
research and found out that the app wants to change this file
everytime it runs.

I am not a linux guy but I MADE IT THIS FAR!!! If anyone can help me
fix this problem I would appreciate it! I am sure it is just a
permissions issue.

MY SETUP:

Nginx with passenger on Ubuntu 8.04 (Hardy).

THANK YOU!

Steven Bristol

unread,
Oct 28, 2009, 9:12:23 AM10/28/09
to lovdb...@googlegroups.com

do this from the root of the app:

> ls -al public/javascripts


and send the results.

cheers,
steven bristol

Chad

unread,
Oct 29, 2009, 8:09:35 PM10/29/09
to Lovd by Less
Hey Steven,

I successfuly got it up and running. I set permissions using a
command I found online, I want to say it was "CHMOD +a -R /Public"...
This was just a "trial/demo" install to familiarize myself with the
process. I will be destroying the machine and reloading this
weekend.

Thank you for your help!

~Chad

On Oct 28, 6:12 am, Steven Bristol <stevenbris...@gmail.com> wrote:

Chad

unread,
Nov 1, 2009, 4:36:22 PM11/1/09
to Lovd by Less
OK... Ran into trouble with this again. Here is output:

/var/www/lovdbyless: ls -al public/javascripts
total 428
drwxr-xr-x 2 root root 4096 2009-11-01 12:50 .
drwxr-xr-x 6 root root 4096 2009-11-01 12:50 ..
-rw-r--r-- 1 root root 2481 2009-01-31 07:37 application.js
-rw-r--r-- 1 root root 34797 2009-01-31 07:37 controls.js
-rw-r--r-- 1 root root 31534 2009-01-31 07:37 dragdrop.js
-rw-r--r-- 1 root root 38916 2009-01-31 07:37 effects.js
-rw-r--r-- 1 root root 96799 2009-01-31 07:37 jquery.js
-rw-r--r-- 1 root root 55893 2009-11-01 13:12 less_routes.js
-rw-r--r-- 1 root root 1142 2009-01-31 07:37 pngfix.js
-rw-r--r-- 1 root root 125605 2009-01-31 07:37 prototype.js
-rw-r--r-- 1 root root 11940 2009-01-31 07:37 thickbox.js
-rw-r--r-- 1 root root 2605 2009-01-31 07:37 truncator.js


Please advise.

Steven Bristol

unread,
Nov 2, 2009, 7:34:58 AM11/2/09
to lovdb...@googlegroups.com
On Sun, Nov 1, 2009 at 5:36 PM, Chad <tahoe...@gmail.com> wrote:
>
> OK... Ran into trouble with this again.  Here is output:
>
> /var/www/lovdbyless: ls -al public/javascripts
> total 428
> drwxr-xr-x 2 root root   4096 2009-11-01 12:50 .
> drwxr-xr-x 6 root root   4096 2009-11-01 12:50 ..
> -rw-r--r-- 1 root root   2481 2009-01-31 07:37 application.js
> -rw-r--r-- 1 root root  34797 2009-01-31 07:37 controls.js
> -rw-r--r-- 1 root root  31534 2009-01-31 07:37 dragdrop.js
> -rw-r--r-- 1 root root  38916 2009-01-31 07:37 effects.js
> -rw-r--r-- 1 root root  96799 2009-01-31 07:37 jquery.js
> -rw-r--r-- 1 root root  55893 2009-11-01 13:12 less_routes.js
> -rw-r--r-- 1 root root   1142 2009-01-31 07:37 pngfix.js
> -rw-r--r-- 1 root root 125605 2009-01-31 07:37 prototype.js
> -rw-r--r-- 1 root root  11940 2009-01-31 07:37 thickbox.js
> -rw-r--r-- 1 root root   2605 2009-01-31 07:37 truncator.js
>
>
> Please advise.
>


It looks like root owns all the files and so when you run the app, it
tries to regenerate the less_routes.js file, but isn't allowed to do
that because it can't overwrite the file owned by root.

It not a good idea to have all the files owned by root, nor run the
app as root. Here's how to fix: Assuming your user account name is
"chad" and the chad's main group name is also "chad" run the following


from the root of the app:

> sudo chown -R chad:chad *

Now you should be able to run the app as chad and the js file will be writable.

cheers,
steve

Chad

unread,
Nov 2, 2009, 3:48:58 PM11/2/09
to Lovd by Less
Hey Steven,

Sorry for my ignorance, but again I am new to linux. During the
installation I setup a user "ruby" (not chad) but since I had to type
"sudo" all the time during the installation of ruby, mysql, nginx etc
--- the 2nd time I installed I stayed logged in as root so the
commands were simpler to pass to the system (I reformatted and started
over with apache instead of nginx).

Was that a bad idea, and will I need to reformat and reinstall
everything (as regular user and NOT root?)?

I know I have a user named "ruby" with sudo ALL=ALL privelages but I
do NOT know what the MAIN group name is? shouldn't APACHE run as user
www or something?

Thanks for your help.

~Chad

On Nov 2, 4:34 am, Steven Bristol <stevenbris...@gmail.com> wrote:

Steven Bristol

unread,
Nov 2, 2009, 7:06:45 PM11/2/09
to lovdb...@googlegroups.com
On Mon, Nov 2, 2009 at 4:48 PM, Chad <tahoe...@gmail.com> wrote:
>
> Hey Steven,
>
> Sorry for my ignorance, but again I am new to linux.  During the
> installation I setup a user "ruby" (not chad) but since I had to type
> "sudo" all the time during the installation of ruby, mysql, nginx etc
> --- the 2nd time I installed I stayed logged in as root so the
> commands were simpler to pass to the system (I reformatted and started
> over with apache instead of nginx).
>
> Was that a bad idea, and will I need to reformat and reinstall
> everything (as regular user and NOT root?)?
>
> I know I have a user named "ruby" with sudo ALL=ALL privelages but I
> do NOT know what the MAIN group name is? shouldn't APACHE run as user
> www or something?
>
> Thanks for your help.
>
> ~Chad
>


Probably the group name is also ruby. If you do
> ls -al ~
you should see the user name and the group name for the files there.
Just use whatever it says.

Apache will run properly, don't worry about it, it is properly
configured. You probably don't need to delete everything, most likely
changing the ownership of the app dirs/files will fix the problem.

cheers,
steve

Chad

unread,
Nov 2, 2009, 9:28:55 PM11/2/09
to Lovd by Less
Bingo! I fixed the permissions problems with your command above
(using user/group ruby) and the site loaded. Only it loaded the blank
white page with the big pink graphic and the text fields.

I played around with the .rb files and changed things that said
"localhost:3000" to my domainname (sub.domain.com) and restarted
apache and everything looks normal now!

Not sure if that was a good idea or not - I am still new to both Ruby
AND Linux... But NOTHING links to port 3000 anymore, so while it may
"LOOK" like it is working - I might have ruined my setup for when I
want to serve PRODUCTION instead of development.

Not sure what, but I figured I needed to get rid of :3000 in the entry
since I am serving my application using APACHE which runs on port
80...

Still trying to make since of all of this and plan to research some
more - but I WANTED SOME SORT OF RESULTS so I could at least have some
sort of motivation for learning all of this!

So far I am very happy and interested to learn more. THANKS FOR YOUR
HELP ALONG MY WAY!



On Nov 2, 4:06 pm, Steven Bristol <stevenbris...@gmail.com> wrote:

Steven Bristol

unread,
Nov 3, 2009, 7:46:55 AM11/3/09
to lovdb...@googlegroups.com

If you run it with phusion passenger behind apache, it will be port 80
by default.

steve

Reply all
Reply to author
Forward
0 new messages