[ 已解决 ] 求助: 安装 apache 出现问题

安装步骤:
su
zypper in apache2
报错:
Additional rpm output:
/usr/sbin/suexec2: cannot verify root:root 0755 - not listed in /etc/permissions
Updating /etc/sysconfig/apache2…
looking for old 2.0 modules to be renamed…
Done.
运行:
systemctl start apache2.service
报错:
Job for apache2.service failed. See ‘systemctl status apache2.service’ and ‘journalctl -xn’ for details.
运行:
systemctl status apache2.service
报错:
apache2.service - The Apache Webserver
Loaded: loaded (/usr/lib/systemd/system/apache2.service; disabled)
Active: failed (Result: exit-code) since Sun 2014-05-11 20:40:56 CST; 17min ago
Main PID: 2952 (code=exited, status=1/FAILURE)
May 11 20:40:56 linux-9tq7.site start_apache2[2952]: AH00526: Syntax error on line 48 of /etc/apache2/ssl-global.conf:
May 11 20:40:56 linux-9tq7.site start_apache2[2952]: SSLSessionCache: ‘shmcb’ session cache not supported (known names:…cb?).
May 11 20:40:56 linux-9tq7.site systemd[1]: apache2.service: main process exited, code=exited, status=1/FAILURE
May 11 20:40:56 linux-9tq7.site start_apache2[2970]: AH00526: Syntax error on line 48 of /etc/apache2/ssl-global.conf:
May 11 20:40:56 linux-9tq7.site start_apache2[2970]: SSLSessionCache: ‘shmcb’ session cache not supported (known names:…cb?).
May 11 20:40:56 linux-9tq7.site systemd[1]: apache2.service: control process exited, code=exited status=1
May 11 20:40:56 linux-9tq7.site systemd[1]: Failed to start The Apache Webserver.
May 11 20:40:56 linux-9tq7.site systemd[1]: Unit apache2.service entered failed state.
May 11 20:56:40 linux-9tq7.site systemd[1]: Stopped The Apache Webserver.
Hint: Some lines were ellipsized, use -l to show in full.
请求各位朋友指点…

这行的配置文件有问题

是默认安装的啊, 什么都没改过, 怎么会出现问题了, 完全懵了

48 的代码是:
SSLSessionCache shmcb:/var/lib/apache2/ssl_scache(512000)

这是要重装系统的节奏么 :sweat:

shmcb 是 https 模块,在这个版本的 apache2 默认是禁用的。打开就可以了。版本资讯里有写。

Sent from my iPhone 5s using Tapatalk

在哪个配置文件修改呢?

you just load and copy mod_socache_shmcb.so to /srv/www/modules ,

first you need to create modules directory /srv/www/
mkdir /srv/www/modules

copy shmcb file to modules directory
cp ./usr/lib/apache2-prefork/mod_socache_shmcb.so /srv/www/modules/

and then, you should edit /etc/apache2/httpd.conf and add this line
#Load module shmcb
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

restart apache2
systemctl restart apache2.service

按照这个方法试了, 但还是不行… 感觉好坑啊… 再次求救, 请求支援啊

终于可以了… 要改一下目录权限:chcon -R -h system_u:object_r:httpd_sys_content_t / 网站根目录

这是个什么目录?

明明把

socache_shmcb

添加到

/etc/sysconfig/apache2

的这行

APACHE_MODULES=“actions alias auth_basic authn_file authz_host authz_groupfile authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir reqtimeout authn_core authz_core socache_shmcb”

就可以了啊。

添加那行过后,要改一下目录权限,不然要报一个:documentroot does not exist 的错,估计是因为我之前把原来 WWW 目录删了,后来重新自己建的原因