[CWB] Two issues regarding CQPweb revision 316

Hardie, Andrew a.hardie at lancaster.ac.uk
Sun May 20 15:29:19 CEST 2012


Hi Ray,

This is giving me a clearer idea but no solution as yet.

I spot one odd thing: you have .htaccess and .htgroup files in the cqpweb_aux directory, should they not be in the “user” subdirectory?

What is the ls –al of the “user” subdirectory?

And, what is the value of $cqpweb_accessdir in the config file?

On the other problem: what is the ls –al of the “cqpweb_aux/temp” subdirectory?

On both, have you checked the value of the php.ini directive “open_basedir”? (This can also be set in httpd.conf or other Apache config file, see http://www.php.net/manual/en/ini.core.php#ini.open-basedir)

best

Andrew.

From: cwb-bounces at sslmit.unibo.it [mailto:cwb-bounces at sslmit.unibo.it] On Behalf Of Ray Wu
Sent: 20 May 2012 14:09
To: Open source development of the Corpus WorkBench
Subject: RE: RE: [CWB] Two issues regarding CQPweb revision 316

Hi Andrew,

Thanks for your unfailing help!  I rechecked my CQPweb setup and gathered the following information for your reference.

//////Access control of CQPweb//////
My CQPweb's data directory:
/usr/local/apache2/cqpweb_aux$ ls
index  registry  temp  upload  user

My CQPweb's program directory:
/usr/local/apache2/htdocs/cqp
/usr/local/apache2/htdocs/cqp/adm
/usr/local/apache2/htdocs/cqp/lib
...
My mysqld and httpd:
$ sudo ps -e -o user,comm
root     mysqld_safe
mysql    mysqld
nobody   httpd

My user group for mysqld and httpd:
$ sudo groupadd cqpweb
$ sudo usermod -g cqpweb mysql
$ sudo usermod -g cqpweb nobody
$ sudo chgrp -hR cqpweb /usr/local/apache2/cqpweb_aux/temp
$ sudo chgrp -hR cqpweb /usr/local/apache2/cqpweb_aux/user
$ sudo chgrp -hR cqpweb /usr/local/apache2/htdocs/cqp/

/usr/local/apache2/cqpweb_aux$ ls -al
drwxrwxrwx  7 nobody cqpweb 4096 2012-05-20 18:50 .
drwxr-xr-x 17 root   root   4096 2012-05-13 22:46 ..
-rwxrwxr--  1 nobody cqpweb   19 2012-05-15 16:48 .htgroup
-rwxrwxr--  1 nobody cqpweb   21 2012-05-15 18:25 .htpasswd
drwxrwxr-x  6 nobody cqpweb 4096 2012-05-20 19:36 index
drwxrwxr-x  2 nobody cqpweb 4096 2012-05-20 19:36 registry
drwxrwxr-x  2 nobody cqpweb 4096 2012-05-20 19:36 temp
drwxrwxr-x  3 nobody cqpweb 4096 2012-05-19 16:59 upload
drwxrwxr-x  2 nobody cqpweb 4096 2012-05-20 18:56 user

/usr/local/apache2/htdocs/cqp$ ls -al
drwxrwxr-x  2 nobody cqpweb   4096 2012-05-19 17:13 test
...
/usr/local/apache2/htdocs/cqp/test$ ls -al
-rwxrwxr-x  1 nobody cqpweb   39 2012-05-19 17:13 api.php
-rwxrwxr-x  1 nobody cqpweb   47 2012-05-19 17:13 collocation.php
-rwxrwxr-x  1 nobody cqpweb   47 2012-05-19 17:13 concordance.php
-rwxrwxr-x  1 nobody cqpweb  210 2012-05-20 14:30 .htaccess
...
//////CQPweb diagnostic ouput//////
Diagnosing connection to child process for CQP back-end
Beginning diagnostics on CQP child process connection.
Using following configuration variables:
    $path_to_cqp = ``usr/local/bin''
    $cwb_registry = ``usr/local/apache2/cqpweb_aux/registry''
Checking that /usr/local/bin exists...  yes it does!
Checking that CQP program exists...  yes it does!
Checking that CQP program is executable by this user...  yes it is!
Checking that /usr/local/apache2/cqpweb_aux/registry exists...  yes it does!
Checking that CWB registry is readable by this user...  yes it is!
The connection to the CQP child process was successful.

//////Setup of apparmor//////
/etc/apparmor.d$ sudo vi usr.sbin.mysqld
#include <tunables/global>
/usr/sbin/cupsd {
    /usr/local/apache2/cqpweb_aux/user/** rw,
    /usr/local/apache2/cqpweb_aux/temp/** rw,
    /usr/local/apache2/htdocs/cqp/test/** rw,
    }
/etc/apparmor.d$ sudo /etc/init.d/apparmor restart
Reloading AppArmor profiles : done.

//////write-permission test script as you suggested//////
/usr/local/apache2/htdocs/cqp$ cat checkwrite.php
<?php
if (false !== file_put_contents('/usr/local/apache2/cqpweb_aux/temp/file_for_Check', 'ffff')) echo "YES"; else echo "NO.";
if (false !== file_put_contents('/usr/local/apache2/cqpweb_aux/user/file_for_Check', 'ffff')) echo "YES"; else echo "NO.";
if (false !== file_put_contents('/usr/local/apache2/htdocs/cqp/test/file_for_Check', 'ffff')) echo "YES"; else echo "NO.";
?>
After running http://172.21.13.23/cqp/checkwrite.php, the browser writes "YESYESYES".

//////I then start to rerun the aforementioned procesures on my said toy corpus to recheck Issue 1//////
1. "Manage metadata"->"Recreate frequency tables" yields an error:
A function was passed an invalid argument type!
Argument value was /usr/local/apache2/cqpweb_aux/temp/____temporary_freq_corpus_test.tbl.utf8.tmp. Problem:
This path is not writable.

This error is quite annoying but I still cannot find out why.

2. Results of "Create new user (or reset user password)"  won't show up in
1) MySQL table "user_settings" (ok now)
2) .htgroup (still no, that it is now understood as I need to run "Manage group membership" before they can show up)
   and .htpasswd (ok)files in CQPweb's web usernames and passwords directory
3) GUI of "Manage group membership"->"Manage user groups"(ok)
That means this is not problem.

3.Results of  "Create a batch of user accounts"  won't show up in
1) GUI's  "Set user's maximum database size" (no) or "Delete a user account" (ok)
2) MySQL table "user_settings" (no)
3) .htgroup (no, understandable now) and .htpasswd (ok) files in CQPweb's web usernames and passwords directory
4) GUI of "Manage group membership"->"Manage user groups" (ok)
So, still two nos here.

4. Results of "Add new group" won't show up in a corpus's .htaccess file (no, but it is now understood that
   I need to run "Manage user groups" before they can show up)
This is not a problem.

//////Issue 2 and 3//////
As for Issue 2, yes, you are right - some necessary steps were neglected and I followed your instructions and it works now. That saved me a lot of time scratching my head. Thanks.

Issue 3? Just to make sure I'm on the right track -no real hurt. :)

Best,
Ray



在 2012-05-20 16:32:36,"Hardie, Andrew" <a.hardie at lancaster.ac.uk<mailto:a.hardie at lancaster.ac.uk>> 写道:

Hi Ray,

Issues 1-I to 1-III sound like permissions problems i.e. httpd can’t write to the access directory (this is the first step in user creation, so if it fails, the rest won’t work) or alternatively, can’t write to the permissions file because they were created as belonging to another user.  Can you check this? Alternatively, it could be an AppArmor etc. issue as well as a Unix permissions issue. Or (thinking of yet another reason) it could be that CQPweb is unable to invoke the htpasswd binary properly, e.g. if it has the wrong path or is unable to call it.

Issue 2 sounds like a setup issue. Look in the “admin tools – Manage metadata” page. You will see, in the lower half of the screen, four buttons. You need to press all four, in order, after inserting the metadata table for setup to be complete. The first of these buttons is the one that fills in the fields you mention.

Issue 3. Mea maxima culpa - I forgot to bump the version number before committing.  Next commit will include beginning work on 3.0.7 and will raise the  number.

best

Andrew.



From: cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it> [mailto:cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it>] On Behalf Of Ray Wu
Sent: 20 May 2012 07:50
To: cwb at sslmit.unibo.it<mailto:cwb at sslmit.unibo.it>
Subject: [CWB] Two issues regarding CQPweb revision 316

Hi all,
I am trying CQPweb revision 316 and find two small inconvenienences on my computer.

Issue 1:
I. Results of  "Create a batch of user accounts"  won't show up in
1) GUI's  "Set user's maximum database size"  or "Delete a user account"
2) MySQL table "user_settings"
3) .htgroup and .htpasswd files in CQPweb's web usernames and passwords directory
4) GUI of "Manage group membership"->"Manage user groups"

II. Results of "Create new user (or reset user password)"  won't show up in
1) MySQL table "user_settings"
2) .htgroup and .htpasswd files in CQPweb's web usernames and passwords directory
3) GUI of "Manage group membership"->"Manage user groups"

III. Results of "Add new group" won't show up in a corpus's .htaccess file

However, manually edit .htgroup and run htpasswd will make users appear in "Delete a user a ccount" but these users still won't show up in "Set user's maximum database size". That said, I can now log in as the new user.

Issue 2:
In table "text_metadata_for_test", the fields of "words","cqp_begin","cqp_end" are empty

Issue 3 (is it an issue?):
The version number on the welcome page is 3.0.5, which doesn't match that (3.0.6) in "Latest news"

Thanks for any tips. I think if these issues can be fixed, I can start to do real things now.
Best
Ray


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20120520/e435f00a/attachment-0001.htm


More information about the CWB mailing list