I've just created an Amazon EC2 instance with Ubuntu OS, and I installed git. Then I moved to my DocumentRoot folder /var/www/html and I cloned laravel5 from GitHub. However I'm getting a blank page.
I thought it was permission issue, so I moved one folder up cd .. and did chmod -R 777 laravel. I also restarted my apache server service apache2 restart, but I kept getting blank page. Has anyone ever had the same issue with Laravel 5, how did you solve it?
Related
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.
I have a dedicated server running CentOS.
I have installed
WHM/Cpanel. On my server, I have a domain (example.com) and a user
(example).
The website domain example.com points to /home/example/public_html/. However, my project is Laravel, so the index point is in /public. I need to change the document root from
/home/example/public_html/ to /home/example/public_html/public
I ran the following commands:
nano /var/cpanel/userdata/example/example.com
nano /var/cpanel/userdata/example/example.com_SSL
rm -vf /var/cpanel/userdata/example/example.com.cache
rm -vf /var/cpanel/userdata/example/example.com_SSL.cache
/scripts/updateuserdatacache
/scripts/rebuildhttpdconf
service httpd restart
The problem:
When I run these commands, I see that nothing changed and I see DO NOT HAVE PERMISSION page of Laravel index.php (root not public).
When I run these commands for an empty project I see the results, and when I copy and paste the Laravel project I again see the permission denied page.
What is it?
This question is on AWS Laravel Implementation on Apache + mySQL AWS EC2 instance.
After copying the working Laravel folder from xampp/htdocs/my_project_name, migration to create tables in mySQL database and seeder are working.
However, I could not connect to my APIs using Postman. (404 not found)
I following these solution links
laravel the requested url was not found on this server
https://laracasts.com/discuss/channels/general-discussion/laravel-5-the-requested-url-was-not-found-on-this-server
I managed to modify the httpd.conf. However, I could not find file .htaccess
(
where .htacces i can find? Sorry for stupid question, but i can't find :) – MilanNz Mar 11 '15 at 12:30
#MilanNz The .htaccess can be found in the public directory of your application. However the code from this answer goes inside a vhost file. The location of that depends on your server. (e.g. for apache2 and unix it's usually at /etc/apache2/sites-available)
)
Also, I was not able to reboot my Apache using "service apache2 restart".
So I "sudo reboot"ed the EC2 instance and reconnected using Postman, the API urls were still not found.
There is a possibility that my URL is wrong. So I attach it here:
The URL used is http://ec2-??-??-???-??.us-east-2.compute.amazonaws.com/my_project_name/public/api/resultCRUD/list
The working xampp URL is http://localhost/my_project_name/public/api/resultCRUD/list
The Laravel project folder is located at /var/www/html/my_project_name on AWS EC2.
http://ec2-??-??-???-??.us-east-2.compute.amazonaws.com/phpinfo.php and
http://ec2-??-??-???-??.us-east-2.compute.amazonaws.com/phpMyAdmin/ are working.
Any help is greatly appreciated. Thanks!
It's finally working.
The reason I was stuck is because most of the answers are for ubuntu while I am using RedHat.
For RedHat EC2 instance, need first change the content of /etc/httpd/conf/httpd.conf following https://pinecode.io/article/setting-up-laravel-56-on-aws-linux,
In this step, I actually changed all "AllowOverride None"s to "AllowOverride All" instead of only line 151 of httpd.conf.
Then need to restart httpd using sudo service httpd restart
following https://gistpages.com/posts/enable_mod_rewrite_in_apache2_on_red_hat_linux
Then it is working all fine.
I didn't restart my apache service after saving changes to httpd.conf when I was asking this question.
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
My Apache used to work fine, but I assume that problems came after upgrading OSX to 10.9.2, (anyway not certain about when the problem came) Apache was not working with the current configuration.
I tried apachectl configtest so I found out that the Apache's file structure on my machine was changed, from Library/WebServer/Documents/ to Library/WebServer/Apache Home so I edited the DocumentRoot of httpd.conf to point to the new folder.
But the problem I still cannot fix is about the permission. I got 403 Forbidden, You don't have permission to access / on this server.
Extra Information
I hosted all my web projects at /Users/myname/home_www this folder and it's sub folders belong to _www group, and has 775 access permission. I created a symlink at Library/WebServer/Apache Home (all these setup used to work fine)
I noticed some strange thing that the Library/WebServer/ and its sub folders belong to wheel group, I never paid attention to these folders before that what group they belong to.
OSX: 10.9.2
Apache: 2.2.26
As I said in my case all problems seem to come after upgrading to 10.9.2, these are steps I have done to solve my problems.
Edit DocumentRoot to DocumentRoot "/Library/WebServer/Apache Home"
Edit <Directory> to <Directory "/Library/WebServer/Apache Home">
This step may not be necessary but just in case, brew upgrade
Chenge owner and group of /usr/local/var/mysql/ to *mysql using sudo chown -R _mysql:_mysql /usr/local/var/mysql/, otherwise mysql.server start will fail