Scalable Wordpress on AWS Elastic Beanstalk, 404 permalink issue - wordpress

I installed a clean Wordpress on AWS Elastic Beanstalk (Separate MySQL database on RDS and multiple EC2 instances (AWS Linux 64bit PHP 5.5)). I did some testing and was able to scale the system up to multiple servers and back down - everything was working beautifully. Problems started when I changed permalink settings in Wordpress from "Default" to "Post name", after which I tried to access Wordpress Hello world sample page again and got 404 error with an error message: The requested URL /hello-world/ was not found on this server. This only happens sometimes. If you keep clicking on the post link, many times it serves the page right (with the post name correctly in the URL), but sometimes it gives 404. I deleted the environment and started from scratch but got the same result.
Any idea how to fix this? Any other recommendations to consider when setting up auto-scalable Wordpress site on AWS?
Thanks for all the help and advice in advance.

Does apache have the permissions to rewrite the .htaccess file? Never used beanstalk but in AWS EC2 mostly this is the solution. In your console try this command
sudo chown -R apache:apache /var/www/html
/* Change the directory, if your wordpress is installed somewhere else */

Related

How to solve http 500 error in wordpress?

I am trying to open a website since yesterday but facing this problem
This page isn’t working https://www.indgovjobs.com/ is currently unable to handle this request. HTTP ERROR 500
I searched on the net and tried all the method I could to solve the issue but wasn't able to solve it. I tried htaccess file method (but I don't have access to the admin panel due to the same issue), increasing php memory, disable plugin by renaming the folder. I have hosted the website via aws ec2 wordpress by bitnami instance.
Can you ssh your ec2 instance and access check the error logs? please post them here.
if you are having difficulty using ssh, check the following documentation by bitnami to troubleshoot AWS/WordPress issues.
https://docs.bitnami.com/aws/how-to/troubleshoot-wordpress-issues/
Depending on OS or apache installation your location of the error log may be different. try following command
sudo tail -100 /var/log/apache2/error.log

WordPress Multisite Redirect Loop After Botched Plugin Update

So I've seen a bunch of questions like this, but many of them have no answers or the setup seems to be slightly different, so I thought I'd venture a new one.
I also apologize if some of this is vague and rushed, I'm sort of pulling my hair out trying to figure things out, but want to give as much detail as possible.
So I have a multisite WordPress installation on a Google Compute Engine instance. It was launched from the Cloud Launcher (https://console.cloud.google.com/launcher/details/bitnami-launchpad/wordpress-multisite). I have three sites running, one at mydomain.com, one at dev.mydomain.com, and one at staging.mydomain.com. It's all been working great for the past several months, but this morning a colleague was updating a plugin (Beaver Builder in case that turns out to be significant), and perhaps simultaneously taking a backup with Updraft Plus. In the middle of the update/backup, the browser redirected to a long error saying the update failed, and from then on the site was showing a 500 Server Error.
I got in to work about half an hour later and noticed it was showing the "Apache2 Debian Default Page". I took a look at the httpd.conf, and noticed the DocumentRoot was pointing to the default Apache folder. I tried changing it to the WordPress install folder, and then was getting a different error related to permissions. I set the file permissions of the wordpress install to the recommended settings, and after that both subdomains worked. The root URL was kind of working -- it redirected from mydomain.com to http://IPADDRESS/wp-signup.php. I looked in the wp-config and saw that DOMAIN_CURRENT_SITE was now set to the IP address, as well as the home and site url fields in the database. I changed them all to the domain name, and started getting a redirect loop error.
So for now I've left it as redirecting to the IP address, and added a NOBLOGREDIRECT setting to the wp-config to stop the wp-signup.php redirect. I am obviously not great at sys admin things, so I have no idea what to try next. I've ruled out the htaccess, plugins, and DNS settings (DNS hasn't changed).
Any help or direction would be greatly appreciated!
If you got the Debian Apache page then it is highly likely that someone installed the Debian apache2 package, which conflicts with the apache bundled in the stack. I advise you to uninstall the Debian Apache:
sudo apt-get remove apache2
Then restart the server services:
sudo /opt/bitnami/ctlscript.sh restart

"mycreatedwpsite.example.com is currently unable to handle this request. 500."

I have developed a site on WordPress.org locally on my computer.
And I wanted to launch the site online.
SO.
I purchased a GoDaddy Domain. I purchased Bluehost hosting.
And wanted to transfer the site from local server to hosting service.
I found a video: https://www.youtube.com/watch?v=cM9Z8aQTCvQ At 2:27 the tutor shows, "Before we export the database we need to change our URL.".
I did it. And I hit the "save changes" button. After that I have been trying solution after solution all over the internet.
Bluehost's ftp manager. Filezilla file transfer. Bluehost's WordPress installation (I imported my theme, didn't work.)
Tried different videos of move WordPress from localhost to server.
I found lots of articles about this problem on Internet. Even Codex WordPress Changing Site URL article.
But nothing from suggested solutions works for me.
And nothing works.
My local site by WAMP server and WordPress.org still looks amazing.
And after typing domain URL web browser still shows "isn't working."
Edit
PHP logs show:
[24-Mar-2016 16:10:50] PHP Fatal error: Call to undefined function
array_replace_recursive() in
/home2/hotelpo5/public_html/wp-content/themes/ta-pluton/inc/post-types/CPT.php
on line 512
One reason that causes this issue is suppressed fatal error. Try enabling error_reporting and display_errors.
If you need to test the settings without modifying php.ini you can use something as below.
ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL);
For the future googlers.. for me this was a permission issue which got messed up after I had checked a tag out using Git. So all I had to do was run the following command inside the website root to reset the permissions back to Directories:755 & Files:644.
chmod -R u+rwX,go+rX,go-w ./
Further more the checkout had also messed up the file ownership. So I ran the following command inside the website root to set it back to the specific user:usergroup.
chown -R web1:client0 ./
Note:- Your username:usergroup would vary, so you shall have to adjust the above command to fit your environment.

EC2 and Wordpress Times Out When Downloading Anything

I put up a WordPress site on an EC2 instance (Linux, micro). I couldn't get the install of WordPress using ssh command line because it would constantly time out. But I did get it working by Ftping the files to my server. Now, everything is working but when I try to install a new theme or plugin through the wordpess admin interface, I only get the timeout error.
I have no idea why I'm getting timeouts when I connect to the www.wordpress.com site (for the install or plugins or themes), but that seems to be the common denominator.
Does anybody know what might be going on here?
Thanks
It turns out I forgot to include https for outbound connections in the security group.

Change default URL on bitnami EC2 application

I'm running wordpress on a micro EC2 instance using a bitnami AMI (ami-8333ffea to be exact) but I think this question applies to any bitnami cloud application. I've designated an Elastic IP and mapped a subdomain to the instance (e.g., blog.example.com). So far, so good.
Now I can access the blog but the URLs all contain '/wordpress' (blog.example.com/wordpress/.../). Bitnami has documentation (click 'Cloud Image/Bitnami Hoting' tab) for fixing this but I've tried following it several times without success. I make the changes, the site still works but '/wordpress' is still there taunting me. The machine is running Apache2 and the instructions all seem to make sense. I'm not sure what I'm doing wrong. Please help.
Probably the WordPress siteurl setting was not updated. The following command has to be executed:
sudo /opt/bitnami/mysql/bin/mysql -u root -p -e "use bitnami_wordpress; update wp_options set option_value='http://blog.example.com' where option_name='siteurl' or option_name='home'"
Make sure that you substitute "blog.example.com" in the example above with your own domain name.
And after changing the httpd.conf file, the Apache web server should be restarted:
sudo /opt/bitnami/ctlscript.sh restart apache
You can take a look at the BitNami Cloud Hosting article explaining how to assign a custom domain to your server, you can directly jump to the 6th section.
If you have BitNami specific questions, consider visiting BitNami Support page bitnami.org/support.

Resources