[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

How do you make a web folder default to index.php?

We have a lamp box set up where I work.  Not much support on it. :(
I am testing different ecommerce packages built in PHP/MySQL.

I am creating different folders for each application.  So for example,

Say lamp.mycompany.com is the server name.  I have created
lamp.mycompany.com/store1
lamp.mycompany.com/store2
lamp.mycompany.com/store3

The only problem is that in my browser I have to put lamp.mycompany.com/store1/index.php to actually find the store.  I know there is a way to automatically refer it to index.php, can someone please tell me how?  Assume I am a newb at this (cuz I am...)


0
snyperj
Asked:
snyperj
  • 5
  • 3
  • 2
  • +1
1 Solution
 
michofreihaCommented:
in httpd.conf you should add this page as follow:

DirectoryIndex index.html index.htm index.php
0
 
michofreihaCommented:
If you need any other page name you can just add it here as follow:

DirectoryIndex index.html index.htm index.php testpage.html testpage.php
0
 
snyperjAuthor Commented:
where do I find httpd.conf?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
michofreihaCommented:
/usr/local/apache2/conf/httpd.conf or make find / -name httpd.conf to find the path of your file
0
 
snyperjAuthor Commented:
well I have a /usr/local but then I don't have an apache2 folder.  I have the following folders in local:
bin
games
include
lib
man
sbin
share
src

I looked through each of those but don't see a conf folder.  I only have access through WINSCP, so I don't think I can do the "find" that you layed out.
0
 
michofreihaCommented:
which Linux version are you using?
0
 
michofreihaCommented:
try /etc/apache2, do you have something like that?
0
 
Luqman ShantalPrincipalCommented:
The search command should be: find / -name httpd.conf -print

But I'm sorry, since I couldn't identify your Linux distro, cause this conf is relevant to redhat like systems.

Other distributions have other names for apatche.

To get past this, run the ntsysv command till you find some thing that includes apatche or http . .

Another way is this command:

chkconfig --list |grep http

or

chconfig --list |grep apache

Good luck!

 
0
 
Luqman ShantalPrincipalCommented:
I forget to add that the path of this file on RHEL5 for example is:

/etc/httpd/conf/httpd.conf

so you just need to do the following:

1- vi /etc/httpd/conf/httpd.conf

2- /DirectoryI

and press enter

3- Go into the editing mode by pressing I then type your page name as shown above (the first answer)

DirectoryIndex  index.php hello.html  index.html index.html.var

4- Save your changes by shift+z+z or :wq!

5- Restart the apache service, in my case it's name is httpd

service httpd restart

6- And here you go!
0
 
snyperjAuthor Commented:
thanks for the help
0
 
IulianSurgiuCommented:
Change in your httpd.conf


DirectoryIndex index.html index.htm index.php
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now