0
votes

I installed APM and wordpress on AWS EC2 by using Ubuntu and all the machines seem to be working well. But the 404 error occur when I try to access http://"myurl"/index.php

Below is my files in /etc/apache2/sites-available/*

000-default.conf 000-default.conf

default-ssl.conf default-ssl.conf

And these are files and folders list in /var/www /var/www

I've also tried removing '/html' from DocumentRoot and made it to be "/var/www" but it's still not working.

I need you guys' help thanks!

2

2 Answers

0
votes

Your config is in /etc/apache2/sites-available/. You shoud "activate" your site by creating config in /etc/apache2/sites-enabled/. You can copy or move your config file there, or just symlink it. But the correct way to do this is by calling a2ensite command:

sudo a2ensite 000-default.conf
0
votes

1) Created a new one by clicking on save button in Settings->Permalinks

Click in the field and press CTRL + a to select all. Paste on .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

2) Enable to mod_rewrite:

sudo a2enmod rewrite

This will activate the module or alert you that the module is already in effect. To put these changes into effect, restart Apache:

3) Go to this file just change "AllowOverride None" to AllowOverride all

sudo nano /etc/apache2/apache2.conf

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted

sudo service apache2 restart

and now that pages started working fine...