Forbidden You don't have permission to access {codeigniter} on this server - codeigniter

I am trying to run CodeIgniter for the first time. I have a running apache2 server on my machine. I downloaded CodeIgniter and copy extracted folder it into /var/www/html folder. Also, I set baseUrl config in CodeIgniter
$config['base_url'] = 'http://localhost/codeIgniter';
But I am getting
Forbidden
You don't have permission to access /codeIgniter/ on this server.
I tried setting .htaccess file but couldn't fix the issue. what is the solution for this issue?

This is a pretty vague question but here are some trouble shooting things.
In the HTML folder do: chown -R www-data:www-data nameOfProject.
Also did you set up everything in your apache/sites-available and sites-enabled. Also set up your host file
If this doesn't work just google setting up a ci project.
The reason you had to chown it was to allow appache to access it

Related

Laravel project folder permission

I have a problem with my Laravel project on VPS. Locally everything works fine, but on VPS sometimes folder permission changes and web site stops to work. I don't know what causes this problem and what should I do?
Every time I have to fix with this code:
sudo chown -R user:user /data/web/website.com
There may be some script which is rewriting the permissions for your folder. Go with the .htaccess file that will definately work.

Laravel lock some folders on host

Guys I have created my first Laravel Project and I uploaded it to the server successfully and everything works perfect.
But I can write in the url www.mydomain.com/resources/views and show all my views!
Also user can open my .env file and view my database connection info!
I want only the user to navigate only to my routes not to any folder he guess.
Basic Instruction to Deploy Laravel to shared hosting7
You should point your document root to app/public/
run composer install in the project root directory
set writable permissions to bootstrap cache chmod 777 bootstrap/cache
set writable permissions to storage chmod 777 storage -R
There are many things that can go wrong while deploying application. So, it would be easier for us to help you, if you also provide us step by step process that you followed while deploying the laravel application.
For securing your routes and .env file you need to get into your hosting root directory, create .htaccess file and copy the below code and paste it in there
# Disable index view
Options -Indexes
<FilesMatch "\.env$">
Deny from all
</FilesMatch>
I hope this will solve your problem.

Can't see images in localhost

I'm starting to develop a site in ubuntu 14.04. I'm using apache2, so I placed my files under /var/www/html/ folder. Everything was working fine, but I had to restart my current work so I copied the entire project folder from another path, like this
$ sudo cp ~/path/to/folder /var/www/html/
And now I can't see my images, a simple imgtag. I just see this.
When I look for the file, I can see that I'm having an error 403 forbidden. I saw some suggestion to add the option Require all granted but that option is already set in my apache. I suspect that is because the new folder is a copy from a folder without root permissions, so I tried chmod but that also didn't work so I'm completly lost now.
So, how can I see my images from localhost? and most important is why this happen suddenly?

public_html folder invisible

I have a website which I copied to this location. The public_html folder was also uploaded with the other folders but it is not showing up. Please guide me. Thanks.
As you are using DreamHost web hosting you wont have any control over ssh and chmod , chown commands. I think dreamhost wont use cPanel for shared hosting, they have their own control panel, so there is nothing you can do, Ask dreamHost support to reinitialize your public_html directory. Surely they will do that. I searched on dreamhost forum and found these link-
https://discussion.dreamhost.com/thread-13646-post-13647.html#pid13647
https://discussion.dreamhost.com/thread-128630.html
Currently in your case i saw that there is no issue related to public_html (technically "Document Root" ) directory coz as your http://www.inspuratesystems.com/second/ is pointing to correct directory , and your documentRoot is parent of that directory, So if your documentRoot was wrong then there were no chance to access that that url, currently your domain is opening a correct index.html file which indicates that your documentRoot is there.
Create a index.html or home.html file there manually (from their web based file manager) and see if it is working or not, if it works then there is some issue with your uploading.
Your hosting provider seems to be dreamhost.com
Please check out this thread, according to which public_html seems to be a special case on dreamhost:
https://discussion.dreamhost.com/thread-144453.html
and/or this:
Getting a 'Not Found' error on my website?
Hope it helps!
Make sure that the public_html folder has execute permissions
chmod a+x public_html
That will allow execute permissions for everybody.
Perhaps it's possible that server (apache?) hides folders named public_html? Also check that group others have read and execute permissions for that folder.
In folder /path/to/second/ run
chmod ugo+rx .
chmod -R ugo+rx public_html
to set folder visible.
cpanel may handle the "public_html" folder in a unique way. Try uploading to a folder like: /home/yourusername/public_html/second/files/ instead of /home/yourusername/public_html/second/public_html/
If you are wanting to create a new distinct website at inspuratesystems.com/second/ you don't need a second "public_html" folder. Just put them in the /home/yourusername/public_html/second directory.
If you are using a linux or OS X server, you may need to change the permissions on the folder.
Did you checked if the folder is hidden attribute?
If you execute ls -a in terminal, you will know about it's existence. If it is present then please try giving it read & execute permission (using chmod 555 command). Give write permission if you are planning to write something or take feedback from users (using chmod 777).
I tried some of this options above but unfortunately none worked. Instead I discovered that in CPanel you have a "Preferences" tab and in that tab you have a "User Manager" function. You can there edit the ftp user that you created before in CPanel. On the "User Manager" funcion you can find the "Home Directory" configuration. On that home directory you just choose the "public_html". When you configure the user in the ftp account on your ftp platform, it goes directly to the path you defined in CPanel.

Codeigniter configuration & debugging problem

I have changed my server with a project running on codeigniter. I already installed everything (PHP, MySQL, Codeigniter, etc) and all the processes seem to work fine.
But now I'm trying to connect to my project homepage, but I only receive a blank page.
It's not a rewrite problem (the Codeigniter index.php works fine...I can echo anything within the index.php). The database login is also correct.
Any ideas how to debug so that I can find a solution.
it was a CHMOD Problem:
the log folder was not writeable. the strange thing: both folders have CHMOD 755, but when I changed the folder to 777 the site works...

Resources