Click to See Complete Forum and Search --> : index.html not autoloading .htaccess?


Makron
07-17-2002, 02:29 PM
First off I would like to explain that I've been on linux for the past 45 minutes of my entire life time, so take that for how much of a total newb I am, and how much I really need you to explain in great detail for my feeble brain to comprehend ;) With that said, off to the problem:

I've set up a folder called test in my "document root" (I guess thats what they call it...the /var/www/html/ thing). So basically it would read like this if I wanted to go to it. http://www.myurl.com/test There is also a index.html in that folder.

Now I've placed and set up .htaccess in this test folder so that I can have some ppl log into it and restrict others. That works great.

Here's my problem though. When I go into http://www.myurl.com/test it gives me "The page cannot be displayed" or something to that effect, even after I've logged in with the correct stuff. Now if I type in this http://www.myurl.com/test/ (notice the / at the end of test) then it asks me for the user/pass and it loads the index.html.

What can I do to make it automatically load the index.html when I type the url without the / at the end of it? Is there a feasible way of doing this sort of thing or am I going to have to tell ppl to always add the / or it wont work?

I'll be adding more directories later, and each will have to have a .htaccess for specific users (about 50-100 users total probablly) and they are all going to be very old farmers who are not intelligent about the things of the web, and most are even scared of it. This is the main reasons behind not wanting to go with the "You must put a / at the end of it or it wont work." and then getting 50 phone calls asking me why their stuff wont load. =)

Any help with this problem would be awesome guys because I'm pretty stuck at the moment. Please give me any information or ideas you might have. Thanx again!

Makron
07-17-2002, 02:31 PM
btw...I'm not really sure what I was thinking when i gave this thread the subject that I did. =)

Golden_Eternity
07-17-2002, 05:08 PM
Did you set up a separate <Directory> tag in the httpd.conf file for this directory? If so, post it... you probably have a / at the end in the tag.

Makron
07-17-2002, 05:42 PM
Is there any security risk by placing my httpd.conf on here for everyone to download? If there isnt I'll just attach it because I really dont know if I did or not. I tried not to mess with it too much but who knows, I could have.

lpahdoco
07-17-2002, 06:34 PM
Unless you've left holes for us to get into your system via telnet, ssh, etc and have your file permissions set to allow anyone to modify your important files, you should be able to post it.

If you're uncomfortable, replace your IPs with xxx and post away...

Makron
07-18-2002, 09:49 AM
Bah, I'm not too worried about it. I doubt anyone wants to see a bunch of stuff about farming and wheat, even if they did break in I think my greatest defence is to bore them to death ;)

Ok I've attached it and renamed it to a .txt file. Take a look at her and see if you guys can see where I've gone astray. Thanx much =)

Makron
07-19-2002, 10:24 AM
Well I guess it has everyone stumped. =(

I mean I can kinda see what the server is thinking, I think. Like when I put in http://www.myurl.com/test it's looking for test as a file and when it doesnt find it, it gives that error. But as /test/ it says hey look, this is a folder, I must look for a index.html or whatever is on the list for it to autosearch for. Is there anyway I can change this to make it automatically look for a folder called test (or whatever the folder would be called), no matter what, and make the file search secondary? Or is one of those "The Patriot" things.... "You dream general...sound the retreat." =)

At any rate thanks for all the help guys. Still hopeful things will get fixed.

lpahdoco
07-19-2002, 02:46 PM
Makron --

Finally had a chance to look over your conf, and what you seem to be missing is the actual host definition. At the end of all the default "stuff" it fills in for you, all of my machines also have Virtual Hosts defined at the end. They may have one, may have 200, but they've all got them. Granted, I didn't set them up (came into the Linux deal from being a pure Lotus Domino Admin) and there may be a better way to do this, but it does work. So, try defining your web site at the end of the httpd.conf and reloading httpd.

<VirtualHost ipaddress>
ServerAdmin your@email.address
ServerName www.urlhere.com
DocumentRoot /folder/to/open
ErrorLog /error/log/path
ScriptAlias /cgi-bin /path/to/cgi/directory
Options ExecCgi
<Directory /folder/to/open>
AllowOverride AuthConfig
</Directory>
DirectoryIndex index.html index.htm
</VirtualHost>

apache.org has all the details on the various switches & commands to do things like disable directory browsing, etc. With my sites defined as above, I get the index.html or index.htm out of any directory below the DocumentRoot just by typing in www.mainsite.com/foldername - no trailing slash necessary.

Best of luck.
LP

Syngin
07-20-2002, 10:53 PM
Doublecheck your listed default documents in httpd.conf / apache.conf (same file, different Apache versions) Is index.html listed?

Also, it could be a file ownership error. I ran into that before. Might have to use chown on the file to fix the problem.

Update: Oops. Didn't read the post just before my first. That makes a difference too hehe.:p

Makron
07-30-2002, 01:51 PM
Well I tried the VirtualHost thing and found out there was already some virtual host info in there. Like it had <VirtualHost _default_:433>

And then had default servername and serveradmin info in it, some error log stuff. And it had a weird thing for the directory info so I just went ahead and added in what you told me to do with all the correct information and it still didnt work. Though as messed up as the info looked that was already in there, and the editing I did, its probablly something I put in there wrong that wont allow it to work still that way.

As for the apache.conf, I havent looked at that yet and am about to. Also you said something about ownership, how do I check/fix that, and what is chown? Never heard of it and very new to linux =).

Once again, thanx much guys for the continued help on this matter!

Makron
08-02-2002, 02:37 PM
Just as a final update (maybe), I've decided to go with PHP stuff but need to upgrade to RH 7.3 before I do. Should be in the mail today. After that I'm gonna get the PHP module and give some redirecting scripts a try. You guys think this is an ok solution?