Centos7+httpd+fastcgi+rails Installation

Source: Internet
Author: User

Setting the Environment:

Centos7

apache/2.4.6

fastcgi2.4.6

Rails4

A problem was encountered while installing FASTCGI:

Problem:

。。。。。。

In file included from fcgi.h:28:0,
From mod_fastcgi.c:72:
/usr/include/httpd/http_log.h:456:18:note:expected ' const struct REQUEST_REC * ' but argument is of type ' char * '
Ap_declare (void) ap_log_rerror_ (const char *file, int line, int module_index,
^
Make: * * [Mod_fastcgi.slo] Error 1

Answer: After inquiry information, because apache/2.4.6 is imperfect, need patch file to perfect it

The following write the correct procedure:

1 Installing the HTTPD server

#yum Install httpd Httpd-devel

2 Installing fastcgi (download and install first)

2.1 Download MOD_FASTCGI Source Package

# wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz

2.2 Unzip the installation (after the decompression to hit the patch first)

## tar zxvf mod_fastcgi-2.4.6.tar.gz
# CD mod_fastcgi-2.4.6
2.3 Download patch files
Http://leeon.me/upload/other/byte-compile-against-apache24.diff

2.4 Upload the patch file to the extracted mod_fastcgi file directory (my path here is/root/mod_fastcgi-2.4.6)

or directly create a file yourself to copy the downloaded patch files directly to the created patch file love You (file name with your own, do not affect)

#vim Fastcgi_patch

2.5 Copy all the contents of this downloaded patch file, I put the full content of this patch is also posted, do not want to download can directly copy my


Index:libapache-mod-fastcgi/fcgi.h
===================================================================
---libapache-mod-fastcgi.orig/fcgi.h 2012-03-07 14:29:04.005720240 +0100
+ + + libapache-mod-fastcgi/fcgi.h 2012-03-07 14:29:07.830566657 +0100
@@ -34,6 +34,10 @@
#define APACHE2
#endif

+ #ifdef Ap_declare_module
+ #define APACHE24
+ #endif
+
#ifdef APACHE2

#include <sys/stat.h>
@@ -57,10 +61,16 @@
#define XTOFFSETOF Apr_offsetof
#define AP_SELECT Select

+ #ifdef APACHE24
+ #define UNIXD_CONFIG Ap_unixd_config
+ #endif
+
+ #ifdef APACHE2
#define AP_USER_ID unixd_config.user_id
#define AP_GROUP_ID unixd_config.group_id
#define AP_USER_NAME Unixd_config.user_name
#define Ap_suexec_enabled unixd_config.suexec_enabled
+ #endif

#ifndef S_isdir
#define S_ISDIR (M) (((m) & (S_IFMT) = = (S_ifdir))
@@ -365,42 +375,42 @@
#ifdef APACHE2

#ifdef WIN32
-#define Fcgi_log_emerg __file__,__line__,aplog_emerg,apr_from_os_error (GetLastError ())
-#define Fcgi_log_alert __file__,__line__,aplog_alert,apr_from_os_error (GetLastError ())
-#define Fcgi_log_crit __file__,__line__,aplog_crit,apr_from_os_error (GetLastError ())
-#define FCGI_LOG_ERR __file__,__line__,aplog_err,apr_from_os_error (GetLastError ())
-#define Fcgi_log_warn __file__,__line__,aplog_warning,apr_from_os_error (GetLastError ())
-#define Fcgi_log_notice __file__,__line__,aplog_notice,apr_from_os_error (GetLastError ())
-#define FCGI_LOG_INFO __file__,__line__,aplog_info,apr_from_os_error (GetLastError ())
-#define FCGI_LOG_DEBUG __file__,__line__,aplog_debug,apr_from_os_error (GetLastError ())
+ #define Fcgi_log_emerg Aplog_mark,aplog_emerg,apr_from_os_error (GetLastError ())
+ #define Fcgi_log_alert Aplog_mark,aplog_alert,apr_from_os_error (GetLastError ())
+ #define Fcgi_log_crit Aplog_mark,aplog_crit,apr_from_os_error (GetLastError ())
+ #define FCGI_LOG_ERR Aplog_mark,aplog_err,apr_from_os_error (GetLastError ())
+ #define Fcgi_log_warn Aplog_mark,aplog_warning,apr_from_os_error (GetLastError ())
+ #define Fcgi_log_notice Aplog_mark,aplog_notice,apr_from_os_error (GetLastError ())
+ #define FCGI_LOG_INFO Aplog_mark,aplog_info,apr_from_os_error (GetLastError ())
+ #define FCGI_LOG_DEBUG Aplog_mark,aplog_debug,apr_from_os_error (GetLastError ())
#else/*! WIN32 * *
-#define Fcgi_log_emerg __file__,__line__,aplog_emerg,apr_from_os_error (errno)
-#define Fcgi_log_alert __file__,__line__,aplog_alert,apr_from_os_error (errno)
-#define Fcgi_log_crit __file__,__line__,aplog_crit,apr_from_os_error (errno)
-#define FCGI_LOG_ERR __file__,__line__,aplog_err,apr_from_os_error (errno)
-#define Fcgi_log_warn __file__,__line__,aplog_warning,apr_from_os_error (errno)
-#define Fcgi_log_notice __file__,__line__,aplog_notice,apr_from_os_error (errno)
-#define Fcgi_log_info __file__,__line__,aplog_info,apr_from_os_error (errno)
-#define FCGI_LOG_DEBUG __file__,__line__,aplog_debug,apr_from_os_error (errno)
-#endif
-
-#define Fcgi_log_emerg_errno __file__,__line__,aplog_emerg,apr_from_os_error (ERRNO)
-#define Fcgi_log_alert_errno __file__,__line__,aplog_alert,apr_from_os_error (ERRNO)
-#define Fcgi_log_crit_errno __file__,__line__,aplog_crit,apr_from_os_error (ERRNO)
-#define Fcgi_log_err_errno __file__,__line__,aplog_err,apr_from_os_error (ERRNO)
-#define Fcgi_log_warn_errno __file__,__line__,aplog_warning,apr_from_os_error (ERRNO)
-#define Fcgi_log_notice_errno __file__,__line__,aplog_notice,apr_from_os_error (ERRNO)
-#define Fcgi_log_info_errno __file__,__line__,aplog_info,apr_from_os_error (ERRNO)
-#define Fcgi_log_debug_errno __file__,__line__,aplog_debug,apr_from_os_error (ERRNO)
-
-#define Fcgi_log_emerg_noerrno __file__,__line__,aplog_emerg,0
-#define Fcgi_log_alert_noerrno __file__,__line__,aplog_alert,0
-#define Fcgi_log_crit_noerrno __file__,__line__,aplog_crit,0
-#define Fcgi_log_err_noerrno __file__,__line__,aplog_err,0
-#define Fcgi_log_warn_noerrno __file__,__line__,aplog_warning,0
-#define Fcgi_log_notice_noerrno __file__,__line__,aplog_notice,0
-#define Fcgi_log_info_noerrno __file__,__line__,aplog_info,0
-#define Fcgi_log_debug_noerrno __file__,__line__,aplog_debug,0
+ #define Fcgi_log_emerg aplog_mark,aplog_emerg,apr_from_os_error (errno)
+ #define Fcgi_log_alert aplog_mark,aplog_alert,apr_from_os_error (errno)
+ #define Fcgi_log_crit aplog_mark,aplog_crit,apr_from_os_error (errno)
+ #define FCGI_LOG_ERR aplog_mark,aplog_err,apr_from_os_error (errno)
+ #define Fcgi_log_warn aplog_mark,aplog_warning,apr_from_os_error (errno)
+ #define Fcgi_log_notice aplog_mark,aplog_notice,apr_from_os_error (errno)
+ #define Fcgi_log_info aplog_mark,aplog_info,apr_from_os_error (errno)
+ #define FCGI_LOG_DEBUG aplog_mark,aplog_debug,apr_from_os_error (errno)
+ #endif
+
+ #define Fcgi_log_emerg_errno aplog_mark,aplog_emerg,apr_from_os_error (ERRNO)
+ #define Fcgi_log_alert_errno aplog_mark,aplog_alert,apr_from_os_error (ERRNO)
+ #define Fcgi_log_crit_errno aplog_mark,aplog_crit,apr_from_os_error (ERRNO)
+ #define Fcgi_log_err_errno aplog_mark,aplog_err,apr_from_os_error (ERRNO)
+ #define Fcgi_log_warn_errno aplog_mark,aplog_warning,apr_from_os_error (ERRNO)
+ #define Fcgi_log_notice_errno aplog_mark,aplog_notice,apr_from_os_error (ERRNO)
+ #define Fcgi_log_info_errno aplog_mark,aplog_info,apr_from_os_error (ERRNO)
+ #define Fcgi_log_debug_errno aplog_mark,aplog_debug,apr_from_os_error (ERRNO)
+
+ #define Fcgi_log_emerg_noerrno aplog_mark,aplog_emerg,0
+ #define Fcgi_log_alert_noerrno aplog_mark,aplog_alert,0
+ #define Fcgi_log_crit_noerrno aplog_mark,aplog_crit,0
+ #define Fcgi_log_err_noerrno aplog_mark,aplog_err,0
+ #define Fcgi_log_warn_noerrno aplog_mark,aplog_warning,0
+ #define Fcgi_log_notice_noerrno aplog_mark,aplog_notice,0
+ #define Fcgi_log_info_noerrno aplog_mark,aplog_info,0
+ #define Fcgi_log_debug_noerrno aplog_mark,aplog_debug,0

#else/*! APACHE2 * *

Index:libapache-mod-fastcgi/mod_fastcgi.c
===================================================================
---libapache-mod-fastcgi.orig/mod_fastcgi.c 2012-03-07 14:29:04.017047773 +0100
+ + + libapache-mod-fastcgi/mod_fastcgi.c 2012-03-07 14:29:07.841272721 +0100
@@ -97,6 +97,10 @@
} while (0)
#endif

+ #ifdef APACHE24
+module Ap_module_declare_data Fastcgi_module;
+ #endif
+
/*
* Global Variables
*/
@@ -3014,7 +3018,11 @@
Ap_hook_fixups (fixups, NULL, NULL, apr_hook_middle);
}

+ #ifdef APACHE24
+ap_declare_module (fastcgi) =
+ #else
Module Ap_module_declare_data fastcgi_module =
+ #endif
{
Standard20_module_stuff,
Fcgi_config_create_dir_config,/* per-directory Config Creator */



File content is already in contact (do not copy this line)

Then save exit (Wq)

Perform a patch operation on the extracted fcgi.h file

#patch Fcgi.h < Fastcgi_patch

(if it is uploaded to the URL just to download the file will be replaced by the corresponding name, that is #patch fcgi.h < Byte-compile-against-apache24.diff)

3 Perform a compilation installation, but modify the path under installation before installing

# CP Makefile.ap2 Makefile
# Vim Makefile
To modify the Top_dir directory, the path of the 64-bit system to the lib64,32-bit system is /usr/lib/httpd

Top_dir =/usr/lib64/httpd

After you save the exit, start the compilation installation.
# make
# make Install

Here, Mod_fastcgi.so has been installed.


Centos7+httpd+fastcgi+rails Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.