Arch Linux + NGINX + Passenger

198 views
Skip to first unread message

Steve Nims

unread,
May 11, 2012, 2:20:27 PM5/11/12
to phusion-...@googlegroups.com
I can't seem to get Passenger and NGINX to play nice...I try to recompile (using Arch Linux ABS) NGINX w/ Passenger support and this is the output of my "makepkg" command:

[steve@McArchy nginx]$ makepkg -f
==> Making package: nginx 1.2.0-3 (Fri May 11 12:46:53 EDT 2012)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving Sources...
  -> Found nginx-1.2.0.tar.gz
  -> Found nginx
==> Validating source files with md5sums...
    nginx-1.2.0.tar.gz ... Passed
    nginx ... Passed
==> Extracting Sources...
  -> Extracting nginx-1.2.0.tar.gz with bsdtar
==> Removing existing pkg/ directory...
==> Starting build()...
checking for OS
 + Linux 3.0.18-linode43 i686
checking for C compiler ... found
 + using GNU C compiler
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for int size ... 4 bytes
checking for long size ... 4 bytes
checking for long long size ... 8 bytes
checking for void * size ... 4 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system endianess ... little endianess
checking for size_t size ... 4 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 4 bytes
checking for AF_INET6 ... found
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
configuring additional modules
adding module in /home/steve/.gem/ruby/gems/1.9.1/gems/passenger-3.0.12/ext/nginx
./configure: error: no /home/steve/.gem/ruby/gems/1.9.1/gems/passenger-3.0.12/ext/nginx/config was found
==> ERROR: A failure occurred in build().
    Aborting...

Which is strange because the config file exists:

[steve@McArchy nginx]$ pwd
/home/steve/.gem/ruby/1.9.1/gems/passenger-3.0.12/ext/nginx
[steve@McArchy nginx]$ ls -l -a -p
total 224
drwxr-xr-x  2 steve users  4096 May 11 11:55 ./
drwxr-xr-x 10 steve users  4096 May 11 11:55 ../
-rw-r--r--  1 steve users  2014 May 11 11:55 config
-rw-r--r--  1 steve users 49287 May 11 11:55 Configuration.c
-rw-r--r--  1 steve users  3712 May 11 11:55 Configuration.h
-rw-r--r--  1 steve users 50739 May 11 11:55 ContentHandler.c
-rw-r--r--  1 steve users  2205 May 11 11:55 ContentHandler.h
-rw-r--r--  1 steve users 41942 May 11 11:55 HelperAgent.cpp
-rw-r--r--  1 steve users 18613 May 11 11:55 ngx_http_passenger_module.c
-rw-r--r--  1 steve users  2415 May 11 11:55 ngx_http_passenger_module.h
-rw-r--r--  1 steve users 10497 May 11 11:55 ScgiRequestParser.h
-rw-r--r--  1 steve users  7466 May 11 11:55 StaticContentHandler.c
-rw-r--r--  1 steve users  1770 May 11 11:55 StaticContentHandler.h

So I thought I'd try to run "rake nginx" and this happens:
[steve@McArchy ext]$ rake nginx
(in /home/steve/.gem/ruby/1.9.1/gems/passenger-3.0.12)
g++ -Iext -Iext/common -Iext/libev  -D_REENTRANT -I/usr/local/include -DHASH_NAMESPACE="__gnu_cxx" -DHASH_NAMESPACE="__gnu_cxx" -DHASH_FUN_H="<hash_fun.h>" -DHAS_ALLOCA_H -DHAS_SFENCE -DHAS_LFENCE -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-missing-field-initializers -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/common/libpassenger_common/Utils/Base64.o -c ext/common/Utils/Base64.cpp
In file included from ext/common/Utils/Base64.h:34:0,
                 from ext/common/Utils/Base64.cpp:30:
ext/common/Utils/../StaticString.h: In static member function ‘static const char* Passenger::StaticString::memmem(const char*, std::basic_string<char>::size_type, const char*, std::basic_string<char>::size_type)’:
ext/common/Utils/../StaticString.h:66:6: error: ‘ssize_t’ was not declared in this scope
ext/common/Utils/../StaticString.h:66:14: error: expected ‘;’ before ‘new_len’
ext/common/Utils/../StaticString.h:67:10: error: ‘new_len’ was not declared in this scope
rake aborted!
Command failed with status (1): [g++ -Iext -Iext/common -Iext/libev  -D_REE...]

Tasks: TOP => nginx => agents/nginx/PassengerHelperAgent => ext/common/libpassenger_common.a => ext/common/libpassenger_common/Utils/Base64.o
(See full trace by running task with --trace)

Luuk (Phusion)

unread,
May 11, 2012, 4:13:07 PM5/11/12
to phusion-...@googlegroups.com
Steve,

Can you post your PKGBUILD file? Do you perhaps have a commented line preceding the '--add-module' line? Strangely enough, that caused an error on my Arch system.
> --
> You received this message because you are subscribed to the Google Groups "Phusion Passenger Discussions" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/phusion-passenger/-/3cmZ0TOP4-0J.
> To post to this group, send email to phusion-...@googlegroups.com.
> To unsubscribe from this group, send email to phusion-passen...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/phusion-passenger?hl=en.
>

--
Phusion | Ruby & Rails deployment, scaling and tuning solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Steve Nims

unread,
May 11, 2012, 7:21:44 PM5/11/12
to phusion-...@googlegroups.com
[steve@McArchy nginx]$ cat PKGBUILD
# Steve's NGINX Build

pkgname=nginx
pkgver=1.2.0
pkgrel=3
pkgdesc="lightweight HTTP server and IMAP/POP3 proxy server"
arch=('i686' 'x86_64')
depends=('pcre' 'zlib' 'openssl')
license=('custom')
backup=("etc/nginx/conf/fastcgi.conf"
        "etc/nginx/conf/fastcgi_params"
        "etc/nginx/conf/koi-win"
        "etc/nginx/conf/koi-utf"
        "etc/nginx/conf/mime.types"
        "etc/nginx/conf/nginx.conf"
        "etc/nginx/conf/scgi_params"
        "etc/nginx/conf/uwsgi_params"
        "etc/nginx/conf/win-utf"
        "etc/logrotate.d/nginx"
        "etc/conf.d/nginx")
        'nginx')
md5sums=('a02ef93d65a7031a1ea3256ad5eba626'
         '0e8032d3ba26c3276e8c7c30588d375f')

_doc_root=/srv/www
_server_root=/etc/nginx
_conf_path=${_server_root}/conf
_tmp_path=/var/spool/nginx
_log_path=/var/log/nginx
_user=nginx
_group=nginx

build() {
cd "$srcdir/nginx-${pkgver}"

./configure \
        --prefix=${_server_root} \
        --sbin-path=/usr/sbin/nginx \
        --pid-path=/var/run/nginx.pid \
        --lock-path=/var/lock/nginx.lock \
        --http-client-body-temp-path=${_tmp_path}/client_body_temp \
        --http-proxy-temp-path=${_tmp_path}/proxy_temp \
        --http-fastcgi-temp-path=${_tmp_path}/fastcgi_temp \
        --http-log-path=${_log_path}/access.log \
        --error-log-path=${_log_path}/error.log \
        --user=${_user} --group=${_group} \
        --with-imap --with-imap_ssl_module --with-http_ssl_module \
        --with-http_stub_status_module \
        --with-http_dav_module \
        --with-http_gzip_static_module \
        --with-ipv6 \
        --http-scgi-temp-path=${_tmp_path} \
        --http-uwsgi-temp-path=${_tmp_path} \
--with-http_realip_module \
--add-module=/home/steve/.gem/ruby/gems/1.9.1/gems/passenger-3.0.12/ext/nginx

make
}

package() {
cd "$srcdir/nginx-${pkgver}"
make DESTDIR="$pkgdir" install

install -d "$pkgdir"/etc/logrotate.d/
cat <<EOF > $pkgdir/etc/logrotate.d/nginx
$_log_path/*log {
create 640 http log
compress
postrotate
/bin/kill -USR1 \`cat /var/run/nginx.pid 2>/dev/null\` 2> /dev/null || true
endscript
}
EOF

sed -i -e "s/\<user\s\+\w\+;/user $_user;/g" $pkgdir/$_conf_path/nginx.conf

install -d $pkgdir/$_tmp_path

# install to actual directory and remove unneeded files
install -d $pkgdir/$_doc_root
rm -rf $pkgdir/$_server_root/html
rm -f $pkgdir/$_doc_root/index.html

# let's create links for relative paths in config file
ln -s $_log_path $pkgdir/$_server_root/logs
ln -s $_doc_root $pkgdir/$_server_root/html

install -D -m755 $srcdir/nginx $pkgdir/etc/rc.d/nginx
install -D -m644 LICENSE $pkgdir/usr/share/licenses/nginx/LICENSE
mkdir -p $pkgdir/etc/conf.d
echo "NGINX_CONFIG=/etc/nginx/conf/nginx.conf" >$pkgdir/etc/conf.d/nginx
rm -rf $pkgdir/var/run
> To post to this group, send email to phusion-passenger@googlegroups.com.
> To unsubscribe from this group, send email to phusion-passenger+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages