阿帕奇2.4.x的手动安装在RHEL 6.4 - 没有Apache模块将启动加载 [英] Apache 2.4.x Manual install on RHEL 6.4 - No apache modules will load on start

查看:266
本文介绍了阿帕奇2.4.x的手动安装在RHEL 6.4 - 没有Apache模块将启动加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

操作系统:红帽企业Linux服务器版本6.4(圣地亚哥)

OS: Red Hat Enterprise Linux Server release 6.4 (Santiago)

在此操作系统的Ap​​ache目前百胜安装2.2.15。我需要最新的2.4.x分支所以去了有关手动安装。我注意到,完整的过程我所做的事业,包括拆包APR和APR-util的来源到事先apache的来源,但我想下面是过程中最重要的部分:

The current yum installation of apache on this OS is 2.2.15. I require the latest 2.4.x branch so have gone about installing it manually. I have noted the complete procedure I undertook, including unpacking apr and apr-util sources into the apache sources beforehand, but I guess the following is the most important part of the procedure:

GATHER LATEST APACHE AND APR
$ cd ~
$ mkdir apache-src
$ cd apache-src
$ wget http://apache.insync.za.net//httpd/httpd-2.4.6.tar.gz
$ tar xvf httpd-2.4.6.tar.gz
$ cd httpd-2.4.6
$ cd srclib
$ wget http://apache.insync.za.net//apr/apr-1.5.0.tar.gz
$ tar -xvzf apr-1.5.0.tar.gz
$ mv apr-1.5.0 apr
$ rm -f apr-1.5.0.tar.gz
$ wget http://apache.insync.za.net//apr/apr-util-1.5.3.tar.gz
$ tar -xvzf apr-util-1.5.3.tar.gz 
$ mv apr-util-1.5.3 apr-util

INSTALL DEVEL PACKAGES
yum update --skip-broken (There is a dependency issue with the latest Chrome needing the latest libstdc++, which is not available for RHEL and CentOS)
yum install apr-devel
yum install apr-util-devel
yum install pcre-devel

INSTALL
$ cd ~/apache-src/httpd-2.4.6
$ ./configure --prefix=/etc/httpd --enable-mods-shared="all" --enable-rewrite --with-included-apr
$ make
$ make install

请注意:在运行上面,在/ etc / HTTP的时间是空的。

NOTE: At the time of running the above, /etc/http is empty.

这似乎已经罚款,直到我试图启动httpd服务。似乎每个模块在httpd.conf中包括失败,类似这样的mod_rewrite的一个消息:

This seems to have gone fine until I attempt to start the httpd service. It seems that every module include in httpd.conf fails with a message similar to this one for mod_rewrite:

httpd: Syntax error on line 148 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_rewrite.so into server: /etc/httpd/modules/mod_rewrite.so: undefined symbol: ap_global_mutex_create

我已经通过在httpd.conf启用模块列表右边走了,并评论他们出去一次。所有触发一个错误的方法,但未定义的符号:值往往是不同的(所以不总是ap_global_mutex_create)

I've gone right through the list of enabled modules in httpd.conf and commented them out one at a time. All trigger an error as above, however the "undefined symbol: value" is often different (so not always ap_global_mutex_create).

我缺少的一个步骤?虽然我觉得在谷歌的错误的一些部分,大部分的解决方案中心周围的.so文件不被访问。这似乎并不在这里是一个问题和模块在/ etc / HTTP /模块present。

Am I missing a step? Although I find a some portion of that error on Google, most of the solutions centre around the .so files not being reachable. That doesn't seem to be an issue here and the modules are present in /etc/http/modules.

请注意:在运行上面,在/ etc / HTTP的时间是空的。

NOTE: At the time of running the above, /etc/http is empty.

推荐答案

您有正确的程序,但它是不完整的。

You have the correct procedure but it's incomplete.

您必须启用的的httpd.conf 的SSL安装后。而产生的 server.crt 的和的 server.key 的文件。
下面的完整过程:

After the installation you have to enable SSL in httpd.conf. and generate server.crt and server.key file. Below the complete procedure :

1。下载Apache

cd /usr/src
wget http://www.apache.org/dist/httpd/httpd-2.4.7.tar.gz
tar xvf httpd-2.4.7.tar.gz

2。下载APR和APR-的Util

cd /usr/src
wget https://centos.googlecode.com/files/apr-1.4.6.tar.gz
wget http://mirror.cogentco.com/pub/apache/apr/apr-util-1.5.3.tar.gz
tar xvf apr-1.4.6.tar.gz
tar xvf apr-util-1.5.3.tar.gz

现在把APR和APR-的Util你下载到你的Apache的源文件。

Now put the APR and APR-Util you downloaded into your apache source files.

mv apr-1.4.6 /usr/src/httpd-2.4.7/srclib/apr
mv apr-util-1.5.3 /usr/src/httpd-2.4.7/srclib/apr-util

3.Compile

cd /usr/src/httpd-2.4.7
./configure --enable-so --enable-ssl --with-mpm=prefork --with-included-apr
make
make install

4。在httpd.conf启用SSL

Apache配置文件中的的httpd.conf 的位于下的的/ usr /本地/ apache2的/ conf目录

Apache configuration file httpd.conf is located under /usr/local/apache2/conf.

nano /usr/local/apache2/conf/httpd.conf

取消注释的的httpd-ssl.conf中的包含线和在的/ usr /本地/的Apache2 / conf下的的LoadModule ssl_module 行/httpd.conf 的文件:

Uncomment the httpd-ssl.conf Include line and the LoadModule ssl_module line in the /usr/local/apache2/conf/httpd.conf file :

# LoadModule ssl_module modules/mod_ssl.so
# Include conf/extra/httpd-ssl.conf

查看的的httpd-ssl.conf中的审查所有默认的SSL配置。结果在大多数情况下,你不需要在这个文件来修改任何东西。

View the httpd-ssl.conf to review all the default SSL configurations.
For most cases, you don’t need to modify anything in this file.

nano /usr/local/apache2/conf/extra/httpd-ssl.conf

我们启动Apache之前所需的SSL证书和密钥。结果本的 server.crt 的和的 server.key 的中提到的文件中的的httpd-ssl.conf中的需要创建之前,我们向前迈进。

The SSL certificate and key are required before we start the Apache.
The server.crt and server.key file mentioned in the httpd-ssl.conf needs to be created before we move forward.

cd /usr/local/apache2/conf/extra
egrep 'server.crt|server.key' httpd-ssl.conf

SSLCertificateFile "/usr/local/apache2/conf/server.crt"
SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"

5。产生server.crt和server.key文件

首先,生成的 server.key 的使用OpenSSL的。

First, Generate the server.key using openssl.

cd /usr/src
openssl genrsa -des3 -out server.key 1024

上面的指令会要求输入密码。请务必记住这个密码。你需要这个过了一会儿开始你的Apache。

The above command will ask for the password. Make sure to remember this password. You need this while starting your Apache later.

接下来,生成证书请求文件( server.csr 的),使用上述的 server.key 的文件。

Next, generate a certificate request file (server.csr) using the above server.key file.

openssl req -new -key server.key -out server.csr

最后,生成一个自签名的SSL证书( server.crt 的),使用上述的 server.key 的和的 server.csr 的文件。

Finally, generate a self signed ssl certificate (server.crt) using the above server.key and server.csr file.

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

复制的 server.key 的和的 server.crt 的文件,以适当的Apache配置目录位置。

Copy the server.key and server.crt file to appropriate Apache configuration directory location.

cp server.key /usr/local/apache2/conf/
cp server.crt /usr/local/apache2/conf/

6。启动Apache

/usr/local/apache2/bin/apachectl start

如果您收到以下错误信息:

If you are getting the below error message :

AH00526: Syntax error on line 51 of /usr/local/apache2/conf/extra/httpd-ssl.conf:
Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration

请确保取消下图所示行的的httpd.conf 的:

Make sure to uncomment the line shown below in httpd.conf :

vi /usr/local/apache2/conf/httpd.conf

# LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

最后,将提示您启动了Apache之前,你的私钥输入密码。
验证了Apache httpd进程在后台运行。

Finally, this will prompt you to enter the password for your private key before starting up the apache. Verify that the Apache httpd process is running in the background.

ps -ef | grep http

您应该看到这样的事情:

You should see something like that :

root    29529 1     0 13:08 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
antoine 29530 29529 0 13:08 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
antoine 29531 29529 0 13:08 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
antoine 29532 29529 0 13:08 ? 00:00:00 /usr/local/apache2/bin/httpd -k start
root    29616 18260 0 13:09 pts/0 00:00:00 grep http

在默认情况下的Apache SSL运行在443端口。打开Web浏览器并验证是否可以访问使用你的Apache的的https:// {您的IP地址的}

我希望这种帮助,否则我建议你去看看:的http://jasonpowell42.word$p$pss.com/2013/04/05/install-apache-2-4-4-on-centos-6-4/

I hope this help, else I advise you to go see : http://jasonpowell42.wordpress.com/2013/04/05/install-apache-2-4-4-on-centos-6-4/

这篇关于阿帕奇2.4.x的手动安装在RHEL 6.4 - 没有Apache模块将启动加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆