Loris: Confirm that Apache can be configured by the install script for CentOS

Created on 28 Oct 2019  ยท  8Comments  ยท  Source: aces/Loris

OK well it sounds like further testing should be done to make sure that Apache can be automatically configured by the install script for CentOS. I'll make an issue for it.

_Originally posted by @johnsaigle in https://github.com/aces/Loris/pull/5205/review_comment/create_

Bug Testing

Most helpful comment

@maltheism could you actually check this issue, during your minor release testing? That would be super useful to diagnose next steps.

All 8 comments

@maltheism could you actually check this issue, during your minor release testing? That would be super useful to diagnose next steps.

Hi @johnsaigle and @christinerogers. The install.sh script gives me this output:

Generating autoload files
CentOS distribution detected.
Would you like to automatically create/install apache config files? (In development for CentOS 6.5) [yn] y
[sudo] password for parallels:
Redirecting to /bin/systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

systemctl status httpd.service output:

$ systemctl status httpd.service
โ— httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2019-10-31 13:20:09 EDT; 2min 9s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 19439 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 19437 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 19437 (code=exited, status=1/FAILURE)

Oct 31 13:20:09 localhost.localdomain systemd[1]: Stopped The Apache HTTP Server.
Oct 31 13:20:09 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Oct 31 13:20:09 localhost.localdomain httpd[19437]: AH00526: Syntax error on line 17 of /etc/httpd/conf.d/loris.conf:
Oct 31 13:20:09 localhost.localdomain httpd[19437]: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
Oct 31 13:20:09 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 31 13:20:09 localhost.localdomain kill[19439]: kill: cannot find process ""
Oct 31 13:20:09 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 31 13:20:09 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Oct 31 13:20:09 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Oct 31 13:20:09 localhost.localdomain systemd[1]: httpd.service failed.

The journalctl -xe output:

Oct 31 13:20:09 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit httpd.service has begun starting up.
Oct 31 13:20:09 localhost.localdomain httpd[19437]: AH00526: Syntax error on line 17 of /etc/httpd/conf.d/loris.conf:
Oct 31 13:20:09 localhost.localdomain httpd[19437]: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
Oct 31 13:20:09 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 31 13:20:09 localhost.localdomain kill[19439]: kill: cannot find process ""
Oct 31 13:20:09 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 31 13:20:09 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd

-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit httpd.service has failed.

-- The result is failed.

Note line 17:
php_value include_path .:/usr/share/php:/var/www/loris/project/libraries:/var/www/loris/php/libraries
inside the /etc/httpd/conf.d/loris.conf

The complete /etc/httpd/conf.d/loris.conf file content:

# NameVirtualHost *
<VirtualHost *:80>  # change from 80 to 443 if you enable SSL
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/loris/htdocs/
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/loris/htdocs/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        php_value include_path .:/usr/share/php:/var/www/loris/project/libraries:/var/www/loris/php/libraries

        #DirectoryIndex main.php index.html

        ErrorLog /var/log/httpd/loris-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/httpd/loris-access.log combined
        ServerSignature Off

        #SSLEngine Off  # change to On to enable, after updating cert paths below
        #SSLCertificateFile /etc/apache2/ssl/loris-cert.pem
        #SSLCertificateKeyFile /etc/apache2/ssl/loris-key.pem
        #SSLCACertificateFile /etc/apache2/ssl/CA-cacert.pem

</VirtualHost>

php -v

PHP 7.2.24 (cli) (built: Oct 22 2019 11:28:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24, Copyright (c) 1999-2018, by Zend Technologies

I'm guessing the httpd apache module for php is missing. I don't really know what to do for fixing this issue. Seems like centos 7 specific.

Okay so maybe this is something helpful for the issue

$ yum list installed
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirror.globo.tech
 * epel: mirror.math.princeton.edu
 * extras: centos.mirror.globo.tech
 * remi-php72: repo1.ash.innoscale.net
 * remi-safe: repo1.ash.innoscale.net
 * updates: centos.mirror.globo.tech
Installed Packages
php72.x86_64                                                    2.0-1.el7.remi                                         @remi-safe      
php72-php-cli.x86_64                                            7.2.24-1.el7.remi                                      @remi-safe      
php72-php-common.x86_64                                         7.2.24-1.el7.remi                                      @remi-safe      
php72-php-fpm.x86_64                                            7.2.24-1.el7.remi                                      @remi-safe      
php72-php-gd.x86_64                                             7.2.24-1.el7.remi                                      @remi-safe      
php72-php-json.x86_64                                           7.2.24-1.el7.remi                                      @remi-safe      
php72-php-mbstring.x86_64                                       7.2.24-1.el7.remi                                      @remi-safe      
php72-php-mysqlnd.x86_64                                        7.2.24-1.el7.remi                                      @remi-safe      
php72-php-opcache.x86_64                                        7.2.24-1.el7.remi                                      @remi-safe      
php72-php-pdo.x86_64                                            7.2.24-1.el7.remi                                      @remi-safe      
php72-php-pecl-mysql.x86_64                                     1.0.0-0.17.20160812git230a828.el7.remi                 @remi-safe      
php72-php-xml.x86_64                                            7.2.24-1.el7.remi                                      @remi-safe      
php72-php-xmlrpc.x86_64                                         7.2.24-1.el7.remi                                      @remi-safe      
php72-runtime.x86_64                                            2.0-1.el7.remi                                         @remi-safe 

Apparently, "remi-safe repo" might be the issue. See:
https://stackoverflow.com/questions/40464196/how-to-install-module-libphp5-so-in-apache-serve-centos-7/43087662

When installing php72 the output:

=======================================================================================================================================
 Package                             Arch                      Version                              Repository                    Size
=======================================================================================================================================
Installing:
 php72                               x86_64                    2.0-1.el7.remi                       remi-safe                    2.4 k
Installing for dependencies:
 php72-php-cli                       x86_64                    7.2.24-1.el7.remi                    remi-safe                    3.2 M
 php72-php-common                    x86_64                    7.2.24-1.el7.remi                    remi-safe                    640 k
 php72-php-json                      x86_64                    7.2.24-1.el7.remi                    remi-safe                     68 k
 php72-runtime                       x86_64                    2.0-1.el7.remi                       remi-safe                    1.1 M

Transaction Summary
=======================================================================================================================================
Install  1 Package (+4 Dependent packages)

Okay I think the solution is this command:
sudo yum --enablerepo=remi-php72 install php
for installing php72.

That changes the Repository to be "remi-php72" instead of "remi-safe" and solves the php_value error inside httpd. The final result will be a clean install.sh output of handling the apache configuration.

https://github.com/aces/Loris/pull/5492 was merged and addressed an issue. The install.sh script does create the apache file on centos but the user does have to configure it. I think that's intended.

Was this page helpful?
0 / 5 - 0 ratings