.htacces Problems

Discussion in 'Setting-up protection' started by thequiksilver, Jul 18, 2003.

  1. Is there something wrong here.

    It told me to create the ".htaccess" and put in the protected directory of my choice so i did:

    http://www.rpmregistry.com/cycle/magazine/
    (a pdf format of our complementary magazine will be available for download here for free but were requiring sign-ups).

    i put this ".htaccess" in there:

    Code:
    AuthType Basic
    AuthName "RPM Cycle Members Only"
    AuthUserFile /Library/Websites/www.rpmregistry.com/amember/data/.htpasswd
    AuthGroupFile /Library/Websites/www.rpmregistry.com/amember/data/.htgroup
    Require group PRODUCT_1
    
    root path: /Library/Websites/www.rpmregistry.com/

    The only thing i question is the "PRODUCT_1", is it always named that in regards to the # next to the subscriptions?

    I really want to use this system for the magazine company i work for and got to present this to the owner, but i atleast need a good working demo before i buy it!!

    Thanks guy!!
  2. abbeyvet

    abbeyvet New Member

    Joined:
    Feb 2, 2003
    Messages:
    135
    Yes, the product entry in the .htaccess file - eg PRODUCT_1- will always corelate with the prduct number in aMember which gives access to that directory.

    This is pretty flexible.

    You can have, for example, multiple products that give access to the same directory by simply adding multipe product numbers to your .htaccess file:

    Require group PRODUCT_1 PRODUCT_12 PRODUCT_41

    And the same product number can appear in as many .htaccess files as you like.


    Does that make sense?
  3. quiksilver

    quiksilver Guest

    Yeah that all makes since bud, but i mean that's what i have done already. I mean i thought that's how it worked but i was just making sure.

    But now i have done all of that, and put the .htaccess in the folder i want to protect, but i go to the directory and no login shows up. I mean i can link it to where they click on "RPM: Cycle" to go and view the magazine, and instead just link it dierctly to the http://www.rpmregistry.com/amember/login.php so it will automatically forward them, however.

    The http://www.rpmregistry.com/cycle/magazine/ , where the actual magazine is at, isn't really protected, and once people find out that address, they can bypass signing up.

    Any more suggestions?
  4. quiksilver

    quiksilver Guest

    Earlier the other day i was trying to install a free calendar script in which people who i give rights to could login and post an event.

    It told me to create the .htaccess also, however it isn't protecting either.

    Is it possible that the company that hosts our site isn't allowing for .htaccess protection? I never heard of that but that's what im beginning to think.

    Another thing i'm questioning is the .htpasswd file? does that contain the correct user and passwords?

    Maybe the biggest problem is i need to understand this htaccess protection better. I looked for a tutorial online and was explained just as well as it was in the installation guide but still isn't working. :(

    hrmm...
  5. abbeyvet

    abbeyvet New Member

    Joined:
    Feb 2, 2003
    Messages:
    135
    Are you trying to install this on the site mentioned in your sig file?

    If so that is hosted on a Mac OSX platform. I have not the faintest idea how .htaccess works on a Mac - maybe its some way different, but I have no clue. I think that is likely the issue though since I have never heard of a *nix server that did not support .htaccess. I know Mac servers do support .htaccess, but that is about all I know.
  6. abbeyvet

    abbeyvet New Member

    Joined:
    Feb 2, 2003
    Messages:
    135
    Ok, did a bit of a Google search and found this:

    By default, Apache on Mac OS X is, of some wierd reason, not by default set up to use the .htaccess feature (don't ask me why!). This is what you have to do in order to enable it:
    1. Open the file /etc/httpd/httpd.conf (either in terminal, with the command "sudo pico /etc/httpd/httpd.conf", or with BBEdit Lite with "Open Hidden" for those that are not familiar with the terminal)
    2. Go down to line 402 where it says "AllowOverride None" and edit it to "AllowOverride AuthConfig".
    3. Save the file.
    4. Launch System Preferences, select the Sharing and then the "File & Web" tab (Personal Web Sharing in 10.2). Stop, if it's already running, and restart this service.


    I assume you will need to get your host to do this for you.
  7. quiksilver

    quiksilver Guest

    your saying www.rpmregistry.com is hosted on mac?

    I dont know much about it either. One weird thing is though, i run the phpinfo(); command to look for my root directory right? this is what i find:

    Code:
    /Library/Websites/www.rpmregistry.com/phpinfo.php
    is the path for that script.

    However, when i run this other free script for posting news, phpnewsmanager, it automatically detects my paths when i go to setup the database and it says this is the path:

    Code:
    /Volumes/XData1/Websites/www.rpmregistry.com/
    ??? I'm confused by this. I remember seeing the /Volumes/XData1/Websites/www.rpmregistry.com/ before when we were on this hosts OLD servers. Then they moved us to newer servers and that's when i noticed it changed to
    Code:
    /Library/Websites/www.rpmregistry.com/phpinfo.php
    in the phpinfo script. However, other scripts still detect the old one?

    Weird.

    However i'm lost and don't know what to do!! I can use the php login to protect but i need the actual folder that contains the pdf format of our magazine to be protected.

    Again, i want to protect
    Code:
    http://www.rpmregistry.com/cycle/magazine/
    with .htaccess so people can't access this folder directly and just take the pdf file. I want it to force people to signup for a free subscription and login to read / download the monthly magazine.

    Maybe another question to ask, does the protected folder need to be in /amember or can it be anywhere??

    I love being a programmer but these are the times i hate!! :)
  8. quiksilver

    quiksilver Guest

    OMG! thank you! :) I don't know if this will work yet but yes, unfortunately they aren't letting the IT department host the website ourselves.

    So therefore yes i will have to talk to the system administrator to see if he will enable it.

    That was a big question though, i just got done emailing our system admin asking him if it is possible if .htaccess protection is turned off? or if that was even possible.

    I had no idea the website is on macs! i guess now i do..

    But im going to forward your message to the system admin to see what he says and if he will do it or not. If not it's one more reason we leave this host and move to a REAL HOST!!

    Thanks again, any more ideas still needed (even confirminations) incase this don't work!
  9. abbeyvet

    abbeyvet New Member

    Joined:
    Feb 2, 2003
    Messages:
    135
    I have to say I agree with you - if I found I was being asked to work on a site that was hosted on a Mac you wouldn't see me for dust :eek: :rolleyes: Even the most dyed in the wool Mac freaks I know host on Linux.


    Just to answer your last question:

    It can be any where. When you are setting up a product you have to enter the url to the protected directory relative to the root.
  10. alex-adm

    alex-adm Guest

  11. quiksilver

    quiksilver Guest

    Thanks for your help guys. That was the problem, it wasn't enabled. Now it is. I have had to ask for so many things to be enabled or turned on its crazy, and now to konw they host on macs? I never heard of such to tell you the truth. Any scripting of any kind, ive always seen the makers talk about being on linux/unix or windows, that's just crazy.

    He did enable it and it is now protected :) So i guess it does work. I know things would be great on a better host.

    I'm going to bring this to the attention of the president that the creator of this beautiful payment system even advices not to use it because our cool little host, hosts our website (and yes they said were now hostesd on their TOP servers) on a mac.

    Thanks again, it works for now but with the problems i deal with them, i dont even know if its worth using in production yet. I'm still going to find a way to use this system though. :D
  12. alex-adm

    alex-adm Guest

    It is very, very recommended to switch to Linux or some Unix. I cannot promise anything if still use it on Mac.
    May be it will work ;)
  13. Ray

    Ray Guest

    Has anyone been able to get .htaccess protection working for a W2K/Apache installation? I know Alex does not officially support anything other than Unix/Linux. Just wondering if others were able to get it working. I have everything working except can't get protection to work. My .htaccess looks like:


    AuthType Basic
    AuthName "Your site protected dir description - possible the same for entire site"
    AuthUserFile c:inetpubwwwrootamember/data/.htpasswd
    AuthGroupFile c:inetpubwwwrootamember/data/.htgroup
    Require group PRODUCT_1 PRODUCT_3

    Any help would be greatly appreciated.

    Ray
  14. Ray

    Ray Guest

    Has anyone been able to get .htaccess protection working for a W2K/Apache installation? I know Alex does not officially support anything other than Unix/Linux. Just wondering if others were able to get it working. I have everything working except can't get protection to work. My .htaccess looks like:


    AuthType Basic
    AuthName "Your site protected dir description - possible the same for entire site"
    AuthUserFile c:\inetpub\wwwroot\amember/data/.htpasswd
    AuthGroupFile c:\inetpub\wwwroot\amember/data/.htgroup
    Require group PRODUCT_1 PRODUCT_3

    Any help would be greatly appreciated.

    Ray
  15. ray

    ray Guest

  16. alex-adm

    alex-adm Guest

    Check Product URL value.

Share This Page