Advertisement

08.10.2008 at 03:52PM PDT, ID: 23636600
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.9

Having problems with CGI scripts for my website

Asked by Leee211 in CGI Scripting, Perl Programming Language, Apache Web Server

Tags:

I have a website setup through LunarPages and use Verotel as my user/password manager.
I was having some problems (that's a whole other story) and I did some changes in the files.

I've finally gotten to the point where I am able to add users and have the user and password show up in the .passwd file in my data directory.  But when I go to login, none of the 100+ usernames in the data file work.
Also when I check on the Verotel website (Control Panel) it's not showing the users that were recently added.
(On my server they are showing up in the passwd file only)

So the names are being added to the file, but Verotel is not getting the info and is not allowing any access to the members section.  And I've checked that the password file is set correctly in the Verotel control panel:
http://www.xxxxxxxxx.net/cgi-bin/script.pl?  and that the directory for the member's section is correct.

I've been over and over all the setup instructions and I can't see what I'm missing.  Is anyone familiar with the "script.pl" type files?

Below is a snippet of code from the script.pl file.  Do I need to change the $ cp and $ chmod  and $ mkdir lines, because these files and directories and permissions already exist?  I only customized the following lines (I put in "xxxxxxx" for this forum post for security reasons):
AuthUserFile
our $prefix

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
=head1 INSTALLATION
 
1. Copy the file C<script.pl> to C<cgi-bin> directory of your website, give it a
name of your choice and set permissions on the file:
 
  $ cp script.pl /path/to/cgi-bin/whatever_name.pl
  $ chmod 755 /path/to/cgi-bin/whatever_name.pl
 
2. The password file (C<.htpasswd>) will be stored in so-called data directory
on your website. Either use already existing directory or create a new one and
set permissions on this directory.
 
  $ mkdir /full/path/to/your_data_dir
  $ chmod 770 /full/path/to/your_data_dir
 
3. Copy all files from C<data> directory in the distribution file to your newly
created data directory.
 
  $ cp data/* data/.* /full/path/to/your_data_dir
 
4. Edit the script and change value of C<$prefix> variable to the name of your
data directory (including full path).
 
5. [Optional] You can modify other variables in the configuration area to better
suit your needs.
 
6. Modify C<.htaccess> file in protected area of your website. This file
specifies location of your password file. It should contain line like
 
  AuthUserFile /home/xxxxxxx/data/.htpasswd
 
7. Visit Verotel Control Center and test your RUM setup by trying to add user
account. Check that the added test user account allows you to access protected
area of your website. Try to delete this user account and check access to the
protected area isn't possible for this user anymore.
 
8. If your RUM setup works fine, please submit a test request so a Verotel
Engineer can test your installation. If your RUM setup doesn't work, please
submit an installation request, and a Verotel Engineer will perform the
installation for you at no cost.
 
=head1 CONFIGURATION
 
Keep the configuration files in directories invisible to users browsing your
website. The actual physical location of the files doesn't matter as long as
ordinary users don't have access to them.
 
=head2 $prefix
 
This is the data directory which contains the password file, log file and other
supporting files.
 
Replace default value in C<$prefix> with full path to data directory on your
website. To prevent ordinary users from accessing the directory and files
inside, you should set proper file permissions on them.
 
  $ chmod 770 /full/path/to/your_data_dir
 
=cut
 
our $prefix            = '/home/xxxxxx/data';
 
=head2 $ip_file
 
To make sure only Verotel servers can call this script, caller's IP address is
checked against list of trusted IP addresses and only connections from IP
address found on this list are allowed. This list is stored in
C<$ip_file>.
 
IP addresses are stored one per line, in IP/mask (C<A.B.C.D/dd>) format.  Mask
is a number between 1 and 32 (inclusive) and defines network mask length in
bits. Bit mask length of 32 defines single IP address, shorter masks define IP
address ranges (subnets).
 
Current Verotel IP range is C<195.20.32.128/25>.
 
Don't forget to set proper file permissions to prevent ordinary users from
reading or writing the file:
 
  $ chmod 660 /home/xxxxxx/data/.ht_IP_addresses
 
=cut
 
our $ip_file           = "$prefix/.ht_IP_addresses";
 
=head2 @file_config
 
Specify locations of C<htpasswd> files, along with their respective log files.
C<@file_config> consists of <password file - log file> pairs. Most people
will only need one such pair, but should you need the accounts to be mirrored
across several websites, you can list as many pairs as you want.
 
Set permissions on your C<.htpasswd> and log files.
 
  $ chmod 660 /full/path/to/your_data_dir/.htpasswd
  $ chmod 660 /full/path/to/your_data_dir/verotel_RUM.log
 
=cut
 
our @file_config = (    # passwd file          log file
                    "$prefix/.htpasswd", "$prefix/verotel_RUM.log",
                    #   "passwd file 2", "log file 2",
                    #   "passwd file 3", "log file 3",
                    # and so on
 
                    # or if you want to chain-call another RUM script
                    #  running on another server
                    #
                    #   "http://your.server/cgi/rum_script.pl?", "",
                    #
                    # note 'http://' at the beginning and '?' at the
                    # end of the URL are mandatory. Log file name is empty.
                   );
 
our $suffix = '.tmp';
 
=head2 $access_lock_file
 
This file is used as a lock to prevent concurrent changes to C<$storage_file>.
 
Don't forget to set the same permissions as above.
 
  $ chmod 660 /home/xxxxxxx2/data/.htlock
 
=cut
 
our $access_lock_file  = "$prefix/.htlock";
 
#------------------------------------------------------------------------------
# End of configuration
#------------------------------------------------------------------------------
[+][-]08.10.2008 at 04:16PM PDT, ID: 22201059

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.10.2008 at 04:27PM PDT, ID: 22201090

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.11.2008 at 05:47AM PDT, ID: 22203819

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.11.2008 at 08:29AM PDT, ID: 22205248

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.11.2008 at 08:33AM PDT, ID: 22205290

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.11.2008 at 08:49AM PDT, ID: 22205455

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: CGI Scripting, Perl Programming Language, Apache Web Server
Tags: htaccess, htpasswd, website access
Sign Up Now!
Solution Provided By: FishMonger
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628