I installed drupal for the first time the last couple of days.
I chose 8.0-alpha4.
I am on an Ubuntu Linux 12.04 PreceisePangolin machine.
I have Apache, MySQL and PHP5 installed as well.
I fumbled my way through the entire installation, and got to the
success page where it says:
"Drupal installation complete. Visit your new site."

I click on that link, which is:
http://localhost:2345/drupal/
(side note: I have an ssh tunnel going from my local machine port 2345 to my remote Linux machine in cyberspace at port 80)
and I get the Drupal "Welcome to localhost" page.
(and I am logged in automajically as "admin")

So far so good.

But then, no matter what I click, I get the "Not Found" message:

For example:
If I click on the Menu-->Content link, which maps to http://localhost:2345/drupal/admin/content,
I get a page with this:

Not Found
The requested URL /drupal/admin/content was not found on this server.

If I click on "logout", I get:

Not Found
The requested URL /drupal/user/logout was not found on this server.

So on and so forth.

The solution must be simple...

Comments

gmoore777’s picture

I did 3 things to get the basics to work.

1.)
I edited these 2 files:
/etc/apache2/sites-available/default
/etc/apache2/sites-available/default-ssl

In the first 2 blocks, for "/" and "/var/www/", I changed the line of:
AllowOverride None
To:
AllowOverride All
2.)
I installed the "rewrite_module" for apache by running this command:
$ sudo a2enmod rewrite
Enabling module rewrite.
$

I test to see if this is true by running:
$ sudo apache2ctl -M | grep -i write
rewrite_module (shared)
$

3.)
Then restart apache2 via:
$ sudo service apache2 restart;
$

I can now browse to the most basic pages of the drupal home page.

P.S.:
This link helped:
https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles
and another suggestion of typing junk into /var/www/drupal/.htaccess.
If I didn't get a basic parsing error or "Internal Server Error" for apache loading the .htaccess file, then that proved that apache was not loading up the .htaccess files and I needed to continue troubleshooting until I got the parsing errors.

jorgemontoyab’s picture

Thanks a lot!

arantas’s picture

This was very useful, many thanks!

SolidSnakeGr’s picture

After checking my apache2/sites-available folder I noticed that I only had 000-default.conf, default-ssl.conf and no default.conf file.
So firstly I created that by using : cp 000-default.conf default.conf and then I followed these two steps of your solution :

1. sudo a2enmod rewrite
2. sudo service apache2 restart

So, thank you for your help as your post solved my problem!

tejalverma’s picture

hey, this approach solved my problem but i did not understand what exactly is happening in the background.

could you please breakdown the steps and explain why we are firing those commands and how they are resolving the error? also why am i getting this error ?

Anonymous’s picture

I'm new at Drupal, have installed both Drupal 7 and Drupal 8 on my linux machine for learning.

Drupal 7 by default works as it should but Drupal 8 returned the above error and this solution works.

Thanks very much

dalesawanas’s picture

I am using Amazon Linux and my situation is exactly like yours, but as for your solution...I cannot locate the: /etc/apache2/sites-available/default and the
/etc/apache2/sites-available/default-ssl files as I cannot find the apache2 directory. I've looked everywhere and I get the same screen error when I click on any of the management links...The requested URL /admin/content was not found on this server.

Do you think I should close down the instance and use a different server? Such as Ubuntu?

bachou’s picture

This was very useful!

pleomati’s picture

mod rewrite was on and i solved this by upload missing .httacess because it is missing in tar.gz install pack,i get this from zip pack.

nrezmerski’s picture

I ran into the problem with .htaccess being missing and preventing Clean URLs from working. I uploaded the Drupal files using Cyberduck but didn't know there were hidden files in the folder.

My question is, why does Drupal try to send you back to Clean URL /admin/content after saving a piece of content, when Clean URLs are not enabled?

It would be helpful to add a message explaining what's wrong and how to fix it, rather than letting the user see a 404 page.

Graham Leach’s picture

UBUNTU SPECIFIC (YMMV)

1. Enable web server rewrite functionality

    #a2enmod rewrite

2. Edit the appropriate file in your apache2 setup, for the domain in question

    #cd /etc/apache2/sites-enabled

    #vi <domain name>.conf

....add this stanza before the tag for the relevant website....

    # This setting is necessary for clean URL's in Drupal
    <Directory "<path to your Drupal directory>">
        AllowOverride All
    </Directory>

3. Restart apache2

#service apache2 restart
davidsutton1’s picture

Thanks Graham Leach, just installed live site on local host had error as above, your advice solved problem.

Fawad Ali’s picture

hello Sir i try the same steps but its not working for me ... can you please help me out how to solve it

SolMxGdl’s picture

I was having this issue and after search for a while your answer was what helped me. Thank you

Fawad Ali’s picture

hello Sir how you solve this problem please can you help me out

amarphule’s picture

Thank you, Graham Leach, This works for me.

berramou’s picture

  1.  add the following  to the file  "/etc/apache2/apache2.conf " 

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

  1. restart your server :  sudo service apache2 restart .
prsnjtbarman’s picture

Thanks

MykeC’s picture

After installing Drupal 8 to a "drupal/" subdirectory in my docroot using Linux Mint 19, I too can confirm the need to add what @berramou suggested to "/etc/apache2/apache2.conf" following the usual Apache restart in order to coax the login, contact, and search (etc.) pages to be found.  I am new to Drupal and this was a showstopper for me before I learned this solution.

nitin.k’s picture

I am using Apache2 on ubuntu 18 platform, Drupal 7.67 works post installation without errors but Drupal 8.7.7 throws the same issue.  It was resolved by above config.

Thanks