[CWB] [CQPweb] Final step? Getting Apache to point at CQPweb's root directory

Hardie, Andrew a.hardie at lancaster.ac.uk
Mon May 13 00:04:35 CEST 2019


Hi Scott,

I think I’ve fixed this bug.

Re the messages about gd and mysqli, they weren’t the cause of this issue, and I suspect they are not a problem.

This bit explains the issue:

(tried: /usr/lib/php/20170718/gd2 (/usr/lib/php/20170718/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/gd2.so (/usr/lib/php/20170718/gd2.so: cannot open shared object file: No such file or directory))

It is looking for these extensions in a place where they aren’t. However, subsequent to this things work normally, so I guess this is just something that happens at startup.

best

Andrew.


From: cwb-bounces at sslmit.unibo.it <cwb-bounces at sslmit.unibo.it> On Behalf Of Scott Sadowsky
Sent: 12 May 2019 19:40
To: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it>
Subject: Re: [CWB] [CQPweb] Final step? Getting Apache to point at CQPweb's root directory

Dear Andrew,

Here's the last part of my /var/log/apache2/error.log:

[Sun May 12 13:27:42.660546 2019] [mpm_prefork:notice] [pid 30430] AH00171: Graceful restart requested, doing restart
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/lib/php/20170718/gd2 (/usr/lib/php/20170718/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/gd2.so (/usr/lib/php/20170718/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
[Sun May 12 13:27:42.702400 2019] [mpm_prefork:notice] [pid 30430] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sun May 12 13:27:42.702429 2019] [core:notice] [pid 30430] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 12 13:27:42.793641 2019] [mpm_prefork:notice] [pid 30430] AH00169: caught SIGTERM, shutting down
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/lib/php/20170718/gd2 (/usr/lib/php/20170718/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/gd2.so (/usr/lib/php/20170718/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
[Sun May 12 13:27:42.877221 2019] [mpm_prefork:notice] [pid 31262] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sun May 12 13:27:42.877254 2019] [core:notice] [pid 31262] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 12 13:30:10.572955 2019] [mpm_prefork:notice] [pid 31262] AH00169: caught SIGTERM, shutting down
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/lib/php/20170718/gd2 (/usr/lib/php/20170718/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/gd2.so (/usr/lib/php/20170718/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
[Sun May 12 13:30:56.766095 2019] [mpm_prefork:notice] [pid 1512] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sun May 12 13:30:56.766213 2019] [core:notice] [pid 1512] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 12 13:42:06.648270 2019] [mpm_prefork:notice] [pid 1512] AH00169: caught SIGTERM, shutting down
PHP Warning:  PHP Startup: Unable to load dynamic library 'gd2' (tried: /usr/lib/php/20170718/gd2 (/usr/lib/php/20170718/gd2: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/gd2.so (/usr/lib/php/20170718/gd2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
[Sun May 12 13:47:46.622367 2019] [mpm_prefork:notice] [pid 4430] AH00163: Apache/2.4.29 (Ubuntu) configured -- resuming normal operations
[Sun May 12 13:47:46.622464 2019] [core:notice] [pid 4430] AH00094: Command line: '/usr/sbin/apache2'
[Sun May 12 13:59:18.897264 2019] [php7:error] [pid 4434] [client 190.47.255.254:46430<http://190.47.255.254:46430>] PHP Fatal error:  Uncaught Error: Call to undefined function list_corpus_annotations() in /var/www/html/cqpweb/lib/freqtable-lib.php:457\nStack trace:\n#0 /var/www/html/cqpweb/lib/corpus-lib.php(932): make_cwb_freq_index('dickens')\n#1 /var/www/html/cqpweb/lib/metadata-act.php(181): setup_all_corpus_freqlist_data('dickens')\n#2 /var/www/html/cqpweb/exe/metadata-admin.php(1): require('/var/www/html/c...')\n#3 {main}\n  thrown in /var/www/html/cqpweb/lib/freqtable-lib.php on line 457, referer: http://146.155.44.196/dickens/index.php?ui=manageMetadata&createMetadataFromXml=1

There appear to be obvious problems with my PHP install, as there are errors about not being able to open gd2 and mysqli. But I'm not sure what the problem is, as gd2 is installed:

$ sudo apt show php-gd
Package: php-gd
Version: 1:7.2+60ubuntu1
Priority: optional
Section: php
Source: php-defaults (60ubuntu1)
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com<mailto:ubuntu-devel-discuss at lists.ubuntu.com>>
Original-Maintainer: Debian PHP Maintainers <pkg-php-maint at lists.alioth.debian.org<mailto:pkg-php-maint at lists.alioth.debian.org>>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 12.3 kB
Depends: php-common, php7.2-gd
Supported: 5y
Download-Size: 1,996 B
APT-Manual-Installed: yes
APT-Sources: http://cl.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: GD module for PHP [default]
 This package provides a GD module for PHP.

Furthermore, PHP seems to indicate GD is enabled (assuming I'm interpreting this file correctly):

$ php -i | grep "GD"
gd
/etc/php/7.2/cli/conf.d/20-gd.ini,
GD Support => enabled
GD headers Version => 2.2.5
GD library Version => 2.2.5
gd.jpeg_ignore_warning => 1 => 1


As to mysqli, it doesn't have it's own package, but appears to be part of php-db, which I have installed:

$ sudo apt show php-db
Package: php-db
Version: 1.9.2-2ubuntu1
Priority: optional
Section: universe/web
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com<mailto:ubuntu-devel-discuss at lists.ubuntu.com>>
Original-Maintainer: Debian PHP PEAR Maintainers <pkg-php-pear at lists.alioth.debian.org<mailto:pkg-php-pear at lists.alioth.debian.org>>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 577 kB
Depends: php-common, php-pear (>= 1.10.0)
Homepage: http://pear.php.net/package/DB
Download-Size: 71.4 kB
APT-Manual-Installed: yes
APT-Sources: http://cl.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: Database Abstraction Layer
 DB is a database abstraction layer providing:
  * an OO-style query API
  * portability features that make programs written for one DBMS work with
 other DBMS's
  * a DSN (data source name) format for specifying database servers
  * prepare/execute (bind) emulation for databases that don't support it
 natively
  * a result object for each query response
  * portable error codes
  * sequence emulation
  * sequential and non-sequential row fetching as well as bulk fetching
  * formats fetched rows as associative arrays, ordered arrays or objects
  * row limit support
  * transactions support
  * table information interface
  * DocBook and phpDocumentor API documentation
 .
 DB layers itself on top of PHP's existing
 database extensions.
 .
 Drivers for the following extensions pass
 the complete test suite and provide
 interchangeability when all of DB's
 portability options are enabled:
 .
 fbsql, ibase, informix, msql, mssql,
 mysql, mysqli, oci8, odbc, pgsql,
 sqlite and sybase.
 .
 There is also a driver for the dbase
 extension, but it can't be used
 interchangeably because dbase doesn't
 support many standard DBMS features.
 .
 DB is compatible with PHP 5 and PHP 7.

And here's the PHP info about mysqli:

$ php -i | grep "mysqli"
/etc/php/7.2/cli/conf.d/20-mysqli.ini,
mysqli
MysqlI Support => enabled
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
API Extensions => mysqli,pdo_mysql

Also note that in /etc/php/7.2/apache2/php.ini, I've got both extension=gd2 and extension=mysqli uncommented, for what that's worth.

Hope this helps!

Best wishes,
Scott


On Sun, May 12, 2019 at 12:39 PM Hardie, Andrew <a.hardie at lancaster.ac.uk<mailto:a.hardie at lancaster.ac.uk>> wrote:
>>> One further issue: when I go to Admin tools > Manage text metadata > Create metadata table from corpus XML annotations and then hit the Create metadata table from XML using the settings above button, there's a brief pause and I then land on a blank screen. There's no error message (or anything else) there.

There will probably be an error message in your Apache log (/var/log/apache2/error.log ; yesterday’s is .1, the day before’s .2, etc.)

best

Andrew.

From: cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it> <cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it>> On Behalf Of Scott Sadowsky
Sent: 12 May 2019 05:16
To: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it<mailto:cwb at sslmit.unibo.it>>
Subject: Re: [CWB] [CQPweb] Final step? Getting Apache to point at CQPweb's root directory

On Sat, May 11, 2019 at 8:05 PM Hardie, Andrew <a.hardie at lancaster.ac.uk<mailto:a.hardie at lancaster.ac.uk>> wrote:

All 3 issues fixed in latest commit, thanks for the bug reports.

(1 & 2 were the same bug.)

Thanks very much, Andrew. Now, all the buttons on URL/dickens/index.php?ui=manageFreqLists work correctly.

One further issue: when I go to Admin tools > Manage text metadata > Create metadata table from corpus XML annotations and then hit the Create metadata table from XML using the settings above button, there's a brief pause and I then land on a blank screen. There's no error message (or anything else) there.

Cheers,
Scott


From: cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it> <cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it>> On Behalf Of Scott Sadowsky
Sent: 11 May 2019 21:26
To: Uhrig, Peter <peter.uhrig at fau.de<mailto:peter.uhrig at fau.de>>
Cc: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it<mailto:cwb at sslmit.unibo.it>>
Subject: Re: [CWB] [CQPweb] Final step? Getting Apache to point at CQPweb's root directory

Dear Andrew, Peter and everyone else,

Thanks so much for your guys' assistance! I've now got the CQPweb server up and running in a VM and it seems to be mostly working. I'm running into a few problems with CQPweb itself, though, and I'd greatly appreciate a hand.

I can successfully import the Dickens corpus (Install new corpus > Click here to install a corpus you have already indexed in CWB > [fill in appropriate fields] > Install corpus with settings above). And I can successfully add the metadata (Design and insert a text-metadata table for the corpus > Click here to install metadata from within-corpus XML annotation > [select fields and add descriptions] > Create metadata table from XML using the settings above).

I can also create the frequency table for text begin/end positions (Admin tools > Manage frequency lists > Text begin/end positions > Update CWB text-position records). So far, so good!

PROBLEM 1. When I go to create the text-by-text frequency lists (Admin tools > Manage frequency lists > Text-by-text freq-lists > Update CWB frequency table) I get an error [1].

PROBLEM 2. When I go to create the word and annotation frequency tables (Admin tools > Manage frequency lists > Frequency tables > Create frequency tables) I get an error [2].

In both cases there's a 4-5 second delay between when I hit the button and when the error us shown, accompanied by a large CPU spike, so something right is presumably happening before the errors are thrown.

PROBLEM 3: Backend system > View a MySQL table fails with an error [3].

PROBLEM 4: Diagnosing problems with Backend system > System diagnostics fails with a blank screen.

Thanks in advance!
Scott

[1] ERROR WHEN CREATING Text-by-text freq-lists
CQPweb encountered an error and could not continue.
An SQL query did not run successfully!

Original query: analyze NO_WRITE_TO_BINLOG table /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:02 */

Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

PHP debugging backtrace
array(7) {
  [1]=>
  array(4) {
    ["file"]=>
    string(42) "/var/www/html/cqpweb/lib/exiterror-lib.php"
    ["line"]=>
    int(300)
    ["function"]=>
    string(9) "exiterror"
    ["args"]=>
    array(3) {
      [0]=>
      array(3) {
        [0]=>
        string(38) "An SQL query did not run successfully!"
        [1]=>
        string(131) "Original query:

analyze NO_WRITE_TO_BINLOG table
     /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:02 */

"
        [2]=>
        string(161) "Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 "
      }
      [1]=>
      NULL
      [2]=>
      NULL
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/sql-lib.php"
    ["line"]=>
    int(178)
    ["function"]=>
    string(20) "exiterror_mysqlquery"
    ["args"]=>
    array(3) {
      [0]=>
      int(1064)
      [1]=>
      string(146) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2"
      [2]=>
      string(111) "analyze NO_WRITE_TO_BINLOG table
     /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:02 */"
    }
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/sql-lib.php"
    ["line"]=>
    int(579)
    ["function"]=>
    string(12) "do_sql_query"
    ["args"]=>
    array(1) {
      [0]=>
      string(111) "analyze NO_WRITE_TO_BINLOG table
     /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:02 */"
    }
  }
  [4]=>
  array(4) {
    ["file"]=>
    string(39) "/var/www/html/cqpweb/lib/corpus-lib.php"
    ["line"]=>
    int(751)
    ["function"]=>
    string(18) "get_sql_table_size"
    ["args"]=>
    array(1) {
      [0]=>
      string(4) "word"
    }
  }
  [5]=>
  array(4) {
    ["file"]=>
    string(42) "/var/www/html/cqpweb/lib/freqtable-lib.php"
    ["line"]=>
    int(695)
    ["function"]=>
    string(28) "update_corpus_freqtable_size"
    ["args"]=>
    array(1) {
      [0]=>
      string(7) "dickens"
    }
  }
  [6]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/execute.php"
    ["line"]=>
    int(177)
    ["function"]=>
    string(19) "make_cwb_freq_index"
    ["args"]=>
    array(1) {
      [0]=>
      string(7) "dickens"
    }
  }
  [7]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/exe/execute.php"
    ["line"]=>
    int(1)
    ["args"]=>
    array(1) {
      [0]=>
      string(36) "/var/www/html/cqpweb/lib/execute.php"
    }
    ["function"]=>
    string(7) "require"
  }
}



[2] ERROR WHEN CREATING Word and annotation frequency tables
CQPweb encountered an error and could not continue.
An SQL query did not run successfully!

Original query: analyze NO_WRITE_TO_BINLOG table /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:08 */

Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

PHP debugging backtrace
array(7) {
  [1]=>
  array(4) {
    ["file"]=>
    string(42) "/var/www/html/cqpweb/lib/exiterror-lib.php"
    ["line"]=>
    int(300)
    ["function"]=>
    string(9) "exiterror"
    ["args"]=>
    array(3) {
      [0]=>
      array(3) {
        [0]=>
        string(38) "An SQL query did not run successfully!"
        [1]=>
        string(131) "Original query:

analyze NO_WRITE_TO_BINLOG table
     /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:08 */

"
        [2]=>
        string(161) "Error # 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 "
      }
      [1]=>
      NULL
      [2]=>
      NULL
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/sql-lib.php"
    ["line"]=>
    int(178)
    ["function"]=>
    string(20) "exiterror_mysqlquery"
    ["args"]=>
    array(3) {
      [0]=>
      int(1064)
      [1]=>
      string(146) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2"
      [2]=>
      string(111) "analyze NO_WRITE_TO_BINLOG table
     /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:08 */"
    }
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/sql-lib.php"
    ["line"]=>
    int(579)
    ["function"]=>
    string(12) "do_sql_query"
    ["args"]=>
    array(1) {
      [0]=>
      string(111) "analyze NO_WRITE_TO_BINLOG table
     /* from User: scott | Function: get_sql_table_size() | 2019-May-11 17:08 */"
    }
  }
  [4]=>
  array(4) {
    ["file"]=>
    string(39) "/var/www/html/cqpweb/lib/corpus-lib.php"
    ["line"]=>
    int(751)
    ["function"]=>
    string(18) "get_sql_table_size"
    ["args"]=>
    array(1) {
      [0]=>
      string(4) "word"
    }
  }
  [5]=>
  array(4) {
    ["file"]=>
    string(42) "/var/www/html/cqpweb/lib/freqtable-lib.php"
    ["line"]=>
    int(166)
    ["function"]=>
    string(28) "update_corpus_freqtable_size"
    ["args"]=>
    array(1) {
      [0]=>
      string(7) "dickens"
    }
  }
  [6]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/execute.php"
    ["line"]=>
    int(177)
    ["function"]=>
    string(22) "corpus_make_freqtables"
    ["args"]=>
    array(1) {
      [0]=>
      string(7) "dickens"
    }
  }
  [7]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/exe/execute.php"
    ["line"]=>
    int(1)
    ["args"]=>
    array(1) {
      [0]=>
      string(36) "/var/www/html/cqpweb/lib/execute.php"
    }
    ["function"]=>
    string(7) "require"
  }
}
CQPweb v3.2.34 © 2008-2019    Help! on CQPweb     You are logged in as user [scott]



[3] BACKEND SYSTEM > VIEW A MYSQL TABLE ERROR
Viewing mySQL table
An SQL query did not run successfully!

Original query: SELECT * FROM `` /* from User: scott | Function: do_adm_ui_tableview() | 2019-May-11 17:20 */

Error # 1103: Incorrect table name ''

PHP debugging backtrace
array(5) {
  [1]=>
  array(4) {
    ["file"]=>
    string(42) "/var/www/html/cqpweb/lib/exiterror-lib.php"
    ["line"]=>
    int(300)
    ["function"]=>
    string(9) "exiterror"
    ["args"]=>
    array(3) {
      [0]=>
      array(3) {
        [0]=>
        string(38) "An SQL query did not run successfully!"
        [1]=>
        string(115) "Original query:

SELECT * FROM ``
     /* from User: scott | Function: do_adm_ui_tableview() | 2019-May-11 17:20 */

"
        [2]=>
        string(38) "Error # 1103: Incorrect table name '' "
      }
      [1]=>
      NULL
      [2]=>
      NULL
    }
  }
  [2]=>
  array(4) {
    ["file"]=>
    string(36) "/var/www/html/cqpweb/lib/sql-lib.php"
    ["line"]=>
    int(178)
    ["function"]=>
    string(20) "exiterror_mysqlquery"
    ["args"]=>
    array(3) {
      [0]=>
      int(1103)
      [1]=>
      string(23) "Incorrect table name ''"
      [2]=>
      string(95) "SELECT * FROM ``
     /* from User: scott | Function: do_adm_ui_tableview() | 2019-May-11 17:20 */"
    }
  }
  [3]=>
  array(4) {
    ["file"]=>
    string(45) "/var/www/html/cqpweb/lib/admin-home-forms.php"
    ["line"]=>
    int(5267)
    ["function"]=>
    string(12) "do_sql_query"
    ["args"]=>
    array(1) {
      [0]=>
      string(95) "SELECT * FROM ``
     /* from User: scott | Function: do_adm_ui_tableview() | 2019-May-11 17:20 */"
    }
  }
  [4]=>
  array(4) {
    ["file"]=>
    string(38) "/var/www/html/cqpweb/lib/adminhome.php"
    ["line"]=>
    int(361)
    ["function"]=>
    string(19) "do_adm_ui_tableview"
    ["args"]=>
    array(0) {
    }
  }
  [5]=>
  array(4) {
    ["file"]=>
    string(34) "/var/www/html/cqpweb/adm/index.php"
    ["line"]=>
    int(1)
    ["args"]=>
    array(1) {
      [0]=>
      string(38) "/var/www/html/cqpweb/lib/adminhome.php"
    }
    ["function"]=>
    string(7) "require"
  }
}


On Thu, May 9, 2019 at 2:36 PM Uhrig, Peter <peter.uhrig at fau.de<mailto:peter.uhrig at fau.de>> wrote:
Hi Scott,

I hope it is okay if I answer.

> I've got two copies of 000-default.conf on a fresh Apache install, one in /etc/apache2/sites-available/ and one in /etc/apache2/site
> enabled/.

This is very unlikely. What you usually have is the file in sites-available and a symbolic link to that file in sites-enabled. These links are created by the helper command a2ensite (=apache2 enable site) and removed by a2dissite (=apache2 disable site).

So to answer your questions:

1. Is /sites-enabled then the best place for the <Directory> directive for the purposes I outlined above?

Usually, this would be changed in the file which sits in sites-available and thus also be there in the link to it in sites-enabled.

2. Is adding the <Directory> directive to the appropriate 000-default.conf file enough to change the server's document root, or are additional steps required?

You need to change the following line in that file:
DocumentRoot /var/www/html
to
DocumentRoot /var/www/html/cqpweb

This line sits in the Virtual Host *:80 by default, which means it will react to whatever it is called with on port 80. This is the default. Leave it like that.

A note: If you followed Andrew’s installation instructions, the directory is actually called /var/www/html/CQPweb – the capitalization makes a difference, so you may want to double-check.

As far as I know, you will not need this directory directive.

3. Considering you recommend against virtual hosts, should I delete the large <VirtualHost> entry that's already in both copies of 000-default.conf, or just add the <Directory> directive before or after it?

Leave it as it is.

4. And finally, is the following correct?

<Directory "/var/www/html/cqpweb">
    AllowOverride None
    Require all granted
    Options FollowSymlinks
</Directory>

I ask because the your manual and Stefan's instruction document have different options for AllowOverride, and also because Options FollowSymlinks doesn't appear in much documentation (in fact, I'm not sure where I got it from!).

Looks good to me, but I don’t think you need any of this. What is your OS?

Best,
Peter


On Thu, May 9, 2019 at 8:16 AM Hardie, Andrew <a.hardie at lancaster.ac.uk<mailto:a.hardie at lancaster.ac.uk>> wrote:
Hi Scott,

The <Directory> directive doesn’t turn a folder into your server’s root : it just specifies options that apply only to that folder.

the directive that specifies the root is DocumentRoot and depending on your setup you may find it in apache2.conf or in 000-default.conf .

You have two options, either change the document root, or else simply access your CQPweb via http://localhost/cqpweb (or whatever) which should be working for you now.

Generally I would say that you don’t want to add a “cqpweb” file in sites-available unless you really do want to operate it as a separate vhost (in which cast you’d need a <VirtualHost> directive in that config file). If you aren’t using such a vhost then the <Directory> directive should probably go inot 000-default.conf

best

Andrew


From: cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it> <cwb-bounces at sslmit.unibo.it<mailto:cwb-bounces at sslmit.unibo.it>> On Behalf Of Scott Sadowsky
Sent: 09 May 2019 11:33
To: Open source development of the Corpus WorkBench <cwb at sslmit.unibo.it<mailto:cwb at sslmit.unibo.it>>
Subject: [CWB] [CQPweb] Final step? Getting Apache to point at CQPweb's root directory

Hi All,

Except for the problem pointed out by Peter yesterday [1], which I'm also facing, I seem to be just a step or two away from having a working CQPweb install. I just can't get Apache to point to CQPweb's directory as its document root. In /etc/apache2/sites-available/cqpweb.conf I've got the following, which I would think would be enough:

<Directory "/var/www/html/cqpweb">
    AllowOverride None
    Require all granted
    Options FollowSymlinks
</Directory>

But alas, Apache opens one of those typical "Welcome to Apache" pages rather than /var/www/html/cqpweb/index.php, which consists of <?php require('lib/mainhome.php');, and so is clearly not what's being opened. Could someone point me in the right direction? I've tried both AllowOverride None (as per the admin manual) and AllowOverride All (as per Stefan's instruction document), to no avail.



--
Dr. Scott Sadowsky
Profesor Asistente de Lingüística
Pontificia Universidad Católica de Chile

ssadowsky gmail com
scsadowsky uc cl
http://sadowsky.cl/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://liste.sslmit.unibo.it/pipermail/cwb/attachments/20190512/2f767c81/attachment-0001.html>


More information about the CWB mailing list