Wordpress permalink not working on aws - wordpress

I have spent 4-5 hours to sort it out but not able to solve it.
I have setup my wordpress website on AWS.Everything is working file except the permalinks of wordpress.
When permalinks are set to default pages/posts are working but not working with "%post-name%".
I have tried almost all the things by searching over google but no success.
I saw so many solutions all related to httpd.conf file but on my root there is no file httpd.conf neither no directory of http.
I changed the following code in apache.conf file but still not working
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Restarted apache again and again but no luck.
Please help me guys.
Thanks.

I've just managed to fix this error. Make sure you restart Apache service after making the httpd.conf change!
Documentation here has a checklist of all the changes you need to get wordpress working correclty on AWS - including getting permissions correct: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html
The bit you need to fix for permalinks is tp update the httpd.conf file
(1) Location: /etc/httpd/conf/httpd.conf
(2) Find the section that starts with <Directory "/var/www/html">
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
Change the AllowOverride None line in the above section to read AllowOverride All
Note
There are multiple AllowOverride lines in this file; be sure you change the line in the section.
AllowOverride All
(3) Restart the Apache service

If you dont have much experience using aws, then i guess its because you have not granted enough permissions to your apache. If you are unware of how to grant permissions to your apache, you can use this command in your console
sudo CHOWN -R apache:apache /var/www/html
Once done try going to your settings page and saving the new settings.

Related

Apache2/WordPress giving SSL_VERSION_OR_CIPHER_MISMATCH when viewed externally

I'm hosting a site for a local company. Without SSL, the website loads fine, but when we try to access it securely, I get ERR_SSL_VERSION_OR_CIPHER_MISMATCH (Except for when I try to view it locally)
When I go to check the logs, I don't see any issues. I've set the log level for this site to be debug, and I see a bunch of lines saying that authorization is granted, so I don't think the issue is with Apache2, but I don't know what the issue might be.
In the WordPress control panel, I've gone in and tried to make sure that all SSL controls there are disabled.
Here's my SSL config for the site:
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
#SKIP log and serverAlias settings, as well as DocumentRoot. I can provide it it's really necessary
<Directory />
Options FollowSymLinks
AllowOverride Limit Options FileInfo
Require all granted
DirectoryIndex index.php
Allow from all
Order allow,deny
</Directory>
<Directory path/>
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
#SKIP SSLCert paths. CA is GoDaddy
When I use https://www.ssllabs.com/ssltest it comes back with an 'A' rating, so I'm confident that I've got everything set up, which makes me even more lost.
A cybersec friend suggested the issue might be a keying issue with the certificate.
Needed to re-key the certificate, which resolved the error.

non www to www not working for wordpress in EC2 instance using safari

If I use my safari browser, I cannot get to my website example.com. I have to use www.example.com for it to work. I tried editing htaccess numerous times and still, it doesn't work.My website is using bitami wordpress image (https://docs.bitnami.com/)which is hosted in AWS.
Bitnami Engineer here:
By default, we disable .htaccess files due to security and performance reasons. We also move .htaccess files content to a file called htaccess.conf in the folder /opt/bitnami/apps/wordpress/conf. You can check more about it at https://docs.bitnami.com/aws/infrastructure/lamp/administration/use-htaccess/.
If you want to enable .htaccess usage, you would need to set it to AllowOverride All in /opt/bitnami/apache2/conf/bitnami/bitnami.conf file:
<VirtualHost _default_:80>
DocumentRoot "/opt/bitnami/apache2/htdocs"
<Directory "/opt/bitnami/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All <---- HERE
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>
And restart Apache after applying your changes.
For more info, find WordPress documentation below:
https://docs.bitnami.com/aws/apps/wordpress/
Regards

How to access to a localhost from another machine in the same network? [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
All I wanted to do today was to write a redirect rule to a subfolder, e.g.:
You enter the URL: example.com and you get redirected to example.com/subfolder
Such a simple wish. I tried to find a solution on the internet. The internet told me to add an .htaccess file in the htdocs root with:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteRule ^$ subfolder [L]
I did this. But no success obviously, they didn't told me I had to uncomment the module in httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so
So I did this too. No success again. They didn't told me I had to change my httpd.conf so that the .htaccess file would be enabled:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Again no success, because I get this error when entering the URL:
Forbidden You don't have permission to access / on this server.
Now I'm stuck and I couldn't find any more solutions on the internet. I'm just running Apache 2.4 on my Windows 7 machine, for private reasons.
Found my solution thanks to Error with .htaccess and mod_rewrite
For Apache 2.4 and in all *.conf files (e.g. httpd-vhosts.conf, http.conf, httpd-autoindex.conf ..etc) use
Require all granted
instead of
Order allow,deny
Allow from all
The Order and Allow directives are deprecated in Apache 2.4.
WORKING Method { if there is no problem other than configuration }
By Default Appache is not restricting access from ipv4. (common external ip)
What may restrict is the configurations in 'httpd.conf' (or 'apache2.conf' depending on your apache configuration)
Solution:
Replace all:
<Directory />
AllowOverride none
Require all denied
</Directory>
with
<Directory />
AllowOverride none
# Require all denied
</Directory>
hence removing out all restriction given to Apache
Replace Require local with Require all granted at C:/wamp/www/ directory
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
# Require local
</Directory>
Solution is just simple.
If you are trying to access server using your local IP address and you are getting error saying like Forbidden You don't have permission to access / on this server
Just open your httpd.conf file from (in my case C:/wamp/bin/apache/apache2.2.21/conf/httpd.conf)
Search for
<Directory "D:/wamp/www/">
....
.....
</Directory>
Replace
Allow from 127.0.0.1
to
Allow from all
Save changes and restart your server.
Now you can access your server using your IP address
The problem lies in https.conf file!
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
The error occurs when hash(#) is removed or messed around with. These two lines should appear as shown above.
Found my solution on Apache/2.2.15 (Unix).
And Thanks for answer from #QuantumHive:
First:
I finded all
Order allow,deny
Deny from all
instead of
Order allow,deny
Allow from all
and then:
I setted
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory /var/www/html>
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
Remove the previous "#" annotation to
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /var/www/html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
ps. my WebDir is: /var/www/html
This works for me on Mac OS Mojave:
<Directory "/Users/{USERNAME}/Sites/project">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
require all granted
</Directory>

Problems with httpd.conf configuration and .htaccess for WordPress

I've a problem with a Wordpress Multisite. I've changed the hosting server (dedicated server): the main site works fine but the other site (in subfolder configuration) gives me a 404 error. Searching in the internet documentation, I've read that is necessary to change the AllowOverride directive in httpd.conf but when I change this from None to All (and then restart the Apache server) the entire site (main e subfolder's) gives back an Internal Server Error. I tried many different configuration with "main" directory and virtualhost directory but without succes.
I write here the code of http.con
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<VirtualHost *>
ServerName www.domain.com
DocumentRoot /var/www/html/www.domain.com
<Directory /var/www/html/www.domain.com>
#AllowOverride All
#AllowOverride Fileinfo Options
</Directory>
</VirtualHost>
What can I do to make it works?
PS. Also if I change only AllowOverride from None to All in (and no other changes) the page give an Internal Server Error.

Getting WordPress permalinks working on a MAMP install

I've got a local MAMP install of WordPress and am trying to get permalinks working. But when I click my links after setting permalink setting to 'Day and name' http://localhost/wordpress_1/2011/01/12/sample-post/
I get 404ed
Not Found: The requested URL
/wordpress_1/2011/01/05/hello-world/
was not found on this server.
Is this a mod_rewrite issue? mod_rewrite is listed in the 'loaded modules' section of my phpinfo. Do I need to do something else to enable it?
Thanks
UPDATE:
From my httpd.conf:
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
Changed my httpd.conf from
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
To
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
And it works.
Follow symlinks needs to be turned on in MAMP.
Open your httpd.conf file in /Applications/MAMP/conf/apache/
Look for <Directory />
Make sure that you have the following Options set:
Options Indexes FollowSymLinks
You can also setup a local virtual host for better testing of your WordPress site. It's beyond the scope of this question/topic, but if you'd like I can create an example config file and instructions on how to do that.

Resources