Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
new ccgi permissions
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- new ccgi permissions
- « Previous
-
- 1
- 2
- Next »
Re: new ccgi permissions
07-07-2010 12:37 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I am trying to set the proper permissions on my Wordpress files, using Gabe's script in a file called permissions.cgi . I've got the server error ("Premature end of script headers: permissions.cgi") Does anyone know what the cr/lf error is, as mentioned by ninjanik?
Here's what I did - can anyone tell me what am I doing wrong? It might be something very basic, as I am not too knowledgeable about Unix/Linux.
1. On a Windows PC, I copied the 9 lines of script in Gabe's message and pasted them into a text file.
2. I transferred the file to ccgi.<myusername>.force9.co.uk, using FireFTP
3. I renamed the file to permissions.cgi, using FireFTP
4. I checked/set the permissions on permissions.cgi, using FireFTP. They are Owner Read, Write Execute. 0700
5. I looked at the permissions.cgi file - it has the 9 lines. The lines terminate in hex 0d0a, except for the last one.
6. I looked for .htaccess and found none. (I can see other files beginning with a "." - .bash_history .swp and .viminfo)
7. Using Firefox, I went to http://ccgi.<myusername>.force9.co.uk/permissions.cgi but got the error.
Thanks,
Brian
Here's what I did - can anyone tell me what am I doing wrong? It might be something very basic, as I am not too knowledgeable about Unix/Linux.
1. On a Windows PC, I copied the 9 lines of script in Gabe's message and pasted them into a text file.
2. I transferred the file to ccgi.<myusername>.force9.co.uk, using FireFTP
3. I renamed the file to permissions.cgi, using FireFTP
4. I checked/set the permissions on permissions.cgi, using FireFTP. They are Owner Read, Write Execute. 0700
5. I looked at the permissions.cgi file - it has the 9 lines. The lines terminate in hex 0d0a, except for the last one.
6. I looked for .htaccess and found none. (I can see other files beginning with a "." - .bash_history .swp and .viminfo)
7. Using Firefox, I went to http://ccgi.<myusername>.force9.co.uk/permissions.cgi but got the error.
Thanks,
Brian
Message 16 of 24
(593 Views)
Re: new ccgi permissions
07-07-2010 12:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Not sure, but try uploading again with the transfer mode set to ascii.
Gabe
Gabe
Message 17 of 24
(593 Views)
Re: new ccgi permissions
07-07-2010 1:30 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Gabe,
You're a star! That was the answer.
Many thanks,
Brian
For anyone else using FireFTP: it has three modes of transfer - binary, ASCII and automatic. You select the mode from Tools->Options->Downloads/Uploads
You're a star! That was the answer.
Many thanks,
Brian
For anyone else using FireFTP: it has three modes of transfer - binary, ASCII and automatic. You select the mode from Tools->Options->Downloads/Uploads
Message 18 of 24
(593 Views)
Re: new ccgi permissions
25-02-2011 7:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
That script's been a big help, seemed to be the ONLY way I could set file permissions recursively
Message 19 of 24
(593 Views)
Re: new ccgi permissions
16-03-2011 2:47 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hmm, now I'm having problems... Pretty much everything is returning "premature end of script headers" with the exception of simple html files.
I've put gabe's script at: http://ccgi.tomandlu.plus.com/perms.cgi (uploaded as ascii, perms 700), but it won't run either. Even this cut-down version for testing won't work (http://ccgi.tomandlu.plus.com/permsb.cgi):
Oh, edit to add, I've no .htaccess files...
I've put gabe's script at: http://ccgi.tomandlu.plus.com/perms.cgi (uploaded as ascii, perms 700), but it won't run either. Even this cut-down version for testing won't work (http://ccgi.tomandlu.plus.com/permsb.cgi):
#!/bin/bash
echo "Content-type: text/html"
echo
echo "<table border='1'><tr><th>Type</th><th>Name</th><th>User, Group</th><th>Permissions</th></tr>"
echo "</table>"
Oh, edit to add, I've no .htaccess files...
Message 20 of 24
(593 Views)
Re: new ccgi permissions
16-03-2011 3:48 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I don't know if this helps but I found I could only get bash scripts to run in the cgi-bin folder, so I typically put them there and edited in a "cd .. " at the beginning so they'd act on the whole tree not just the cgi-bin branch.
Message 21 of 24
(593 Views)
Re: new ccgi permissions
16-03-2011 3:58 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hmm, nope - no difference...
Just for completeness, here's the full script...
And I've checked running it under a shell on an Ubuntu install, and it seems fine (not via a browser, just command line).
Edit to add - I'm going to back up my legacy stuff, and turn off cgi, then turn it on again to see if that fixes things at all. Something seems screwy at the mo'
Just for completeness, here's the full script...
#!/bin/bash
echo "Content-type: text/html"
echo
find . -type d ! -perm 1710 -print0 | xargs -0 chmod 710
find . -type f -regextype posix-extended -regex '.*\.(php|pl|cgi)$' -print0 | xargs -0 chmod 700
echo "<table border='1'><tr><th>Type</th><th>Name</th><th>User, Group</th><th>Permissions</th></tr>"
find . -type d -printf '<tr><td>Folder</td><td>%p</td><td>%u, %g</td><td>%M</td></tr>'
find . -type f -printf '<tr><td>File</td><td>%p</td><td>%u, %g</td><td>%M</td></tr>'
echo "</table>"
And I've checked running it under a shell on an Ubuntu install, and it seems fine (not via a browser, just command line).
Edit to add - I'm going to back up my legacy stuff, and turn off cgi, then turn it on again to see if that fixes things at all. Something seems screwy at the mo'
Message 22 of 24
(593 Views)
Re: new ccgi permissions
16-03-2011 7:12 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Yup. Something is screwy at the mo'. You have group write permission set on your web root folder. That'll stop you running anything from there. The safest thing to do is to ask PN to reset it for you, but if you're feeling bold you can try creating a folder in your home/root folder, set its perms to 710 using ftp; place this script, with .cgi extension
in that folder and set its perms to 700, then call it in a browser.
Gabe
#!/bin/bash
echo "Content-type: text/html"
echo
chmod 1710 .. && echo "done"
in that folder and set its perms to 700, then call it in a browser.
Gabe
Message 23 of 24
(593 Views)
Re: new ccgi permissions
17-03-2011 6:09 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Ah - thought it might be something like that (I saw a couple of other posts where people had run into similar issues). Anyway, I deactivated and have now reactivated cgi which I suspect will fix it.
Interestingly, some scripts did run on an intermittent basis, but it was all a bit flaky to say the least.
Anyway, many thanks...
Interestingly, some scripts did run on an intermittent basis, but it was all a bit flaky to say the least.
Anyway, many thanks...
Message 24 of 24
(593 Views)
- « Previous
-
- 1
- 2
- Next »
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page