Welcome Guest, Not a member yet? Register   Sign In
Is this correct?
#1

[eluser]7th Sense[/eluser]
Hello,

I want to install CI on my root folder of my server since I am going to use it only for that website, so my question is what is the correct way to do this? Do I just put CI on a folder called myproject like this >> http://localhost/myproject/ and then change the base url? Or I installed everything on root and keep the base url the same? What is the correct way so when I put the site on the final server does not give me any trouble.


Please help,

Thanks,
#2

[eluser]TheFuzzy0ne[/eluser]
There is no "correct" way persae. Due to the .htaccess files that come supplied with CodeIgniter, it should be pretty secure in your Web root, however... In an ideal situation, the system and application directories should be outside of your Web root. The only thing that should be in there, are your index.php, an .htaccess file, and other public things such as CSS, images and Javascripts.

However, if this site is going to be hosted on a shared Web host, it would be working checking that they don't have an open_basedir restriction in effect that will prevent you from doing this. It's unlikely that they will, but you never know.
#3

[eluser]7th Sense[/eluser]
Hello Thefuzzyone,

Thanks for the reply, but, I am going to put my CI website on a server that is only for it, it is a VPS with other 4 websites but, they are separate by disk partions, different IPs and domains. Is it a problem for the open_basedir? it would not give me a problem if I put it on root folder? or I just created on a project directory and change the base rute url?


Please advice with the right way to do it, since i want to start developing my application

Cheers!
#4

[eluser]TheFuzzy0ne[/eluser]
If you're running on a VPS, I assume you have full root access to the filesystem, in which case an open_basedir shouldn't be a problem, and even if it was, you could change it.

The open_basedir restriction is normally only enforced on shared hosts to prevent people accessing other people's home directories.

You can simply move your application and system directories out of your Web root, and update the paths in your index.php file.

Hope this helps.
#5

[eluser]7th Sense[/eluser]
Thanks Bro!! Helps a lot!! then I am going to do it on my webroot since it is not a problem!!!


Cheers!!
#6

[eluser]TheFuzzy0ne[/eluser]
Sorry, I think you misunderstood me. Sometimes you can't move your system and application directory outside of your Web root, but this is a problem that specific to shared Web hosts. Since you're technically not on a shared host, you should be able to move those directories outside of your Web root without any problems, which will help increase security.
#7

[eluser]7th Sense[/eluser]
[quote author="TheFuzzy0ne" date="1362566284"]Sorry, I think you misunderstood me. Sometimes you can't move your system and application directory outside of your Web root, but this is a problem that specific to shared Web hosts. Since you're technically not on a shared host, you should be able to move those directories outside of your Web root without any problems, which will help increase security.[/quote]

So, let me see if I get this clearly

what you recommend and is more secure for me to put my application A or B or what you mean?

A) /home/www/myproject/

B) /home/www/



Thanks!
#8

[eluser]TheFuzzy0ne[/eluser]
I like to split up my app, and move the application and system directories outside of the Web root.

Given your current directory structure, I'd do something like this.

/home/codeigniter/applications/app_name // This is where your application directory should go.
/home/codeigniter/system/<system_version> // This is where your system directory should go.
/home/www or /home/www/my_project (for multiple apps on the same server) // This is where your index.php should go, and anything else public such as images, CSS, scripts and so on.

This has a few advantages.
1) You can run multiple apps, and have them all sharing the same version of CodeIgniter, or running different versions. It also makes it easier to upgrade your system. It's a simple case of changing your system path to point at a newer system version. If there's a problem, you can just as easily change it back again.
2) You save space. Rather than duplicating the system directory for multiple applications, they can all share the same base system.
3) Your "sensitive" files are not in the Web root, and cannot be accessed by the outside world. Even if your .htaccess file was deleted without your knowledge or, for some reason, the server stopped processing your .htaccess file, your source code is safe. Any database configuration settings and secret keys are kept away from the general public.

There may be flaws in the say I have set this up, but I've yet to find one. It seems to work quite well for me. Smile

I hope this helps.




Theme © iAndrew 2016 - Forum software by © MyBB