• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tutorial security hint not working?

#1
[eluser]gene292[/eluser]
CodeIgniter Home › User Guide Home › Installation Instructions
of the CodeIgniter User Guide Version 2.1.1 user guide.

I went through the static pages part of the tutorial fine.
However, when I tried to follow the security advice from Installation
Instructions:
"For the best security, both the system and any application folders should be placed above web root"
I get 404 error.
Can somebody else reproduce?

gene

#2
[eluser]CroNiX[/eluser]
Did you then do what the very next line in that guide says?
Quote:After moving them, open your main index.php file and set the $system_folder and $application_folder variables, preferably with a full path, e.g. '/www/MyUser/system'.

#3
[eluser]gene292[/eluser]
PHP Version 5.2.17

here are the excerpts from home/me/work/www.xshare.com/htdocs/index.php
$application_folder = '/home/me/work/www.xshare.com/htdocs/codi/application';
$system_path = '/home/me/work/www.xshare.com/htdocs/codi/system';
here is output of ls -la *
-rwxr-xr-x 1 me me 6439 2012-06-18 21:30 index.php
-rwxr-xr-x 1 me me 6415 2012-06-17 16:16 index.php~
-rwxr-xr-x 1 me me 2496 2012-06-16 21:19 license.txt

codi:
total 16
drwxr-xr-x 4 me me 4096 2012-06-18 21:30 .
drwxr-xr-x 3 me me 4096 2012-06-18 21:30 ..
drwxr-xr-x 15 me me 4096 2012-06-16 21:19 application
drwxr-xr-x 8 me me 4096 2012-06-16 21:19 system

#4
[eluser]Narf[/eluser]
For which URL do you get the 404 error.

And another note (that wouldn't fix the problem, just to clarify) ... I can see how the "above" word can be confusing. That security hint is meant to suggest that you'd do something like this instead:

* index.php and any assets in /home/me/work/www.xshare.com/htdocs/
* system/, application/ and any other directory that doesn't need to be accessed directly from outside your system: /home/me/work/www.xshare.com/ (or /home/me/, or whatever you like)

#5
[eluser]gene292[/eluser]
both "home" and "about" as in:
http://www.xshare.com/index.php/home

Thanks for clarification of above. I tried what you suggested 1st. When I got 404 I went from there.

#6
[eluser]Narf[/eluser]
Is it the CodeIgniter-flavored 404 error screen or the standard one from Apache (or whatever you're using)? If it's the latter - check your .htaccess file, mod_rewrite, etc.

#7
[eluser]gene292[/eluser]
this is the normal screen:
----------------------------------
CodeIgniter 2 Tutorial

this is home
© 2011
----------------------------------

Here is the screen with directory changes:
----------------------------------

404 Page Not Found

The page you requested was not found.

----------------------------------
It looks like the CodeIgniter-flavored 404 error screen.
The apache 404 screen bootom has (I just checked):
Apache/2.2.14 (Ubuntu) Server at www.xshare.com Port 80

#8
[eluser]gene292[/eluser]
OK, I figured it out. The problem is with the tutorial/static_pages.html
if ( ! file_exists('application/views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
show_404();
}


So what is the right/good way to specify site root? Should it be specified in the view() method?
what is the right/good way to create view method?

This should be very basic, no?
Is there a moderator for this forum?
Really resisting urge to vent...


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.