Apache2 Public directory on Ubuntu server 7.10

Discussion in 'Server Operation' started by loben, Jan 3, 2008.

  1. loben

    loben New Member

    Hi
    Where do I find the Apache2 Public directory on my Ubuntu 7.10 server. Couldt
    it be /var/www/ . When I'm installing an application for example PhpGdeView is it there where I save the application files??
     
  2. petter5

    petter5 New Member

    WWW location

    Yepp, it's /var/www/ if you use a default config.:D
     
  3. loben

    loben New Member

    Hi thank's for answer
    Ok, but why dosn't the server answer for index.php, couldt it be something whit my PHP configuration ?? The server answer for htm, and html but not for php.:confused:
    The browser try to open a file instead of running the file and the database configuration he should open....why
     
    Last edited: Jan 4, 2008
  4. petter5

    petter5 New Member

    in the file /etc/apache2/apache2.conf

    make shure that you have index.php in the DirectoryIndex statement:

    example:



    Code:
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

    / Petter
     
  5. loben

    loben New Member

    /etc/apache2/apache2.conf

    Hi Petter5
    Thank's for answer.
    I don't have the line
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
    in my apache2.conf file, but where in that file should I put it in.

    In my /etc/apache2/mods-available/dir.conf I have the lines

    <IfModule mod_dir.c>

    #DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml

    </IfModule>


    Isn't that enought for the server to know the index.php
     
    Last edited: Jan 4, 2008
  6. petter5

    petter5 New Member

    Well, the index.php is located inside a if module. Then IF you not load this module THEN index.php will not be valid.

    You can try to add

    Code:
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
    outside the if statement, save the file and run
    Code:
    /etc/init.d/apache2 reload
    to reload the configuration before you try once more

    / Peter
     
  7. loben

    loben New Member

    DirectoryIndex index and so on......

    Hi
    Ok but i dont understand the configuratin Where is the line for
    DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
    comming in. In the HowTo it says that the line should bi in the file
    /etc/apache2/mods-available/dir.conf: and I changed that line.

    In the /etc/apache2/apache2.conf there is nothing about this
    configuration htm or php. Did you meen that the line shuld be aut of
    the if statement in /etc/apache2/mods-available/dir.conf
    in that statement there alredy was a line with php and html after the installation.

    sorry I don't get it and it dosn't work, but I will tray again........:)
     
  8. falko

    falko Super Moderator Howtoforge Staff

    Please try this:
    Code:
    cd /etc/apache2
    grep -R DirectoryIndex *
    What's the output?
     
  9. loben

    loben New Member

    :/etc/apache2# grep -R DirectoryIndex *
    mods-available/dir.conf: #DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
    mods-available/dir.conf: DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
    mods-enabled/dir.conf: #DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
    mods-enabled/dir.conf: DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
     
  10. falko

    falko Super Moderator Howtoforge Staff

    Open mods-available/dir.conf and change
    Code:
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
    to
    Code:
    DirectoryIndex index.php index.html index.htm index.shtml index.cgi index.php3 index.pl index.xhtml
    Restart Apache afterwards.
     
  11. loben

    loben New Member

    DirectoryIndex index and so on....

    Hi Falko
    Thank's for helping me.
    Now it works, thank's alot for the help. I was taken the DirectoryIndex line from the Howtoforge description, was it something wrong whit that line? Well it works for me know and I can go on working until next problem comes up.

    Thank's again for the Howtoforge site :)

    /loben
     
  12. falko

    falko Super Moderator Howtoforge Staff

    This means that you had another index file in the directory that was listed before index.php. By making index.php the first one in the DirectoryIndex line it is now being called instead of the other index file.
     

Share This Page