[CWB] [CQPweb] Final step? Getting Apache to point at CQPweb's root directory
Hardie, Andrew
a.hardie at lancaster.ac.uk
Thu May 9 20:35:05 CEST 2019
Hi Scott,
Re the two “sites-*” folders. This is Debian / Ubuntu specific I think. sites-available consists of the actual files. sites-enabled contains symlinks to those files in sites-available that you want to have switched on. (sites-available is not scanned, so files in there are only parsed by the Apache daemon If they are symlinked in site-enabled.)
The idea is to have one such config file per vhost. Or, if you’re not using different vhosts, just one config file (the “default”).
When you are not running distinct vhosts, it is irrelevant whether you put things in apache2.conf (the main config file) or in 000-default. The only benefit of the latter is that OS upgrades are less likely to interfere with it.
In sum then The best place for your <Directory> declaration is sites-available/000-default.conf, within the VirtualHost block.
>>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?
No, as I said, <Directory> just changes the settings for a particular directory in the web tree (need not be the document root). You need a DocumentRoot directive. This can be in the 000-default or main apache2.conf file, it doesn’t matter. When you run multiple vhosts you would normally set the VirtualHost to have a different document root for each.
https://httpd.apache.org/docs/2.4/mod/core.html#documentroot
>>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?
No, don’t delete it, because that single block configures your one sole host. the point is that if you have more than 1 vhost you would need extra such blocks, in extra config files, which is not really what I think you need.
Add the Directory to the block, yes.
Re “and finally” …
AllowOverride None is a performance enhancement (avoids reading the directory tree for .htaccess). It’s not essential, but recommended.
FollowSymlinks is essential. The default is for this to be pre-set, but it might need setting explicitly if your distro has it Off. See https://httpd.apache.org/docs/2.4/mod/core.html#options for the canonical documentation.
Require all granted is not normally necessary. But it can be needed if a higher-level directory in the web tree has set Require all denied (Etc)(in that case it needs to be put back to its original setting for the CQPweb directory)
best
Andrew.
From: cwb-bounces at sslmit.unibo.it <cwb-bounces at sslmit.unibo.it> On Behalf Of Scott Sadowsky
Sent: 09 May 2019 18:59
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
Hi Andrew,
Thanks for the help. I do indeed want to change the document root, and I'm aiming to install on a bare-metal machine. 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/. In light of that, a few follow-up questions, surely glaringly obvious for those with server experience, but alas...
1. Is /sites-enabled then the best place for the <Directory> directive for the purposes I outlined above?
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?
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?
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!).
Thanks in advance,
Scott
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.
Cheers,
Scott
[1] PHP Notice: Undefined property: NotAFullConfig::$blowfish_cost in /var/www/html/CQPweb/lib/useracct-lib.php on line 756
_______________________________________________
CWB mailing list
CWB at sslmit.unibo.it<mailto:CWB at sslmit.unibo.it>
http://liste.sslmit.unibo.it/mailman/listinfo/cwb
--
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/20190509/583e7ea0/attachment-0001.html>
More information about the CWB
mailing list