Results 1 to 8 of 8

Thread: apache not serving pages from subdirectory

  1. #1
    Join Date
    Jul 2007
    Beans
    65
    Distro
    Ubuntu 10.04 Lucid Lynx

    apache not serving pages from subdirectory

    I have Joomla installed at /var/www/joomla, if I navigate to http://localhost/joomla, I get a 404 error, but if I add index.php, the page loads. What is wrong?? Also I am not able to navigate to the administration part of Joomla for the same reason, typing in index.php doesn't load it in this case. Yes I have verified that all files are present in the directory.

    This is on 10.04.

  2. #2
    Join Date
    Apr 2011
    Beans
    2

    Re: apache not serving pages from subdirectory

    Add an .htaccess file to the directory with the following line:

    DirectoryIndex index.php

  3. #3
    Join Date
    Jul 2007
    Beans
    65
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: apache not serving pages from subdirectory

    I have added an .htaccess and still no change.

  4. #4
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,376
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: apache not serving pages from subdirectory

    check the permissions on the file/folder
    apache (www-data) will need read access at the very least
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  5. #5
    Join Date
    Jul 2007
    Beans
    65
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: apache not serving pages from subdirectory

    File permissions are 644, folders are 755. One thing I did see is that my user (bjk) is the owner of the joomla foler, does www-data need to own it?

  6. #6
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,506
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: apache not serving pages from subdirectory

    .htaccess files are disallowed by default in the definition in /etc/apache2/sites-enabled/000-default:

    Code:
           <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    You can edit this file as root with sudo and add the DirectoryIndex directive there:

    Code:
           <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    DirectoryIndex index.php
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    or you can change AllowOverride from "None" to "All" to permit .htaccess to override the definition. A safer approach is to choose from among the options as described here.

  7. #7
    Join Date
    Jul 2007
    Beans
    65
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: apache not serving pages from subdirectory

    Quote Originally Posted by SeijiSensei View Post
    .

    You can edit this file as root with sudo and add the DirectoryIndex directive there:

    Code:
           <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    DirectoryIndex index.php
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    I have made this change and still unable to get pages to display unless I type in index.php. I also have restarted my system (and thus Apache)and still no change! GRR!!

  8. #8
    Join Date
    Jul 2007
    Beans
    65
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: apache not serving pages from subdirectory

    GOT IT FINALLY!!!!

    Here is what I added to /etc/apache2/sites-svailable/default

    Code:
    <Directory /var/www/Joomla161/>
                    Options Indexes FollowSymLinks MultiViews
                    DirectoryIndex index.php
                    RewriteBase /Joomla161
                    AllowOverride All
                    Order allow,deny
                    allow from all
            </Directory>
    Once I added the RewriteBase line, things work as they should!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •