Web Hosting Talk







View Full Version : .htaccess on RAQ4


madmax
03-01-2001, 05:09 PM
I have searched, read & followed all of the posts from chicken & other honorable members re: htaccess.

I have a Raq4 and none of them seem to work!

I have created the .htaccess file and run htpasswd which asked me for a password and then confirm it. Everything seem ok.

I have looked in the httpd.conf file for the AllowOverride option (which is not there at all) I found these instructions in the access.conf file.

I even restarted apache....but it allows me access with no password dialog appearing.

Help.......

Chicken
03-01-2001, 10:25 PM
My guess: it is ignoring .htaccess files. Test this by putting in a simple ErrorDocument .htaccess and seeing if you get the page. If not, it is certainly ignoring the .htaccess file.

Test:
ErrorDocument 404 /path/to/404.html

-be sure the path is correct, since obviously, if the file isn't where you say it is going to be above, then this won't work regardless :)

allan
03-01-2001, 11:23 PM
One other thing...make sure you have a default document in your password protected directory. If you do not have an index.html (htm, etc) the password protection may not work.

Okay, I lied, one other other thing...make sure AUTH_PAM is enabled.

madmax
03-02-2001, 04:46 AM
Thanks for the response chaps but so far....no change.

I have altered the htaccess file to this:-

ErrorDocument 404 /cobalt_error/filenotfound.html
AuthUserFile /home/sites/site86/web/stats/.htpasswd
AuthGroupFile /dev/null
AuthName "Site Statistics"
AuthType Basic
AuthPAM_enabled off
require valid-user

The page showed index.html (and not 404.html).
index.html is the default doc.

Any ideas?

allan
03-02-2001, 07:24 AM
Max,

Do you mind letting us know what your URL is, I would like to take a look? Everything seems right at first glance.

Thanks

Chicken
03-02-2001, 09:31 AM
Ok, well I don't think you did the test correctly. You were supposed to cut out everything else *but* that ErrorDocument line (only have that), and create your own Error Doc, put the path in to it and then type in:

domain.com/ikuhsadfojih.html

-and see if you reached the page or not. If not, then it isn't picking up the .htaccess file (which was my guess).

Anyway, skipping that part, if I'm right, this is what I suggest you try:

Note: Do this at your own risk. If you don't feel comfortable altering these files, don't do it and let someone else do it for you (your provider).

First, find out the site number of the site (you can do this via FTP). Mark it down somewhere.

Login via telnet to server.
Su to root and type:
pico /etc/httpd/conf/access.conf

Scroll down to the very end and you should see:
# You may place any other directories or locations you wish to have
# access information for after this one.

Add:
<Directory /home/sites/site#>
AllowOverride All
Options All
</Directory>

*Replace '#' with the actual site number.

When finished, CTRL+X to exit, type Y, then hit ENTER.

Then restart httpd:
/etc/rc.d/init.d/httpd start

Web server should restart, if not, you've got other problems. It is *never* a bad idea to *first* backup the access.conf file in case you need to restore it (to get the server back up).

If I was right, then this should solve your problem and the .htaccess pass protect thing that you had (without the ErrorDocument line), should work now. This assumes that you set it up correctly of course. If it isn't right, then this won't work (I'm sure you realize this).

I can't stress this enough:
If you don't feel comfortable altering these files, don't do it and let someone else do it for you (your provider).

allan
03-02-2001, 09:46 AM
Originally posted by Chicken

pico /etc/httpd/conf/access.conf


pico?? Chicken, you're such a lamer :D :D

Real geeks use vi

Chicken
03-02-2001, 10:39 AM
LOL... I shamefully tell you that I've never vi'd, heh. I'm only a part-time geek :)

madmax
03-02-2001, 01:27 PM
Thanks chaps.

I had tried somthing similar in access.conf already. But I threw it out and replaced it with your Directory Tags.

Still no change.

I am afraid that the server in question is on our intranet and therefore I cannot give you access. But I hope that you will stick with it and help me out!

P.S. I used emacs so I guess I don't qualify as a geek at all!!

Cheers

Chicken
03-02-2001, 10:07 PM
Originally posted by madmax
I have altered the htaccess file to this:-

ErrorDocument 404 /cobalt_error/filenotfound.html
AuthUserFile /home/sites/site86/web/stats/.htpasswd
AuthGroupFile /dev/null
AuthName "Site Statistics"
AuthType Basic
AuthPAM_enabled off
require valid-user

The page showed index.html (and not 404.html).
index.html is the default doc.

Any ideas?



Really, I'm nearly out. I'd think it should work by now, but lastly:

order allow,deny
allow from all
require valid-user
AuthName "Site Statistics"
AuthPAM_Enabled off
Authtype Basic
AuthUserFile /home/sites/site86/web/stats/.htpasswd

If that doesn't work, I have no idea...

Last idea: you *are* uploading the .htaccess file in ascii mode and *not* binary, riiiiiight? I know, I'm reaching here.

[Edited by Chicken on 03-02-2001 at 09:10 PM]

Félix C.Courtemanche
03-02-2001, 10:10 PM
unless you use 'cat' from time to time...

Your apache has not been recompiled, right? Did you change _anything_ at all regarding the httpd.conf, srm.conf before this problem?

Make sure that you are uploading the .htaccess file at the RIGHT location (in the root directory from which you want it to take affect, it must not be lower than your /web directory.)

madmax
03-03-2001, 06:10 AM
Well, I'm not uploading the htaccess file at all. I am creating / editing on the box using emacs.

I have also added a line to httpd.conf reagrding the Error with SSL & IE5. But I don't think that it's related.

Re : The location of the file I have experimented with this a little. It's currently in the /web directory but I have also tried in the /web/stats/ directory. with no effect.

I have not recompiled apache at all.

<--
I'll confess now to being an NT geezer and not a *nix bloke.

I thought I was doing quite well. Our Company decided to buy new intranet servers to run our IIS / SQL7 applications on. Unfortunately (stupid accountants) purchased RAQ4's thinking we would just load NT & SQL and off we go!!

But I absolutely can't stand being defeated by machines (or accountants) and so have migrated the applications anyway. Thanks to you guys I have picked up loads of info on this forum way before posting this thread. I Think this is the last remaining issue & I'm done. (Until the plonkers ask me to migrate it to a Psion Revo or somthing).

So thanks so far!
-->

domus
03-03-2001, 01:49 PM
i have the same problem i have raq4
and my .htaccess files simply dont work
i tried all kind of things
i puted this in apache

#
# AccessFileName: The name of the file to look for in each directory
# for access control information.
#
AccessFileName .htaccess
restarted it
and again the same
i simply dont know what to do what do you think !!!

Chicken
03-03-2001, 04:09 PM
Guys, I've been in Domus' machine, and I'm stumped. It all looks fine, but it doesn't work. Completely ignores .htaccess files, even though AllowOverrides is set to On, and blah blah blah... anyway, if this was my machine I'd have virtually beat it by now, so maybe anyone else has a clue.

NOTHING seems wrong. :confused:

allan
03-03-2001, 04:23 PM
domus,

Go ahead and e-mail me your information and I will take a look :).

allan

allan
03-04-2001, 12:48 AM
I think I fixed the problem. The files were all owned by admin. I changed the owner to nobody and got prompted for a password :).

Of course it may have been fixed somewhere else along the way and I didn't realize it.

AlaskanWolf
03-04-2001, 12:55 AM
Well Im stumped. I got a Raq4 and a user is trying to create his own custom 404, in the past this has worked fine, I went to the cobalt list, found the same problem, and they said the fix was to replace the access.conf file with the master file (i was getting a 500 error)

That seemed to fix the 500 error, but his 404 still doesnt work, its just a simple htaccess file with no password protecting...

suggestions?

madmax
03-04-2001, 05:41 AM
uuallan, which files did you change the ownership of.

I changed the ownership of the .ht files (no change) and then all of the HTML files (no change).

What were the final changes you made to the access.conf before you noticed that the problem was fixed.

AlaskanWolf
03-04-2001, 08:29 AM
I found the fix, edited the access.conf file and changed

AllowOverride None

to

AllowOverride All

allan
03-04-2001, 09:07 AM
Originally posted by madmax

What were the final changes you made to the access.conf before you noticed that the problem was fixed.


I made no changes to the access.conf file (although I did confirm that the RaQ 4 patch 7709 was installed.

I changed permissions on the actual directory and all files in that directory:

(as root)

chown -R nobody directoryname/

allan
03-04-2001, 09:17 AM
Originally posted by PepsiCoke
I found the fix, edited the access.conf file and changed

AllowOverride None

to

AllowOverride All



Cool -- glad you fixed it. For all that have this problem on the RaQ 4 make sure you install the Cobalt patch that fixes this:

ftp://ftp.cobalt.com/pub/packages/raq4/eng/RaQ4-en-OSUpdate-1.0.pkg

allan

domus
03-04-2001, 10:26 AM
[dpavesic dodo]$ cat /etc/httpd/conf/access.conf
##
## access.conf -- Apache HTTP server configuration file
##

# access.conf: Global access configuration
# Online docs at http://www.apache.org/

# This file defines server settings which affect which types of services
# are allowed, and in what circumstances.

# Each directory to which Apache has access, can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).

# Originally by Rob McCool

# First, we configure the "default" to be a very restrictive set of
# permissions.

<Directory />
Options None
AllowOverride AuthConfig Indexes Limit
AuthFailDelay 2000000
</Directory>

# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.

# deal with symlinks in image directory
<Directory /usr/admserv/html/.cobalt/images/>
Options +SymLinksIfOwnerMatch
</Directory>

# This should be changed to whatever you set DocumentRoot to.

<Directory /home/sites/>

# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".

# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.

Options Indexes FollowSymLinks Includes MultiViews

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options","FileInfo",
# "AuthConfig", and "Limit"

AllowOverride All

# ignore .ht*
<Files ".ht*">
deny from all
</Files>

# Controls who can get stuff from this server.

order allow,deny
allow from all

AuthFailDelay 2000000

# Frontpage subwebs use a nice mix of pam and Basic authentication
AuthPAM_FallThrough on

</Directory>

# be more restrictive within a site
<Directory /home/sites/*/>
Options -FollowSymLinks +SymLinksIfOwnerMatch
</Directory>

# @@ServerRoot@@/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.

#<Directory /home/httpd/cgi-bin>
#AllowOverride None
#Options ExecCGI
#</Directory>

# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your_domain.com" to match your domain to enable.

#<Location /server-status>
#SetHandler server-status

#order deny,allow
#deny from all
#allow from .your_domain.com
#</Location>

# There have been reports of people trying to abuse an old bug from pre-1.1
# days. This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging
# script on phf.apache.org. Or, you can record them yourself, using the script
# support/phf_abuse_log.cgi.

#<Location /cgi-bin/phf*>
#deny from all
#ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
#</Location>

# You may place any other directories or locations you wish to have
# access information for after this one.


<Directory /home/sites/home>
AllowOverride All
Options All
</Directory>

madmax
03-04-2001, 05:37 PM
Sorted!!

I removed the stuff from the access.conf and changed the ownership of the whole directory as advised.

Worked like a charm. Thanks guys.

I have tried this on several sites to confirm it and also a backup server and all work fine!!

I would recommend that anyone with the same problem on a RaQ4 try this solution.

gertiebeth
03-09-2001, 01:59 AM
After doing a keyword search, I found the answer to my question "how do I get my RaQ4i to accept my .htaccess files so I can run my 404 finders?" but my problem is I have a very limited knowledge base of all this telnet/shell stuff. Can someone simplify it for me, keeping in mind I can only telnet into my server and pico a file then re-boot my server. (I changed SSI permissions from .SHTML to .HTML, so learned what telent was!)

Also, when software opens a .PKG file, and how do you install the RaQ patches? Pretty big question, I know, but can someone point me to a good tutorial? http://www.cobalt.com/support/createpackage.html is all I've been able to find, and that page might as well be in Klingon. ;)

Thankin' You!

allan
03-09-2001, 02:26 AM
Gertie,

I'll answer your questions in reverse order :):

First download the package to your computer.

To install a Cobalt .pkg file is easy. Log into your RaQ control panel: http://raqname.domain.com/admin

From the menu on the Left Hand side of the page choose Maintenance. At the top of the Maintenance Page you will see a list of options, click Install Software. Use the Browse button on that page to find the software on your hard drive. Once you have found it click "Install a .pkg Package File".

Now go get a cup of coffee or something while the RaQ uploads the file and installs it. If you come back and see no errors, and you see it among the list of installed software on that page, then you are ready to go.


Onto the custom error pages. You do not necessarily have to do this on the RaQ itself. You can create a plain text file on your machine and either call it .htaccess or if your editor won't allow you to name it that, call it something else and you can rename it when you upload it to your RaQ. If all you are doing is customizing a 404 Error message you only need a single line in your .htaccess file:

ErrorDocument 404 /home/sites/site#/web/error/errorfile.html

Just replace the path with whatever you want.

iplexx
03-09-2001, 11:54 AM
I've my RaQ4 up-to-date with cobalt patches & did not modify any httpd conf files...

I tried to add .php3 extension for a costumer via .htaccess but it didn't work; apache error log gave me
"/home/sites/site23/web/.htaccess: AddType not allowed here"

Trying around with .htaccess files showed that I'm not allowed to do anything with htaccess files, not even an 404 ErrorDoc!

/home/sites/site23/web/.htaccess: ErrorDocument not allowed here
/home/sites/site23/web/sub/.htaccess: ErrorDocument not allowed here
/home/sites/site23/.htaccess: ErrorDocument not allowed here

Any ideas how to "enable" .htaccess? Thx!

gertiebeth
03-09-2001, 11:55 AM
Thanks for your reply uuallan! I installed ftp://ftp.cobalt.com/pub/packages/raq4/eng/RaQ4-en-OSUpdate-1.0.pkg but it said the software was already installed. Is the above .pkg file the one that fixes the .htaccess problem? Because I still can't get my .htaccess files to work. PepsiCoke said:
"I found the fix, edited the access.conf file and changed

AllowOverride None

to

AllowOverride All"

Is *this* what I need to do? If so, do I need to be a SuperUser in telnet, and do I need to reboot after changing it?

Thanks so much for your help people! This board has proved to be a lifesaver for this new Raq owner!!! :)

allan
03-09-2001, 12:05 PM
Gertie,

The patch should correct the problem. To make sure, login as admin and su root then edit this file:

/etc/httpd/conf/access.conf

(if you plan on screwing it up make a backup copy first :))

Look for the line that reads AllowOverride None and change it to AllowOverride All.

Save the file and then restart web services:

/etc/rc.d/init.d/httpd.init restart

It should work. If you are still having problems, e-mail me off-board and I will take a look :).

allan
03-09-2001, 12:07 PM
Originally posted by iplexx

Any ideas how to "enable" .htaccess? Thx!

That's very odd. Do you have root access to the server, it is possible that your web host does not want you to use .htaccess. If its your own server, if you would like I can take a look for you. I'm not sure what else would need to be done though.

gertiebeth
03-09-2001, 01:01 PM
Originally posted by gertiebeth
Thanks for your reply uuallan! I installed ftp://ftp.cobalt.com/pub/packages/raq4/eng/RaQ4-en-OSUpdate-1.0.pkg but it said the software was already installed. Is the above .pkg file the one that fixes the .htaccess problem? Because I still can't get my .htaccess files to work. PepsiCoke said:
"I found the fix, edited the access.conf file and changed

AllowOverride None

to

AllowOverride All"

Is *this* what I need to do? If so, do I need to be a SuperUser in telnet, and do I need to reboot after changing it?

Thanks so much for your help people! This board has proved to be a lifesaver for this new Raq owner!!! :)


Thanks! I edited the file, but now I can't remember how to re-boot! <sheepish grin>

allan
03-09-2001, 01:16 PM
(Also sent this via e-mail)

No problem.

You should not have to reboot the server, you should just need to restart Apache web services. You can do this by typing the following (as root):

/etc/rc.d/init.d/httpd.init restart

That should do it.

If, you think it needs to be rebooted, you can this by typing the following:

shutdown -r now

That will do a shutdown and reboot immediately. If you want to give it some time (if there are other users on your system), you can put a time in seconds:

shutdown -r 300

will do a shutdown in 5 minutes. And if you ever just give up and don't want to deal with it any more:

shutdown -h now

this shuts it down, but does not reboot :).

gertiebeth
03-09-2001, 01:38 PM
OK, I think I probably am confused by the "as root" part of your message. I
am in via telnet as admin, but when I type in:

[admin admin]$ /etc/rc.d/init.d/httpd.init restart

it says "no such file or directory"

?

Chicken
03-09-2001, 01:47 PM
When you telnet in as admin, you can switch to root, by typing:

su
-then entering your admin password (again) and hitting enter.
You will now see that you are logged in as 'root' :)

The proper path top restart httpd is:
/etc/rc.d/init.d/httpd restart

gertiebeth
03-09-2001, 01:51 PM
Ahhhhhh... Switching to root is the same as logging in as SuperUser. :) You guys rock! Now I'mm off to see if my 404 finders work. ;)

gertiebeth
03-09-2001, 01:58 PM
*sigh* My problem still isn't solved. :( Sorry if I'm being a pain...

I edited the access.conf file from:

"AllowOverride None

to

AllowOverride All"

then restarted Apache. My .htaccess file consists of this only:

"ErrorDocument 404 http://www.keanu.org/404/404.cgi?404"

and now I'm having the same problem as before. Not being able to even see my site. http://keanu.org

If you can help me further, I'd really appreciate it. :)

gertiebeth
03-09-2001, 02:07 PM
This is *exactly* what my access.conf file says:

#<Directory /home/httpd/cgi-bin>
#AllowOverride All
#Options ExecCGI
#</Directory>

Now, is there maybe more than one access.conf file on my server? I do have several domains hosted...

allan
03-09-2001, 02:18 PM
Originally posted by gertiebeth
This is *exactly* what my access.conf file says:

#<Directory /home/httpd/cgi-bin>
#AllowOverride All
#Options ExecCGI
#</Directory>

Now, is there maybe more than one access.conf file on my server? I do have several domains hosted...

No, there is only one access.conf file on your server.

Ahh...you changed the wrong one :). That one should remain as none. The one you want to look for will be around here:

AllowOverride All

# ignore .ht*
<Files ".ht*">
deny from all
</Files>

It may already be set to all. CAn you post the contents of your .htaccess file?

We'll take a look at it.

Chicken
03-09-2001, 02:20 PM
You changed the wrong one... you'll want to change that back and if you hold a sec, I'll show you the correct place... you seem to be here, so hold a sec... this message will be edited

Chicken
03-09-2001, 02:22 PM
Ok, here you go. Look for this section:

Options Indexes FollowSymLinks Includes MultiViews

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"

AllowOverride All

# ignore .ht*
<Files ".ht*">
deny from all
</Files>

# Controls who can get stuff from this server...

After you change back the other part and change this, restart httpd as you did before.

I'll also add that there is a fair to good chance this is alread set to ALL, and if that is the case, then you should check out the CHROWN discussions. I didn't have to do it, but at least two others did...

gertiebeth
03-09-2001, 02:22 PM
Good grief! My blonde roots are showing. ;)

My .htaccess file consists of this only:

ErrorDocument 404 http://www.keanu.org/404/404.cgi?404

I'm off to edit the access.conf file again.

allan
03-09-2001, 02:27 PM
Gertie,

If it still does not work, I would suggest three things:

1. Replace the url with the server path (eg: /home/sites/site#/web/404/filename).

2. Use a static file instead of a CGI file
(eg: /home/sites/site#/web/404/404.html).

3. Bear in mind that Keanu Reeves is like so 1996 and stuff :).

gertiebeth
03-09-2001, 02:41 PM
OK, the section you are talking about says:

Options Indexes FollowSymLinks Includes MultiViews

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"

AllowOverride AuthConfig Indexes Limit

# ignore .ht*
<Files ".ht*">
deny from all
</Files>

OK, so does the AuthConfig Indexes Limit get deleted when I add All? I want to be sure so I don't screw this up...

gertiebeth
03-09-2001, 02:44 PM
Hey! You dissin' my Ke Man? ;)

allan
03-09-2001, 02:47 PM
Originally posted by gertiebeth

OK, so does the AuthConfig Indexes Limit get deleted when I add All? I want to be sure so I don't screw this up...

That's correct. All you want is:


AllowOverride All

gertiebeth
03-09-2001, 02:57 PM
Yippie Skippy! Check this out!:

http://keanu.org/thisfileisnothere.html

Thank you a million times over for your help chicken and uuallan! <smooch>

allan
03-09-2001, 03:00 PM
That's awesome!! Now, that you are a hardened seasoned RaQ veteran, make sure you stick around and share your knowledge with others :).

Chicken
03-09-2001, 03:02 PM
Glad to help, but NEXT TIME, could you please warn me when I'm about to view keanu boobies and backshots? ::shudder:: :)

iplexx
03-09-2001, 04:34 PM
If its your own server, if you would like I can take a look for you.

It's my own server. Allan, thanks for the :agree: offer, but (nothing personal! :beer: ) letting somebody else mess around on my system is really the very last thing I would do for solving a problem.... ;) well, I'll try to fix it or... you'll see...


AllowOverride All


I'm not sure if it's not a security risk to allow users to modify ALL in their .htaccess...

Better be off just to enable what you need (see http://httpd.apache.org/docs/mod/core.html#options)

I think it also should be possible to add a <Directory /home/sites/siteXX/> directive to access.conf to just allow a specific site to modify specific options with htaccess files.


Eh, Chicken, hopefully your're not under shock for too long now! :D

iplexx
03-09-2001, 04:38 PM
btw, access.conf & httpd.conf & srm.conf are used by the apache. what for are the *.conf.master? does the RaQ use it, generate the *.conf's from it, or just backup copies maintained by the RaQ?

Chicken
03-09-2001, 10:53 PM
Originally posted by iplexx
I think it also should be possible to add a <Directory /home/sites/siteXX/> directive to access.conf to just allow a specific site to modify specific options with htaccess files.


Eh, Chicken, hopefully your're not under shock for too long now! :D

Yes, that's how I *was* doing it, until I found myself doing it for nearly every site and just decided the hell with it :)

(Ohhh, and the images still haunt me)

dennism220
06-19-2002, 04:13 PM
First, find out the site number of the site (you can do this via FTP). Mark it down somewhere.

I haven't been able to find a quick way of finding a particular domains site number. Any suggestions?

Thanks,

Dennis