Redmine Archlinux Apache Passenger - apache

I currently try to setup redmine in Archlinux (VM) using the tutorial:
https://wiki.archlinux.org/index.php/Redmine
Redmine can be started using "ruby bin/rails server webrick -e production" (install test).
i have already run "passenger-install-apache2-module" and added the lines to "/etc/httpd/conf/httpd.conf".
This is where the Arch tutorial ends.
I can also start it calling "passenger start" in the redmine directory, but i cant get appache loading it automatically.
For starting i currently have added:
<VirtualHost *:3000>
DocumentRoot /ust/share/webapps/redmine/public
<Directory /ust/share/webapps/redmine/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
(This last part was a try from http://linoxide.com/linux-how-to/setup-redmine-fedora-22/)
PS: i also tried to call the "ruby bin/rails server webrick -e production" line using systemctl (as describet at the end of arch) but this one only gets errors i cant understand.
PPS: Ther also is a Nginx (port 80) on the system, Apache is on 8080 (just in case that might interfere.)
EDIT: Trying to get Logs (i hope to grb the correct files):
/var/log/httpd/error_log:
[ 2017-02-06 23:16:42.5833 854/7fbcbe96dd00 age/Wat/WatchdogMain.cpp:1281 ]: Starting Passenger watchdog...
[ 2017-02-06 23:16:42.6193 1081/7fd495dacd00 age/Cor/CoreMain.cpp:1070 ]: Starting Passenger core...
[ 2017-02-06 23:16:42.6197 1081/7fd495dacd00 age/Cor/CoreMain.cpp:245 ]: Passenger core running in multi-application mode.
[ 2017-02-06 23:16:42.6245 1081/7fd495dacd00 age/Cor/CoreMain.cpp:820 ]: Passenger core online, PID 1081
[ 2017-02-06 23:16:42.6279 1088/7f56ce6b3d00 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2017-02-06 23:16:42.7834 1088/7f56ce6b3d00 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 1088
[ 2017-02-06 23:16:42.9048 1081/7fd483fff700 age/Cor/CoreMain.cpp:585 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdo$
[ 2017-02-06 23:16:42.9049 1081/7fd495dacd00 age/Cor/CoreMain.cpp:989 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2017-02-06 23:16:42.9049 1088/7f56c8a30700 age/Ust/UstRouterMain.cpp:422 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force s$
[ 2017-02-06 23:16:42.9049 1088/7f56ce6b3d00 age/Ust/UstRouterMain.cpp:492 ]: Received command to shutdown gracefully. Waiting until all clients have disconnecte$
[ 2017-02-06 23:16:42.9049 1088/7f56bbfff700 Ser/Server.h:817 ]: [UstRouterApiServer] Freed 0 spare client objects
[ 2017-02-06 23:16:42.9049 1088/7f56bbfff700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
[ 2017-02-06 23:16:42.9050 1081/7fd482f7c700 Ser/Server.h:817 ]: [ServerThr.3] Freed 128 spare client objects
[ 2017-02-06 23:16:42.9050 1081/7fd482f7c700 Ser/Server.h:464 ]: [ServerThr.3] Shutdown finished
[ 2017-02-06 23:16:42.9051 1081/7fd483fff700 Ser/Server.h:817 ]: [ServerThr.1] Freed 128 spare client objects
[ 2017-02-06 23:16:42.9051 1081/7fd483fff700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
[ 2017-02-06 23:16:42.9052 1081/7fd4837fe700 Ser/Server.h:817 ]: [ServerThr.2] Freed 128 spare client objects
[ 2017-02-06 23:16:42.9052 1081/7fd4837fe700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
[ 2017-02-06 23:16:42.9054 1088/7f56c8a30700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
[ 2017-02-06 23:16:42.9055 1088/7f56ce6b3d00 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
[ 2017-02-06 23:16:42.9055 1081/7fd4826fa700 Ser/Server.h:817 ]: [ApiServer] Freed 0 spare client objects
[ 2017-02-06 23:16:42.9055 1081/7fd4826fa700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
[ 2017-02-06 23:16:43.0683 1127/7f64d2621d00 age/Wat/WatchdogMain.cpp:1281 ]: Starting Passenger watchdog...
[ 2017-02-06 23:16:43.0715 1130/7fa99d107d00 age/Cor/CoreMain.cpp:1070 ]: Starting Passenger core...
[ 2017-02-06 23:16:43.0716 1130/7fa99d107d00 age/Cor/CoreMain.cpp:245 ]: Passenger core running in multi-application mode.
[ 2017-02-06 23:16:43.0737 1130/7fa99d107d00 age/Cor/CoreMain.cpp:820 ]: Passenger core online, PID 1130
[ 2017-02-06 23:16:43.0772 1136/7f1a31534d00 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2017-02-06 23:16:43.0776 1136/7f1a31534d00 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 1136
[Mon Feb 06 23:16:43.078579 2017] [mpm_event:notice] [pid 838:tid 139947678662592] AH00489: Apache/2.4.25 (Unix) Phusion_Passenger/5.1.2 configured -- resuming n$
[Mon Feb 06 23:16:43.078699 2017] [core:notice] [pid 838:tid 139947678662592] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[ 2017-02-06 23:16:43.1472 1081/7fd495dacd00 age/Cor/CoreMain.cpp:1055 ]: Passenger core shutdown finished
[ 2017-02-06 23:16:45.6587 1130/7fa997cae700 age/Cor/SecurityUpdateChecker.h:464 ]: Security update check: no update found (next check in 24 hours)
/var/log/httpd/access_log
127.0.0.1 - - [06/Feb/2017:23:16:58 +0100] "GET / HTTP/1.1" 200 481
127.0.0.1 - - [06/Feb/2017:23:17:01 +0100] "GET /favicon.ico HTTP/1.1" 404 1126
127.0.0.1 - - [06/Feb/2017:23:18:35 +0100] "GET / HTTP/1.1" 200 481
127.0.0.1 - - [06/Feb/2017:23:18:35 +0100] "GET / HTTP/1.1" 200 481
127.0.0.1 - - [06/Feb/2017:23:18:35 +0100] "GET /icons/blank.gif HTTP/1.1" 304 -
127.0.0.1 - - [06/Feb/2017:23:18:35 +0100] "GET /favicon.ico HTTP/1.1" 404 1126
/usr/share/webapps/redmine/log dosent contain a file for 2017-02-06
(neither rubys log nor passenger?)
for "journalctl -S today -u httpd" i only get:
-- Logs begin at Sat 2016-09-17 11:12:13 CEST, end at Mon 2017-02-06 23:36:36 CET. --
Feb 06 23:16:42 arch-devel systemd[1]: Started Apache Web Server.
Edit 2:
Moved block to /etc/httpd/conf/extra/httpd-vhosts.conf, and enable it in /etc/httpd/conf/httpd.conf
(Effectively the block was moved to before the "passenger" block, no other configuration was given in httpd.conf)
After the next restart ther were acces problems (Apache cant acces /usr), which were solved by changing httpd-vhosts.conf:
<VirtualHost *:3000>
DocumentRoot /usr/share/webapps/redmine/public
<Directory /usr/share/webapps/redmine/public>
Options -MultiViews
AllowOverride all
Require all granted
Allow from all
</Directory>
ErrorLog "/var/log/httpd/redmine_log"
</VirtualHost>

Related

Passenger UstRouter configuration failed

I'm an unable to start apache2 service because of the following error when it tries to start the Passenger UstRouter:
[ 2023-02-14 04:32:47.6529 353516/7f992aa77980 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
[ 2023-02-14 04:32:47.6911 353519/7fa5a50be980 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
[ 2023-02-14 04:32:47.6913 353519/7fa5a50be980 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
[ 2023-02-14 04:32:47.6940 353519/7fa5a50be980 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 353519
[ 2023-02-14 04:32:47.7323 353524/7f4e122d5980 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2023-02-14 04:32:47.7440 353524/7f4e122d5980 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 353524
AH00016: Configuration Failed
[ 2023-02-14 04:32:47.7792 353519/7fa59ffff700 age/Cor/CoreMain.cpp:531 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2023-02-14 04:32:47.7794 353519/7fa5a50be980 age/Cor/CoreMain.cpp:900 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2023-02-14 04:32:47.7795 353524/7f4e121e3700 age/Ust/UstRouterMain.cpp:421 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2023-02-14 04:32:47.7797 353519/7fa59f7fe700 Ser/Server.h:816 ]: [ServerThr.2] Freed 128 spare client objects
[ 2023-02-14 04:32:47.7798 353519/7fa59f7fe700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
[ 2023-02-14 04:32:47.7813 353519/7fa59effd700 Ser/Server.h:816 ]: [ApiServer] Freed 0 spare client objects
[ 2023-02-14 04:32:47.7813 353519/7fa59effd700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
[ 2023-02-14 04:32:47.7814 353519/7fa59ffff700 Ser/Server.h:816 ]: [ServerThr.1] Freed 128 spare client objects
[ 2023-02-14 04:32:47.7814 353519/7fa59ffff700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
I'm not familiar with Passenger UstRouter at all, so I've never tried to modify anything to with Passenger and thus unsure of what caused the problem in it's configuration. What steps can I follow to resolve this issue?

Centos 7 - httpd service fails once every 5 days with status code 254/n/a

That's weird because it happens only once every 5 nights.
I have a cron job which restarts httpd service every night, but I'm receiving this error once every 5 nights.
Apr 24 04:33:03 system systemd: httpd.service: main process exited, code=exited, status=254/n/a
Apr 24 04:33:03 system systemd: Unit httpd.service entered failed state.
Apr 24 04:33:03 system systemd: httpd.service failed.
And this is my script to restart httpd
...
/usr/sbin/httpd -k restart
...
I've checked permissions of /tmp folder and it all looks good.
File: ‘/tmp’
Size: 12288 Blocks: 24 IO Block: 4096 directory
Device: 803h/2051d Inode: 2359297 Links: 24
Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-04-25 10:05:41.726022978 +0300
Modify: 2022-04-25 10:07:02.568018159 +0300
Change: 2022-04-25 10:07:02.568018159 +0300
Birth: -
And this is what i found in error_log of httpd.
Fatal Error Unable to create lock file: Bad file descriptor (9)

Service running on RHEL7.5 is not running on RHEL8 (httpd service)

I have service which was working fine with RHEL 7.5, now I have upgraded to RHEL 8 and same service is failing with below status:
Service.service - LSB: Web Server
Loaded: loaded (/etc/rc.d/init.d/Service; generated)
Active: failed (Result: protocol) since Mon 2020-04-06 12:02:21 IST; 38min ago
Docs: man:systemd-sysv-generator(8)
Process: 403 ExecStart=/etc/rc.d/init.d/Service start (code=exited, status=0/SUCCESS)
Apr 06 12:02:21 localhost.localdomain systemd[1]: Starting LSB: Web Server...
Apr 06 12:02:21 localhost.localdomain Service[403]: httpd (pid 29434) already running
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:
/usr/local/apache/logs/Service.pid
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain:
/usr/local/apache/logs/Service.pid
Apr 06 12:02:21 localhost.localdomain systemd[1]: Service.service: Failed with result 'protocol'.
Apr 06 12:02:21 localhost.localdomain systemd[1]: Failed to start LSB: Web Server
THis is my Service unit placed under /etc/init.d/Service, same is done for RHEL 7.5 but there this service is working and in RHEL 8 it is not. One more thing here to note is web server is working as expected although giving me this error.
#!/bin/sh
#
# chkconfig: 345 97 03
# description:Web Server
# processname: httpd
# config: /usr/local/Test/apache/conf/httpd.conf
# pidfile: /usr/local/Test/apache/logs/httpd.pid
### BEGIN INIT INFO
# Provides: Service
# Required-Start: $remote_fs $network $syslog
# Should-Start:
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6`enter code here`
# Short-Description: Web Server
# Description: Web Server
### END INIT INFO
LANG=en_US.iso88591
export LANG
BASEDIR=/usr/local/Test/apache
PATH=$BASEDIR/bin:/usr/bin:/bin
export PATH
LD_LIBRARY_PATH=$BASEDIR/lib
export LD_LIBRARY_PATH
inst=/usr/local/Test
MIBDIRS=$inst/mibs
export MIBDIRS
case $1 in
start)
apachectl start
;;
stop)
apachectl stop
;;
restart)
apachectl restart
;;
*)
echo "usage: $0 { start | stop | restart }"
;;
esac
Plz help me into this.

how can I fix a redirect loop when using Devise with SSL on staging server?

I've installed a self signed cert on my staging server. I'm using that to test my ssl set up. I'm using Devise 1.5 for logins and following this article on the devise wiki for ssl / http config.
The docs say:
And make sure to enable SSL on the server (Nginx, Apache, etc.). If
the servers are not configured properly, Rails will not recognize the
request as SSL (even if it is), and cause an infinite redirect loop.
Ok that sure looks like what is happening, but I strongly suspect I don't need to 'flip the switch' on SSL (this is an EngineYard instance). I have an SSL cert installed on the server.
I've checked the file /etc/nginx/servers/MyAppName.ssl.conf and it has these lines:
ssl on;
ssl_certificate /etc/nginx/ssl/MyAppName.crt;
ssl_certificate_key /etc/nginx/ssl/MyAppName.key;
ssl_prefer_server_ciphers on;
ssl_protocols SSLv3 TLSv1;
So that looks ... right? I don't want to mess with it that's for sure.
My RegistrationsController has force_ssl :only => [:new, :create, :edit, :update], so all authentication actions should be forcing ssl as far as I can tell. SessionsController has force_ssl :only => [:new, :create].
I realize that there's a lot of moving parts here, but what should I look at next?
Here's the rails logs:
Started GET "/users/sign_in" for 98.246.164.160 at 2012-02-29 20:47:39 +0000
[29 Feb 20:47 23166 INFO] Processing by Devise::SessionsController#new as HTML
[29 Feb 20:47 23166 DEBUG] Parameters: {"action"=>"new", "controller"=>"devise/sessions"}
[29 Feb 20:47 23166 INFO] Redirected to https://ec2-xxx-xxx-106-255.us-west-2.compute.amazonaws.com/users/sign_in
[29 Feb 20:47 23166 INFO] Completed 301 Moved Permanently in 1ms
[29 Feb 20:47 23166 INFO]
Started GET "/users/sign_in" for 98.246.164.160 at 2012-02-29 20:47:39 +0000
[29 Feb 20:47 23166 INFO] Processing by Devise::SessionsController#new as HTML
[29 Feb 20:47 23166 DEBUG] Parameters: {"action"=>"new", "controller"=>"devise/sessions"}
[29 Feb 20:47 23166 INFO] Redirected to http://ec2-xxx-xxx-106-255.us-west-2.compute.amazonaws.com/users/sign_in
[29 Feb 20:47 23166 INFO] Completed 302 Found in 1ms
[29 Feb 20:47 23166 INFO]
Started GET "/users/sign_in" for 98.246.164.160 at 2012-02-29 20:47:39 +0000
[29 Feb 20:47 23166 INFO] Processing by Devise::SessionsController#new as HTML
[29 Feb 20:47 23166 DEBUG] Parameters: {"action"=>"new", "controller"=>"devise/sessions"}
[29 Feb 20:47 23166 INFO] Redirected to https://ec2-xxx-xxx-106-255.us-west-2.compute.amazonaws.com/users/sign_in
[29 Feb 20:47 23166 INFO] Completed 301 Moved Permanently in 1ms
For those of you who arrived here via Google, let me post another possible cause of this problem that just wasted my day, hopefully it won't waste yours.
If you are using Passenger in production, and you configure it with a VirtualHost in Apache (in conf/httpd.conf for example), but you do NOT configure it in conf.d/ssl.conf, you could get the looping problem. The symptom you will have if this misconfiguration is causing your problem will be that request.ssl? will always be false, even if you explicitly enter https in your request. To check your symptom, you can put a before_filter debugging hook in application_controller.rb with something like:
class ApplicationController < ActionController::Base
before_filter :check_ssl
def check_ssl
logger.info("==== ssl: #{request.ssl? }")
end
end
If it always logs ==== ssl: false even when you send it a https://whatever request, then the VirtualHost configuration might be your problem. If you put your DocumentRoot and Directory directives for your rails app in the VirtualHost in conf.d/ssl.conf, it will fix the problem. At least it did for me.
The solution to this lied in the 'ensure_proper_protocol' method from the gist. I renamed it to make it more readable and it looks like this:
def ssl_forced_action?
(params[:controller] == 'devise/sessions' && ['new', 'create'].include?(params[:action])) ||
(params[:controller] == 'devise/registrations' && ['new', 'create', 'edit', 'update'].include?(params[:action])) ||
(params[:controller] == 'users/omniauth_callbacks')
end
Note that the original used users/sessions.

Two virtual machines limited in one physical machine above Eucalyptus Xen

I have an Eucalyptus-based cloud using Xen with 3 nodes. When I run a VM more than twice the number of physical machines in the xen cluster, the extra VMs never boot up, they always change state from pending to terminate, and the log file shows the node controller shutoff the extra VM after it check the instances number. When I manually shutdown some VM, then I can easily start up some VM exactly as the number I've shutdown.
The log shows this error:
ERROR: [Tue Jan 17 12:51:05 2012][004231][EUCAERROR ] libvirt: POST
operation failed: xend_post: error from xen daemon: (xend.err 'Device
2049 (vbd) could not be connected. /etc/xen/scripts/block failed;
error detected.') (code=11) [Tue Jan 17 12:51:05
2012][004231][EUCADEBUG ] doDescribeResource() invoked [Tue Jan 17
12:51:06 2012][004231][EUCADEBUG ] doDescribeInstances() invoked [Tue
Jan 17 12:51:06 2012][004231][EUCADEBUG ] doDescribeInstances():
instanceId=i-3BB00757 publicIp=192.168.4.165 privateIp=192.168.4.165
mac=d0:0d:3B:B0:07:57 vlan=-1 networkIndex=-1 [Tue Jan 17 12:51:06
2012][004231][EUCADEBUG ] doDescribeInstances(): instanceId=i-473807EE
publicIp=192.168.4.112 privateIp=192.168.4.112 mac=d0:0d:47:38:07:EE
vlan=-1 networkIndex=-1 [Tue Jan 17 12:51:06 2012][004231][EUCADEBUG ]
doDescribeInstances(): instanceId=i-348A06AE publicIp=0.0.0.0
privateIp=0.0.0.0 mac=d0:0d:34:8A:06:AE vlan=-1 networkIndex=-1 [Tue
Jan 17 12:51:06 2012][004231][EUCAERROR ] libvirt: POST operation
failed: xend_post: error from xen daemon: (xend.err 'Device 2049 (vbd)
could not be connected. /etc/xen/scripts/block failed; error
detected.') (code=11) [Tue Jan 17 12:51:08 2012][004231][EUCAERROR ]
libvirt: POST operation failed: xend_post: error from xen daemon:
(xend.err 'Device 2049 (vbd) could not be connected.
/etc/xen/scripts/block failed; error detected.') (code=11) [Tue Jan 17
12:51:09 2012][004231][EUCAERROR ] libvirt: POST operation failed:
xend_post: error from xen daemon: (xend.err 'Device 2051 (vbd) could
not be connected. /etc/xen/scripts/block failed; error detected.')
(code=11) [Tue Jan 17 12:51:10 2012][004231][EUCAERROR ] libvirt: POST
operation failed: xend_post: error from xen daemon: (xend.err 'Device
2051 (vbd) could not be connected. /etc/xen/scripts/block failed;
error detected.') (code=11) [Tue Jan 17 12:51:10
2012][004231][EUCAFATAL ] hypervisor failed to start domain [Tue Jan
17 12:51:10 2012][004231][EUCADEBUG ] state change for instance
i-348A06AE: Staging -> Shutoff (Extant) [Tue Jan 17 12:51:10
2012][004231][EUCAERROR ] libvirt: Domain not found:
xenUnifiedDomainLookupByName (code=42) [Tue Jan 17 12:51:10
2012][004231][EUCAINFO ] cleaning up state for instance i-348A06AE
Is this a limitation for CentOS 5.* and RedHat 5.? Is it fixed on CentOS 6.?
http://docs.vmd.citrix.com/XenServer/5.0.0/1.0/en_gb/guest.html#rhel5_limitations
"Only 3 virtual network interfaces are supported in versions below 5.2. For 5.2 and above, 7 virtual network interfaces are supported."
I opened this topic in both CentOS and Eucalyptus forums without luck:
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=35491&forum=38
http://open.eucalyptus.com/forum/unable-run-more-4-instances-even-extra-resources
Thanks, Leandro
The error you are seeing seems related to disk not to network (Device 2049 (vbd) could not be connected. /etc/xen/scripts/block failed; error detected). I don't see that script on a CentOS 5.7 install I have here, so you may want to dig into that script to see if there is some obvious error.
The solution was to increase number of loop devices in CentOS 5, as detailed in the following link:
http://open.eucalyptus.com/participate/wiki/increase-number-loop-devices-centos-5
As the link is no longer valid, you have to go to archive.org or see this similar answer:
how to increase the loop devices number