Solved

Cern Acces file (.htaccess) ?

Posted on 1997-06-25
1
342 Views
Last Modified: 2012-06-27
I run a Cern server as our Web-server.
What i was wondering was how to set a .htaccess setup, is that possible with cern-server ?
I been at www.w3.org and gone true the whole documention, and tryed all kind of stuff (without progress).
So if someone know how to do it, please let me know.

/Christer
0
Comment
Question by:wittusen
1 Comment
 

Accepted Solution

by:
Blu3Viper earned 100 total points
ID: 1585099
here is a simple .htaccess and .htpasswd pair.  these two are designed to allow users to retrieve pages based on their host, and user/pass authentication:

file: .htaccess

 AuthUserFile /usr/local/etc/httpd/htdocs/inhouse/.htpasswd
 AuthGroupFile /dev/null
 AuthName Sample Title for Pop-up
 AuthType Basic
 <Limit GET>
 order deny,allow
 deny from all
 allow from all
 allow from 205.230.56. 207.104.252. 127.0.0.1
 allow from .mindspring.com 205.236.175.51
 require valid-user
 </Limit>

note that you must specify full pathnames, not relative paths.  the above .htaccess file uses only a userfile specified in the AuthUserFile line.  no groupfile is used, but it certainly could be.

the next item to note is the title msg that is placed on the popup.

you can set your AuthType to one of several means if you have compiled in support for that type in your web server.  to be safe, start with basic authentication.

next you have your LIMIT block wherein you define what hosts are allowed and those that are denied.

to specify users, you have the option of the special keyword of "valid-user" along with specifying a specific user(s).  you can specify a specific user with the following

 require jon
 require joe
 require david



the .htpasswd file is very simple normally.  i won't go over any dbm type of setup.

 joe:6dB0A.x9VF7fg
 david:EowT1Y50GJ2Yk

this is a sample cut from a .htpasswd file.  very simple, only two fields.  username:password

you should use the utility htpasswd that should come with your web server software.  note that your utility may be named slightly differently.

the encrypted password is built the same way your /etc/password entries are made.  it is considered a Bad Thing(tm) to set your AuthUserFile to /etc/password, however it is just as functional.

be sure to set the permissions and ownership properly, on the .htpasswd file in particular as you do not want it being spread around.

-d

0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now