1

I am in the middle of a process of installing Redmine served with passenger and nginx with this tutorial. With the passenger-install-nginx-module, it works fine and during compiling it outputs an error with this,

Compiling and installing Nginx...
# sh ./configure --prefix='/etc/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --with-pcre='/tmp/root-passenger-3197/pcre-8.31' --add-module='/var/lib/gems/1.8/gems/passenger-3.0.18/ext/nginx'
checking for OS
 + Linux 3.2.0-32-generic-pae i686
checking for C compiler ... not found

./configure: error: C compiler gcc is not found

--------------------------------------------

It looks like something went wrong

I don't understand why it cannot find gcc, but in the precheck step it said that gcc is found,

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * The 'make' tool... found at /usr/bin/make
 * A download tool like 'wget' or 'curl'... found at /usr/bin/wget
 * Ruby development headers... found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /usr/bin/rake
 * rack... found
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found

I then apt-get the possible gcc packages, but none were installed/updated because I already have them.

EDIT:

Packages I've tried with gcc,

gcc-4.4 g++-4.4 libstdc++6-4.4-dev gcc

EDIT:

nginx block for the redmine,

server {

    server_name         redmine.domain.com;

    access_log          /var/www/redmine.access.log;
    error_log           /var/www/redmine.error.log;

    root                /var/www/domain.com/redmine/public;

    passenger_enabled   on;
}

EDIT:

Now it looks like the issue is something to do with passenger_root and passenger_ruby, although I have included it in the nginx.conf now, but I'm not certain if they are the correct paths (what could I do to find the correct ones?)

My nginx.conf

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
    worker_connections 768;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    passenger_root /var/lib/gems/1.8/gems/passenger-3.0.18;
    passenger_ruby /usr/bin/ruby1.8;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}


#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
# 
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

How would I fix this issue?

MacMac
  • 1,931
  • 8
  • 30
  • 38
  • Please copy and paste textual output instead of posting screenshots of text. Also, what are the specific "possible gcc packages" you have installed? – Andrew Marshall Nov 01 '12 at 17:04
  • @AndrewMarshall sorry, I updated my post. – MacMac Nov 01 '12 at 17:15
  • Do you have the `build-essential` package installed? – Andrew Marshall Nov 01 '12 at 17:27
  • @AndrewMarshall Yes. – MacMac Nov 01 '12 at 17:31
  • And `which gcc` gives a path to a working `gcc` bin ? – Anthony Alberto Nov 01 '12 at 18:29
  • @AnthonyAlberto `/usr/bin/gcc` – MacMac Nov 01 '12 at 18:41
  • @AnthonyAlberto Is there anything I can do? – MacMac Nov 02 '12 at 13:13
  • http://code.google.com/p/phusion-passenger/issues/detail?id=578 did you see this? Looks like first installing nginx might help ...' – Anthony Alberto Nov 02 '12 at 13:17
  • Or http://stackoverflow.com/questions/12770501/c-compiler-gcc-not-found-while-installing-passenger-and-nginx – Anthony Alberto Nov 02 '12 at 13:18
  • @AnthonyAlberto That worked. However, redmine doesn't seem to be working since I get an 403 forbidden error. In nginx logs I found `nginx: [emerg] unknown directive "passenger_enabled" in /etc/nginx/sites-enabled/site:33` – MacMac Nov 02 '12 at 14:26
  • Did you rerun `passenger-install-nginx-module` after installing nginx? Did you restart nginx? – Anthony Alberto Nov 02 '12 at 14:27
  • I didn't install nginx manually, `passenger-install-nginx-module` installed nginx itself and I restarted nginx after installing too. – MacMac Nov 02 '12 at 14:35
  • @AnthonyAlberto It seems that passenger is not present, however in the `passenger-install-nginx-module` it included the configure option `./configure --prefix='/etc/nginx' --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt='-Wno-error' --with-pcre='/tmp/root-passenger-13336/pcre-8.31' --add-module='/var/lib/gems/1.8/gems/passenger-3.0.18/ext/nginx'` so what could be wrong? – MacMac Nov 02 '12 at 16:11
  • @AnthonyAlberto Ah, my bad. I didn't start `passenger` which I have done now, I am now getting 403 errors with `[error] 26234#0: *1 directory index of "/var/www/site.com/redmine/public/" is forbidden` – MacMac Nov 02 '12 at 16:23
  • @AnthonyAlberto Sorry to bug you, but could you help me? – MacMac Nov 02 '12 at 19:06
  • Can you paste your nginx config for the redmine vhost? – Anthony Alberto Nov 02 '12 at 19:32
  • @AnthonyAlberto Updated my post. – MacMac Nov 02 '12 at 19:38
  • Try to put `passenger_enabled on;` before the `root` instruction maybe? – Anthony Alberto Nov 02 '12 at 19:40
  • @AnthonyAlberto didn't work. – MacMac Nov 02 '12 at 19:44
  • try `sudo chown -R nginx:nginx /var/www/site.com/redmine/` ? . Or replace nginx by whatever is your nginx user and restart nginx – Anthony Alberto Nov 02 '12 at 19:49
  • @AnthonyAlberto I did that (for `www-data` user), doesn't work too. – MacMac Nov 02 '12 at 19:52
  • `chmod 755 /var/www/site.com/redmine/` maybe? If this doesn't work, double check that somewhere in your nginx config you have both `passenger_ruby` and `passenger_root` defined and that they point to an existing and valid folder – Anthony Alberto Nov 02 '12 at 20:03
  • Yeah, I have them defined in `/etc/nginx/nginx.conf` which has `passenger_root /var/lib/gems/1.8/gems/passenger-3.0.18;` `passenger_ruby /usr/bin/ruby1.8;` But I'm not entirely certain if the paths are correct, how would I be able to find the correct ones? – MacMac Nov 02 '12 at 20:11
  • @AnthonyAlberto hey, what's your opinion on this? – MacMac Nov 03 '12 at 12:16

1 Answers1

1

My solution was that /tmp was mounted as noexec. I needed to remount it so that passenger-install-nginx-module could compile there:

mount -o remount,rw,exec,nosuid /tmp

excid3
  • 111
  • 3