0

I am using Apache 2.2.22 for web hosting and I had created a directory tree like C:/server/www/apacheserver.dev/public_html and put everything (my web page file) inside the public_html, but inside the public_html I still have sub directory file and inside the sub directory file I still have another sub directory file. So my web page directory looked something like C:/server/www/apacheserver.dev/public_html/sub-directory/another-sub-dir and the whole coding is inside the another-sub-dir.

So every time I tried to access into my main page by typing the url, the web page will show index of and there only have one list of file, which is my sub-directory file. If I click the file then I will be redirected to another index list and it is the Index of/sub-directory. There got two types of list. Parent Directory and another-sub-dir and I have no idea where is that Parent Directory came from, because there is no such file inside my directory. But that isn't really the matter.

So, to get access into the main log in of the web page (Index.php), I have to click each of the file. I saw a lot of people post the same question and the only answer that given is add DirectoryIndex index.html index.php and this line already exist inside my httpd.conf. It means that this solution isn't helping me.

Is there anybody who could tell me on how to redirect user to the main page (index.php) without going through the selecting files?

Emerald
  • 101
  • 1

2 Answers2

0

Apache is case sensitive, unless you made a typo in the question, your Index.php file should be renamed to index.php.

Second, it sounds like you need to set the DocumentRoot directive to the correct base directory you want to use for your web content as well.

When no IndexDocument is found, by default Apache will generate a representation of the directory structure with mod_autoindex where the "Parent Directory" is one level up the directory tree.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
  • I checked it many times and the `index.php` is correct. Maybe you're right. I also think that it might be the `DocumentRoot`. I need to check it again and will update the result here. – Emerald Nov 19 '15 at 05:41
  • Hello, it seems like my `DocumentRoot` is correct. This is the site where I refer to for manual installation of Apache and PHP. http://www.bogotobogo.com/php/apache_php_mysql.php . Any clue? – Emerald Nov 20 '15 at 00:57
-1

Are the php package already installed on your server?

You can see https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu