Elastic Beanstalk deploy configuration shows: DBInstance doesn't exist - apache

I have an Elastic Beanstalk currently working, with her database. The deploy works with any problem. But, my links don't work, so I updated the httpd.conf adding this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
And with this it works.
The problem is that due to auto-scaling, every day httpd.conf is restored, so I lose my config, and need to do it again.
I created a config file inside .ebextensions folder:
container_commands:
01_setup_apache:
command: "cp .ebextensions/httpd.conf /etc/httpd/conf/httpd.conf"
But when i try to deploy, my console shows this:
2019-04-17 11:27:59 ERROR Service:AmazonCloudFormation, Message:Stack named 'awseb-e-vhgv2femtx-stack' aborted operation. Current state: 'UPDATE_ROLLBACK_IN_PROGRESS' Reason: The following resource(s) failed to update: [AWSEBAutoScalingGroup].
2019-04-17 11:27:59 ERROR Updating Auto Scaling group named: awseb-e-vhgv2femtx-stack-AWSEBAutoScalingGroup-14XUH5Q77OR6A failed Reason: Template error: DBInstance aa2jl0t4ovd7y8 doesn't exist
2019-04-17 11:27:59 ERROR Failed to deploy application.
But of course it exists.
Someone can help me? I'm totally stucked on this
Thanks

Related

Firefox/chrome shows apache request as blocked / stalled

I'm using Apache 2.4.33 running on MacOs 10.13.6 as a local web development server
I ran some updates last week, mainly to update php from 7.1 to 7.2. This included a few tweaks to my httpd.conf namely to load a different php module.
I also recreated the server self-signed certificates as per instructions here: https://gist.github.com/jonathantneal/774e4b0b3d4d739cbc53
I've started getting errors on some web pages where some files included in the page are blank. these are both .js and .css files.
If I refresh the page, it is always the same 2 or 3 files.
As this is a dev environment, the files are sym linked from the web/assets directory through to the source directories.
I can't see any permissions problems. Other files in the same directory, with same ownership and permissions don't have the same error.
Looking at the network panel in FF, it lists the file, no error status, not even 200 - completely blank. I can't see the file in the Apache access_log either. Nothing in the error log.
If I look at the "Timings" sub-tab, it has a status of blocked.
I'm not running the MacOs firewall.
My htaccess is very basic:
Options +FollowSymLinks
IndexIgnore */*
# We need mod_rewrite for enablePrettyUrl
RewriteEngine on
RewriteBase /
# If the directory or file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
It's not CORS/cross domain ...
In FF the console gives a "Loading failed" error
in Chrome it gives "net::ERR_EMPTY_RESPONSE"
So, blocked by what?
it seems as though I had 2 versions of PHP installed. Apache line though I was using a homebrew installed version of 7.0 and the command line thought I was using the native 7.1
I guess somehow these were conflicting.
I ran brew uninstall php#7.0, brew cleanup & brew prune. Rebooted and everything worked OK.

.htaccess rewrite working on 2.4 but not on 2.2

First an explanation of what I am trying to achieve here: If I share a url on google/facebook and so on, I want them to scrape a different page than what users see.
I have the following rewrite rule defined which works on my local machine running Apache 2.4. (I test this by changing my user agent string)
RewriteCond %{HTTP_USER_AGENT} (facebookexternalhit/[0-9]|Twitterbot|Pinterest|Google.*snippet|Google) [NC]
RewriteRule event/(\d*)$ http://example.com/sharepage.php?id=$1 [P,L]
Our public server is running Apache 2.2 though and I keep getting a response of 500 Internal Server Error. Oddly enough no errors are being logged in the apache error logs.
I have also checked that mod_proxy and mod_proxy_http are enabled.
Any help is appreciated.

mod_rewrite works on localhost but not when upload into server

I wrote a code to redirect people who ask for foo.html to the page bar.html instead.
my .htaccess file is as below
RewriteEngine on
RewriteRule ^foo.html$ bar.html
It works on localhost.But gets the following error when runs in web server.
HTTP Error 404.0 - Not Found The resource you are looking for has been
removed, had its name changed, or is temporarily unavailable.

Block access to folder and allow only from subdomain

I got a folder called roundcube and also a subdomain called webmail.domain.org. I add this code in .htaccess to block accesing to domain.org/roundcube and allow only on webmail.domain.org.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^webmail\.domain\.org$ [NC]
RewriteRule ^roundcube/$ http://webmail.domain.org [L,NC,R=301]`
Accesing domain.org/roundcube still works and webmail.domain.org gives me this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, me#domain.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
What I'm doing wrong?

Mod rewrite enabled but not working in Apache

I currently use an iMac running Mavericks for development at work. I use the built in version of Apache and installed MySQL using homebrew when I first got the machine. Recently I had an issue where one of my virtual hosts was not working as expected and I ended up using Virtual Host X's restore command to wipe out my virtual hosts and start again.
I managed to get my vhosts working again but since then have noticed that mod_rewrite, although enabled, is not working. If I go to http://mywebsite.local/events I get an error
"Not Found -The requested URL /events was not found on this server." but if I go to http://mywebsite.local/index.php/events view the page fine.
I think restoring using Virtual Host X may have corrupted something in my Apache set up as the restore command does have this warning:
"Backup files contain all of your VirtualHostX data as well as copies of your web configuration files. Restoring a backup will replace those files and your current data (virtual hosts, domain details, etc) with the previously backed up data."
Here is a copy of my vhost settings for one of the sites I'm having issues with:
Options FollowSymLinks
AllowOverride None
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css|ttf|woff)$ /index.php
I first experienced this issue on Mountain Lion but have since upgraded to Mavericks hoping it would fix the issue but to no avail.
Any help would be great. If the issue can't easily be solved anyone with any advice about how to completely rid your machine of Apache and start again would also be helpful.
Thanks for your answer but unfortunately it didn't work out. However I am pleased to say the issue is now sorted. I pasted in your code and it stopped my virtual host from running altogether. I needed to paste my original code back in so copied and pasted it back in from this post in Stack Overflow and restarted Apache. I clicked on a few links and the rewrites are now working.
I'm guessing that there were some hidden characters which were causing the issue which were eradicated when I pasted the code back in.
I hope this helps someone as it was very annoying.
This should be used in Debian Apache2:
Options FollowSymLinks
AllowOverride None
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css|ttf|woff)$ /index.php [L]