Apache2 Question

Jun 4, 2005
19,723
1
0
I've got all my website files in a directory in my HTDocs folder. Ex, G:/X04D/htdocs/example/

When I navigate to my IP address, ex : 127.0.0.1, it'll bring me to a page that shows me a list of directories. I can see my "example" directory, but I'd rather it if 127.0.0.1 brought me directly to that directory.

I know there's a way to change this in the httpd.conf file, but I'm not sure what to add.

I'd like to keep PHPMyAdmin and whatnot in the htdocs folder, so all I need to change is where it looks for the index file.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It looks for the index file in every directory. If you want G:/X04D/htdocs/example/ to be the root, you need to change DocumentRoot and to keep PHPMyAdmin working you'll need to move it below the DocumentRoot or setup an Alias for it.
 
Jun 4, 2005
19,723
1
0
So something like :

Alias /phpmyadmin/ "G:/X04D/htdocs/phpmyadmin/"

<Directory "G:/X04D/phpmyadmin">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

should work?

EDIT : Decided to just give it a shot and it works.

Thanks a lot!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
EDIT : Decided to just give it a shot and it works.

Amazing how much quicker trial and error is than waiting for someone else to verify your ideas, eh? =)
 
Jun 4, 2005
19,723
1
0
Last time I modified that file with something similar, I ended up screwing a couple things up and re-installing. But...I was almost sure this was the right course of action, so I went ahead and did it. ;)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
A reinstall is almost never necessary, usually only if you have some type of corruption in the files. Apache is very good about telling you what's wrong with it in the error logs.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: LoKe
Last time I modified that file with something similar, I ended up screwing a couple things up and re-installing. But...I was almost sure this was the right course of action, so I went ahead and did it. ;)

Make a copy of the working config before editting it. It saves a lot of trouble. I just wish I remembered that tip more often. :p
 
Jun 4, 2005
19,723
1
0
Originally posted by: n0cmonkey
Originally posted by: LoKe
Last time I modified that file with something similar, I ended up screwing a couple things up and re-installing. But...I was almost sure this was the right course of action, so I went ahead and did it. ;)

Make a copy of the working config before editting it. It saves a lot of trouble. I just wish I remembered that tip more often. :p

Recently I made the move to Linux and back, one of the things I've brought with me is the intelligence to back-up my configuration files. Too bad I didn't think of it before the last time I tried to mess with it. :)
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
Personally, i prefer to use virtual hosts.
that way i can have as many local directories as i want.

something along this line (although I'm not sure if 'servername 127.0.0.1' works - i have my own virtual server name thanks to HOSTS file ,p):

# ===========================
NameVirtualHost *:80

<VirtualHost *:80>
...ServerAdmin phpMyAdmin@web.box
...DocumentRoot "G:/X04D/htdocs/phpmyadmin"
...ServerName 127.0.0.1
...ErrorLog "G:/X04D/logs/phpmyadmin_error_log.txt"
...CustomLog "G:/X04D/logs/phpmyadmin_access_log.txt" common

...<Directory "G:/X04D/phpmyadmin">
......Options Indexes FollowSymLinks
......AllowOverride All
...</Directory>
</VirtualHost>
# ===========================