ec2 aws only index page is routing, further is error as - URL NOT FOUND - amazon-ec2

Only index page of aws ec2 instance is routing fine. further pages are not routing at all. I get an error as - URL NOT FOUND
It happened after i upgraded from php56 to php70.
I did restart httpd service

I got this fixed.
I needed to edit and modify below in httpd.conf inside etc/conf
AllowOverride All
for Directory /var/www and Directory /var/www/html

Related

set up wildcard subdomain on Ubuntu 18.08 (Laravel/Homestead)

I'm trying to set up wildcard subdomains for a Laravel project in a Laravel/Homestead enviorement, but cannot figure it out why this does not works.
The local setup was successfull, but cannot make it work on the Ubuntu. I've set up in the nginx conf file the server name:
server_name example.test *.example.test
Restarted the nginx, but after accessing any subdomain, there is no activity in access_log.
how can this be done?
It seems, the best/easiest way to solve this is the vagrant-rubydns plugin:
I hope this will help somebody else.

Laravel all routes except '/' return 404 on AWS EC2

I'm trying to run Laravel project on AWS EC2. It was working fine until uploaded a new version to deploy. All routes return error 404 except for '/' though all routes exist. httpd.conf in /etc/httpd/conf contains this
<Directory "/var/www">
AllowOverride All
# Allow open access:
Require all granted
</Directory>
I always execute these commands after deploying a new version
sudo chown -R ec2-user /var/app/current
sudo chmod -R 755 /var/app/current
I tried "sudo a2enmod rewrite" but I get "sudo: a2enmod: command not found"
Any solution?
Replacing the instance and re-deploying the app solved the problem
After modifying /etc/httpd/conf/httpd.conf
You need to also restart httpd using sudo service httpd restart
Refer to Laravel ReST API URL 404 not found on AWS EC2 in Apache + mySQL environment - The request URL was not found on this server

Directory for Subdomain on Route53

I've successfully created a subdomain on Route53 that is connected with EC2 Instances. When I access my subdomain subdomain.domain.com there appears Amazon Linux AMI Test page.
How to upload my website to subdomain.domain.com?
If usually add files to /var/www/html/ on primary domain, what about subdomain?
I also have checked the root server using WinSCP and there is no subdomain directory.
In this case my subdomain is "blog".
Hope to get the best answer.
Thanks.
"subdomain.domain.com" is a logical name (called hostname) for the IP of your EC2 instance. You should not expect any subdomain directory on your EC2 instance.
It looks like the directory /var/www/html/ does not have any landing page (index.html). Upload your website under the directory /var/www/html/ such that your index.html is placed directly under the directory /var/www/html/.

Apache 403 Error with HTTP not with HTTPS

I've got a very strange issue with Apache:
I'm running Apache/2.2.22 + with PHP 5.5.27 (dotdeb.org) under Debian 7.8.
I made an upgrade of PHP, I'm not sure if it's related but I restarted Apache and suddenly all HTTP stuff ceased to work, only HTTPS requests are correctly handled, VirtualHost config of port 80 is no more working correctly, it seems like Apache is not getting the right DocumentRoot (403 on / and file not found for subfolders and files) if I use a HTTP URL (OK for HTTPS stuff).
sites-available/default syntax is OK, suexec and open_basedir paths updates didn't help.
It's not related to IP (it's not fail2ban, checked on other devices)
It's not the permissions or an Apache running user problem (I tried everything).
I even uninstalled (purge) and reinstalled libapache2-mod-php5.
Nothing worked.
Any clue ?
Thanks
Ok I figured it out, it's not PHP, it's the virtualhosts I created using Virtualmin, here's the fix:
Disable the NameVirtualHost lines in /etc/apache2/apache2.conf
Replace <VirtualHost XX.XX.XX.XXX:80 [XXXX:XXXX:X:XXXX::]:80> by <VirtualHost *:80> in all /etc/apache2/backup/sites-available/ conf files
Add NameVirtualHost *:80 at the top of /etc/apache2/sites-available/default file

Virtual host in laravel-4

How Can i setup virtual host for laravel-4 ?
Previously I wrote some code and routes looked like -
Route::get('/', 'PageController#home');
Route::get('/home', 'PageController#about');
when I gave the url - "http://localhost/laravel-master/public/" I can see the home page but when tired "http://localhost/laravel-master/public/about" i got error saying url not found.
I tired configuring virtual host but ended up with the error - You don't have permission to access"url" on this server.
What is the correct way to do this ??
the path to my laravel folder is "C:\wamp\www\laravel-master"
and instead of using "http://localhost/laravel-master/public/" i wish to use url like "myapp" or so, So that when i use myapp I can see the home page and when I use "myapp/about" I can see the about page.
You need to add your virtualhost and host file.Make your apache listen to your Url.
Something like in your virtualhost file
<VirtualHost laravel>
DocumentRoot "C:/wamp/www/laravel-master/public"
ServerName laravel
</VirtualHost>
And in your host file:
127.0.0.2 laravel
make apache restart and your clean URL will work.

Resources