Hi All
I am trying to deploy laravel 5.1 project on AWS EC2 cloud server and having an issue with laravel web site route URLs.
I ran following commands to configure the EC2 ubuntu 14.04 LTS server.
sudo apt-get install apache2
sudo apt-get install mysql-server php5-mysql
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo apt-get install php5 php-pear
sudo apt-get install curl php5-curl php5-cli git
sudo a2enmod rewrite
sudo php5enmod mcrypt
sudo service apache2 restart
sudo chmod -R 777 storage
it loads the /var/www/html/mynewhost/resources/views/auth/login.blade.php template as the home page. So I think Route::get('/', 'Auth\AuthController@getLogin') route is working.
but i am getting the following error when I try access any other route URLs. (eg. www.mynewhost.com/register)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /register was not found on this server.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at xxxx.ap-southeast-2.compute.amazonaws.com Port 80
</address>
</body></html>
I have changed the apache route URL to the public folder of my laravel project. Also I tried 2 enable the following virtual host file while the apache root is /var/www/html, but still got the same error.
<VirtualHost *:80>
ServerAdmin admin@mynewhost.com
ServerName mynewhost.com
ServerAlias www.mynewhost.com
DocumentRoot /var/www/html/mynewhost/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite mynewhostl.com.conf
sudo service apache2 reload
sudo service apache2 restart
do I need to grant any permission to my laravel project folder?
appreciate any help.
PS. this is a duplicate post of https://laracasts.com/discuss/channels/laravel/laravel-deployment . re-posting again to clear the mess