queXF Installation: Apache authentication

Asked by Rasinio on 2018-08-13

Hi,

I'm trying to install queXF for the first time. Before posting here I've tried to search all possible questions to make sure it already hasn't been solved/answered. I've also tried googling, but my limited knowledge on the subject may restrict the effectiveness of my searches.

OS: Centos 7 (exact version; centos-release-7-5.1804.el7.centos.2.x86_64).

What I've done either correctly or incorrectly
I've followed most of the instructions from https://quexf.acspri.org.au/installation-manual, and have installed all of the software requirements:

PHP 5 with GD (yum install gd gd-devel php-gd) - php version from the yum repo is 5.4.16-45.el7
ADOdb (yum install php-adodb) - version from repo is 5.20.6-2.el7
MySQL 5 (installed from oracle, see version below)
Ghostscript version 8 (already installed -- but is version 9, I hope that won't cause an issue)
Firefox browser (already installed)

Other stuff if it's helpful
'which php' = /bin/php
'which mysql' = /bin/mysql (version is 5.5.61)
'which ghostscript' = /bin/ghostscript (version is 9.07)

I believe I've done steps 1, 2, 4, and 5 correctly.
1: changed the php.ini settings

2: extracted the quexf and quexml to the web server root folder (which I think is /var/www/). I've created the folders quexf and quexml inside /var/www/ and extracted the contents of the .zip folders to their respective destination folders within /var/www/.

4: with a little help from https://sandilands.info/sgordon/using-quexf-in-ubuntu-for-questionnaires, I've created the quexf database via: 'mysql -u quexf -p quexf < /var/www/quexf/database/quexf.sql'

For step 5, from the same site, I found the 'config.inc.php' file and made the edits with the following lines:

define('DB_USER', 'quexf');
define('DB_PASS', 'password');
define('DB_HOST', 'localhost');
define('DB_NAME', 'quexf');

...and the adodb path is /usr/share/php/adodb/.

What I don't know
For step 3, I have no earthly idea on where to begin with the Apache authentication. From the link provided on the installation manual, I don't appear to have any Apache folder on the system under '/usr/local/'. Typing 'locate apache' in the terminal reveals no Apache folder but something that looks like an executable (/usr/sbin/apachectl). Is Apache something that needs to be installed? If so, does the version matter?

Thank you
R. Graves

Question information

Language:
English Edit question
Status:
Solved
For:
queXF Edit question
Assignee:
No assignee Edit question
Solved by:
Rasinio
Solved:
2018-08-23
Last query:
2018-08-23
Last reply:
2018-08-16
Adam Zammit (adamzammit) said : #1

Hello R. Graves,

In Centos / Redhat I believe Apache is called "httpd" so the configuration settings will be under /etc/httpd

See if this helps:

https://www.server-world.info/en/note?os=CentOS_7&p=httpd&f=8

Adam

Rasinio (rgraves8410) said : #2

Thank you. I feel like I'm getting closer, but I'm having no luck.

SANDILANDS = https://sandilands.info/sgordon/using-quexf-in-ubuntu-for-questionnaires.

What I've done...
I've created a .htaccess file under /var/www/ ("vi /var/www/.htaccess") and filled it in with:

<Directory "/var/www/quexf">
                AuthType Basic
                AuthName "quexf"
                AuthUserFile /etc/httpd/conf/.htpasswd
                Require user rgraves
</Directory>
<Directory "/var/www/quexf/admin">
                AuthType Basic
                AuthName "quexf admin"
                AuthUserFile /etc/httpd/conf/.htpasswd
                Require user rgraves
</Directory>

...from SANDILANDS instructions.

To get myself into the .htpasswd file:
htpasswd -c /etc/httpd/conf/.htpasswd rgraves
systemctl restart httpd

In the '/var/www/quexml/quexmlpdf.php' file I added: require_once('/var/www/tcpdf/config/tcpdf_config.php') at the top above require_once('/var/www/quexml/tcpdf.php'), as per the instructions from SANDILANDS for the queXML setup.

Then in the web browser, the first time I tried 'http://localhost/quexf/admin' it prompted me for a password. After supplying the correct password I got an 'Internal Server Error'. When I try to make changes to and restart httpd, and reload the page, I no longer get prompted for a password, just the 'Internal Server Error' message. I get the same message for 'http://localhost/quexf' as well.

In the error logs '/etc/httpd/logs/error_log' I received the message that it couldn't open the password file in a location that the file didn't exist. I copied the .htpasswd file from /etc/httpd/conf/ one directory up. Reset everything and still get the 'Internal Server Error' in FireFox, and get the error that it cannot open the password file in the logs. I've tried a number of permutations of edits to the .htaccess file and the and moving around of the .htpasswd file to try to resolve what the error_log shows, and now I get a 'Not Found' for 'http://localhost/quexf' and 'http://localhost/quexf/admin'. I seem to have made it worse.

I've also had our systems admin guy help and we tried creating a link to the quexf folder inside /var/www/html folder, and we got it to change from 'Not Found' to 'Forbidden.' We also tried changing permissions (777, 774, and 755) to the quexf/ quexml/ and tcpdf/ folders. We changed the owner to rgraves:apache for all folders within the /var/www/ folder, and we still get 'Forbidden' on localhost/quexf. When the link is removed localhost/quexf goes back to Not Found.

The site you linked was very helpful in discovering where things are. Is there something within the Apache configuration or in some quexf or quexml configuration file that is a common thing that needs to be changed that I missed?

Thank you again for your help,
R. Graves

Adam Zammit (adamzammit) said : #3

Please check the permissions of the .htpasswd fie

It should be accessible by the apache user

On 15 August 2018 at 07:46, Rasinio <email address hidden>
wrote:

> Question #672163 on queXF changed:
> https://answers.launchpad.net/quexf/+question/672163
>
> Status: Answered => Open
>
> Rasinio is still having a problem:
> Thank you. I feel like I'm getting closer, but I'm having no luck.
>
> SANDILANDS = https://sandilands.info/sgordon/using-quexf-in-ubuntu-for-
> questionnaires.
>
>
> What I've done...
> I've created a .htaccess file under /var/www/ ("vi /var/www/.htaccess")
> and filled it in with:
>
> <Directory "/var/www/quexf">
> AuthType Basic
> AuthName "quexf"
> AuthUserFile /etc/httpd/conf/.htpasswd
> Require user rgraves
> </Directory>
> <Directory "/var/www/quexf/admin">
> AuthType Basic
> AuthName "quexf admin"
> AuthUserFile /etc/httpd/conf/.htpasswd
> Require user rgraves
> </Directory>
>
> ...from SANDILANDS instructions.
>
> To get myself into the .htpasswd file:
> htpasswd -c /etc/httpd/conf/.htpasswd rgraves
> systemctl restart httpd
>
>
> In the '/var/www/quexml/quexmlpdf.php' file I added:
> require_once('/var/www/tcpdf/config/tcpdf_config.php') at the top above
> require_once('/var/www/quexml/tcpdf.php'), as per the instructions from
> SANDILANDS for the queXML setup.
>
> Then in the web browser, the first time I tried
> 'http://localhost/quexf/admin' it prompted me for a password. After
> supplying the correct password I got an 'Internal Server Error'. When I
> try to make changes to and restart httpd, and reload the page, I no
> longer get prompted for a password, just the 'Internal Server Error'
> message. I get the same message for 'http://localhost/quexf' as well.
>
> In the error logs '/etc/httpd/logs/error_log' I received the message
> that it couldn't open the password file in a location that the file
> didn't exist. I copied the .htpasswd file from /etc/httpd/conf/ one
> directory up. Reset everything and still get the 'Internal Server
> Error' in FireFox, and get the error that it cannot open the password
> file in the logs. I've tried a number of permutations of edits to the
> .htaccess file and the and moving around of the .htpasswd file to try to
> resolve what the error_log shows, and now I get a 'Not Found' for
> 'http://localhost/quexf' and 'http://localhost/quexf/admin'. I seem to
> have made it worse.
>
> I've also had our systems admin guy help and we tried creating a link to
> the quexf folder inside /var/www/html folder, and we got it to change
> from 'Not Found' to 'Forbidden.' We also tried changing permissions
> (777, 774, and 755) to the quexf/ quexml/ and tcpdf/ folders. We
> changed the owner to rgraves:apache for all folders within the /var/www/
> folder, and we still get 'Forbidden' on localhost/quexf. When the link
> is removed localhost/quexf goes back to Not Found.
>
> The site you linked was very helpful in discovering where things are.
> Is there something within the Apache configuration or in some quexf or
> quexml configuration file that is a common thing that needs to be
> changed that I missed?
>
> Thank you again for your help,
> R. Graves
>
> --
> You received this question notification because you are an answer
> contact for queXF.
>

--
Adam Zammit
Director of Operations
Australian Consortium for Social and Political Research Inc.
+61 3 9013 9653
http://www.acspri.org.au/

Rasinio (rgraves8410) said : #4

Hey,

We ended up changing OSs (to Linux Mint) and got it working there. It was very difficult to get queXF to do much on Centos.

Thank you for you help.

R. Graves