I am trying to migrate from Apache 2.2 on Debian 7 to Apache 2.4 on CentOS 7.
when httpd starts, it fails to start as below.
root# journalctl -xe
Jun 23 14:26:04 ww-test httpd[17716]: AH00526: Syntax error on line 47 of /etc/httpd/conf/httpd.conf:
Jun 23 14:26:04 ww-test httpd[17716]: Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration
Jun 23 14:26:04 ww-test systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 23 14:26:04 ww-test kill[17718]: kill: cannot find process ""
Jun 23 14:26:04 ww-test systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 23 14:26:04 ww-test systemd[1]: Failed to start The Apache HTTP Server.
vi httpd.conf
45 # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
46 #
47 LockFile ${APACHE_LOCK_DIR}/accept.lock
48
I installed the related package as below although I am not sure if it is the right one.
============================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================
Installing:
lockfile-progs x86_64 0.1.15-7.el7 /lockfile-progs-0.1.15-7.el7.x86_64 50 k
Installing for dependencies:
liblockfile x86_64 1.08-17.el7 base 21 k
Transaction Summary
Thanks for reading it.
Replace this line:
LockFile ${APACHE_LOCK_DIR}/accept.lock
To:
Mutex file:/var/httpd/locks default
Directives AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex, and WatchdogMutexPath have been replaced with a single Mutex directive. You will need to evaluate any use of these removed directives in your 2.2 configuration to determine if they can just be deleted or will need to be replaced using Mutex
Related
I am trying to migrate from Apache 2.2 on Debian 7 to Apache 2.4 on CentOS 7.
There is a file named "envvars" on Debian 7 as below which has to exist on CentOS 7 as far as I know.
# envvars - default environment variables for apache2ctl
# this won't be correct after changing uid
unset HOME
# for supporting multiple apache2 instances
if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
else
SUFFIX=
fi
# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2$SUFFIX.pid
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
I created the same file under conf where httpd.conf located but it did not work and also add the contents to /etc/sysconfig/httpd but an error stops running the apache server as below.
Jun 17 17:48:35 ww-test httpd[5707]: [Wed Jun 17 17:48:35.473658 2020] [core:warn] [pid 5707] AH00111: Config variable ${APACHE_PID_FILE} is not defined
Jun 17 17:48:35 ww-test httpd[5707]: [Wed Jun 17 17:48:35.473857 2020] [core:warn] [pid 5707] AH00111: Config variable ${APACHE_RUN_USER} is not defined
Jun 17 17:48:35 ww-test httpd[5707]: [Wed Jun 17 17:48:35.473864 2020] [core:warn] [pid 5707] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
Jun 17 17:48:35 ww-test httpd[5707]: [Wed Jun 17 17:48:35.473885 2020] [core:warn] [pid 5707] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
Jun 17 17:48:35 ww-test httpd[5707]: [Wed Jun 17 17:48:35.495541 2020] [core:warn] [pid 5707] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
Jun 17 17:48:35 ww-test httpd[5707]: AH00543: httpd: bad user name ${APACHE_RUN_USER}
Jun 17 17:48:35 ww-test systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 17 17:48:35 ww-test systemd[1]: Ignoring invalid environment assignment 'export APACHE_RUN_USER=apache': /etc/sysconfig/httpd
Jun 17 17:48:35 ww-test systemd[1]: Ignoring invalid environment assignment 'export APACHE_RUN_GROUP=apache': /etc/sysconfig/httpd
Jun 17 17:48:35 ww-test systemd[1]: Ignoring invalid environment assignment 'export APACHE_PID_FILE=/var/run/httpd$SUFFIX.pid': /etc/sysconfig/httpd
Jun 17 17:48:35 ww-test systemd[1]: Ignoring invalid environment assignment 'export APACHE_RUN_DIR=/var/run/httpd$SUFFIX': /etc/sysconfig/httpd
Jun 17 17:48:35 ww-test systemd[1]: Ignoring invalid environment assignment 'export APACHE_LOCK_DIR=/var/lock/httpd$SUFFIX': /etc/sysconfig/httpd
Jun 17 17:48:35 ww-test systemd[1]: Ignoring invalid environment assignment 'export APACHE_LOG_DIR=/var/log/httpd$SUFFIX': /etc/sysconfig/httpd
Jun 17 17:48:35 ww-test kill[5708]: kill: cannot find process ""
Jun 17 17:48:35 ww-test systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 17 17:48:35 ww-test systemd[1]: Failed to start The Apache HTTP Server.
I tried source envvars to test if the environemts work but it did not.
Is there any way that I can add the environment variables so that it applies to whenever I start Apache?
Thanks!
Within httpd.conf, declare your variable(s) with: Define (Preferably at the very first line)
Define APACHE_RUN_USER Apache
You can later use this variable like so:
User ${APACHE_RUN_USER}
Refer link for more information.
Tried installing jenkins by following the below mentioned link but end up facing the following issue
https://www.liquidweb.com/kb/installing-jenkins-on-ubuntu-16-04/
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code
Reinstalled the dpkg again and tried installing jenkins but end up facing the same issue
Could someone please guide me to resolve this issue?
uday#uday:~$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree
Reading state information... Done
jenkins is already the newest version (2.204.1).
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic
linux-image-4.4.0-57-generic
linux-image-extra-4.4.0-57-generic snapd-login-service
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up jenkins (2.204.1) ...
Job for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-12-22 20:09:44 IST; 4ms ago
Docs: man:systemd-sysv-generator(8)
Process: 31293 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)
Dec 22 20:09:44 uday jenkins[31293]: Found an incorrect Jav...
Dec 22 20:09:44 uday jenkins[31293]: Java version found:
Dec 22 20:09:44 uday jenkins[31293]: java version "1.7.0_95"
Dec 22 20:09:44 uday jenkins[31293]: OpenJDK Runtime Enviro...
Dec 22 20:09:44 uday jenkins[31293]: OpenJDK Server VM (bui...
Dec 22 20:09:44 uday jenkins[31293]: Aborting
Dec 22 20:09:44 uday systemd[1]: jenkins.service: Control p...
Dec 22 20:09:44 uday systemd[1]: Failed to start LSB: Start...
Dec 22 20:09:44 uday systemd[1]: jenkins.service: Unit ente...
Dec 22 20:09:44 uday systemd[1]: jenkins.service: Failed wi...
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package jenkins (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)
Tried getting the Output of journalctl -xe command to observe the issue
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit jenkins.service has begun starting up.
Dec 23 08:21:32 uday jenkins[3105]: Found an incorrect Java version
Dec 23 08:21:32 uday jenkins[3105]: Java version found:
Dec 23 08:21:32 uday jenkins[3105]: java version "1.7.0_95"
Dec 23 08:21:32 uday jenkins[3105]: OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-3)
Dec 23 08:21:32 uday jenkins[3105]: OpenJDK Server VM (build 24.95-b01, mixed mode)
Dec 23 08:21:32 uday jenkins[3105]: Aborting
Dec 23 08:21:32 uday systemd[1]: jenkins.service: Control process exited, code=exited status=1
Dec 23 08:21:32 uday systemd[1]: Failed to start LSB: Start Jenkins at boot time.
-- Subject: Unit jenkins.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit jenkins.service has failed.
--
-- The result is failed.
Dec 23 08:21:32 uday systemd[1]: jenkins.service: Unit entered failed state.
Dec 23 08:21:32 uday systemd[1]: jenkins.service: Failed with result 'exit-code'.
Dec 23 08:21:33 uday sudo[3002]: pam_unix(sudo:session): session closed for user root
Dec 23 08:21:43 uday sudo[3170]: uday : TTY=pts/1 ; PWD=/home/uday ; USER=root ; COMMAND=/bin/journalctl -xe
Dec 23 08:21:43 uday sudo[3170]: pam_unix(sudo:session): session opened for user root by (uid=0)
~
I think the new version of Jenkins only supports OpenJDK-8 So you should clean all the installed Java and Jenkins and reinstall it according to this post https://techpostal.blogspot.com/2020/01/jenkins-installation-in-ubuntu-1804.html hope it will help you..
It seems like sge tries start before lustre is mounted when the server boots, which brings an error to start automatically when it reboots.
Can somebody tell me how to change the order when it boots, so sge starts after lustre is mounted?
Error message from the log:
Aug 12 11:46:21 dragen1 systemd: Configuration file /usr/lib/systemd/system/sge_execd.service is marked executable. Please remove executable permission bits. Proceeding anyway.
Aug 12 11:46:40 dragen1 sge_execd: error: SGE_ROOT directory "/cm/shared/apps/sge/2011.11p1" doesn't exist
Aug 12 11:46:40 dragen1 systemd: sge_execd.service: control process exited, code=exited status=1
Aug 12 11:46:40 dragen1 systemd: Unit sge_execd.service entered failed state.
Aug 12 11:46:40 dragen1 systemd: sge_execd.service failed
I added in the following under [Unit] from the sge service
RequiresMountsFor=(Mount Point)
This fixed the problem.
Installed Varnish from yum; but immediate error when initiating via systemctl.
Jul 28 14:11:54 localhost.localdomain varnishd[6546]: .init_func = VGC_function_vcl_init,
Jul 28 14:11:54 localhost.localdomain varnishd[6546]: .fini_func = VGC_function_vcl_fini,
Jul 28 14:11:54 localhost.localdomain varnishd[6546]: };
Jul 28 14:11:54 localhost.localdomain varnishd[6557]: Assert error in main(), mgt/mgt_main.c line 686:
Jul 28 14:11:54 localhost.localdomain varnishd[6557]: Condition((daemon(1,0)) == 0) not true.
Jul 28 14:11:54 localhost.localdomain varnishd[6557]: errno = 19 (No such device)
Jul 28 14:11:54 localhost.localdomain systemd[1]: Failed to read PID from file /var/run/varnish.pid: Invalid argument
Jul 28 14:11:54 localhost.localdomain systemd[1]: varnish.service never wrote its PID file. Failing.
Jul 28 14:11:54 localhost.localdomain systemd[1]: Failed to start Varnish a high-perfomance HTTP accelerator.
Jul 28 14:11:54 localhost.localdomain systemd[1]: Unit varnish.service entered failed state.
SELinux is disabled; package was installed via root. This is a fresh install.
Looks like you need to reboot. ;)
The message:
Failed to read PID from file /var/run/varnish.pid Invalid argument
is non-critical. It is just systemd trying to read the pidfile too early. You can poll status with:
systemctl status varnish
If its "Main PID" entry is matching the contents of /var/run/varnish.pid(and if varnishd is started via systemd, it always does), you can ignore that message. This is fixed in later versions of systemd.
When I try to start the apache this happens:
Job for apache2.service failed. See ‘systemctl status apache2.service’ and ‘journalctl -xn’ for details.
system.ctl status apache2.service -l returns me this:
Mar 24 23:41:57 glauber-pc.site start_apache2[3249]: httpd2-prefork: Syntax error on line 179 of /etc/apache2/httpd.conf: Syntax error on line 102 of /etc/apache2/default-server.conf: Syntax error on line 1 of /etc/apache2/conf.d/mod_evasive.conf: Cannot load /usr/lib64/apache2/mod_evasive20.so into server: /usr/lib64/apache2/mod_evasive20.so: cannot open shared object file: No such file or directory
Mar 24 23:41:57 glauber-pc.site systemd[1]: apache2.service: main process exited, code=exited, status=1/FAILURE
Mar 24 23:41:57 glauber-pc.site systemd[1]: Failed to start The Apache Webserver.
Mar 24 23:41:57 glauber-pc.site systemd[1]: Unit apache2.service entered failed state.
Everything seems right in those lines, any clue what it can be?
Change the first line in
/etc/apache2/conf.d/mod_evasive.conf
to
LoadModule evasive20_module /usr/lib64/apache2/mod_evasive24.so
(...24.so instead of ...20.so)