1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

apache and passwords

Discussion in 'Linux and Unix' started by buzz01, Feb 13, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. buzz01

    buzz01 Thread Starter

    Joined:
    Oct 21, 2002
    Messages:
    38
    how can you setup apache or is it the file permissions that need to be set for a password prompt? say my server name is server and my user is john, so johns address for his webpage is http://server/~john. then this address is live(on the net) how can i make the system prompt the web user over a browser to enter a user name and password to enter johns webpage?

    and what file needs to be saved in johns root directory for him to have a webpage e.g. index.html -- is it something line public_index.html?
     
  2. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Ok for question number 1:

    "how can you setup apache...to be set for a password prompt?"

    I assume you mean to password protect a resource. This is actually an apache configuration issue and can be set using directives inside the httpd.conf file or from .htaccess files in a served directory (although the file will need to be readable in the system permissions). The syntax is such:

    inside .htaccess file in a served directory that you wish to protect

    Code:
    AuthName "Protected area name (any name can be here"
    AuthType Basic 
    
    require user allowed_user
    
    
    Now when ever someone attempt to access a file from within the directory this .htaccess file resides, they will be prompted to be authenticated as 'allowd_user' (in this example).

    Now I am making assumptions that directive overrides are allowed by .htaccess files in your configuration (this is established in the httpd.conf file) and numerous other assumptions, but if you are using the default config options this should all be easy.
    Late,
    Kyle
     
  3. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Oh and for the second question:

    You must establish an entry in the httpd.conf file and specify a directory to serve.


    Example:
    PHP:

    <VirtualHost *>
        
    DocumentRoot /path-to-users-directory/folder/
        
    ServerName www.your-domain.com #If you wish to implement name based virtual hosting
        #  MANY MANY OTHER DIRECTIVES HERE
        #  all according to your preference

    </VirtualHost>



    Go to apache.org and read some examples and brush up on web protocol theory (pick up Apache the definitive guide an O'reilly book)
     
  4. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Apache.org
     
  5. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Sorry for excessive posts.. these have been removed
     
  6. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Sorry for excessive posts.. these have been removed
     
  7. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Sorry for excessive posts.. these have been removed
     
  8. IIS SUCKS

    IIS SUCKS

    Joined:
    Feb 18, 2003
    Messages:
    7
    Ok there we go
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/118566

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice