PDA

View Full Version : Apache2 Public directory on Ubuntu server 7.10


loben
3rd January 2008, 15:36
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??

petter5
4th January 2008, 00:23
Yepp, it's /var/www/ if you use a default config.:D

loben
4th January 2008, 01:12
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

petter5
4th January 2008, 10:59
in the file /etc/apache2/apache2.conf

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

example:



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


/ Petter

loben
4th January 2008, 13:04
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

petter5
4th January 2008, 16:34
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

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

outside the if statement, save the file and run

/etc/init.d/apache2 reload to reload the configuration before you try once more

/ Peter

loben
5th January 2008, 03:09
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........:)

falko
5th January 2008, 14:28
Please try this:
cd /etc/apache2
grep -R DirectoryIndex *What's the output?

loben
5th January 2008, 15:08
:/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

falko
6th January 2008, 14:27
Open mods-available/dir.conf and change
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl index.xhtml
to
DirectoryIndex index.php index.html index.htm index.shtml index.cgi index.php3 index.pl index.xhtml
Restart Apache afterwards.

loben
6th January 2008, 15:14
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

falko
7th January 2008, 15:14
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
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.