无法启动apache2(不同的错误)

罗伯特

我正在尝试使用命令启动我的Apache2服务

sudo apache2 service start

因此我得到这个错误:

    [....] Starting web server: apache2apache2: Syntax error on line 84 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/conf.d/vesta.conf: Syntax error on line 38 of /home/admin/conf/web/apache2.conf: </IfModule> without matching <IfModule> section
Action 'start' failed.
The Apache error log may have more information.
 failed!

我的/etc/apache2/apache2.conf文件:

    # It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#   /etc/apache2/
#   |-- apache2.conf
#   |   `--  ports.conf
#   |-- mods-enabled
#   |   |-- *.load
#   |   `-- *.conf
#   |-- conf.d
#   |   `-- *

# Global configuration
LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 30
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 10

<IfModule mpm_prefork_module>
    StartServers          8
    MinSpareServers       5
    MaxSpareServers      20
    ServerLimit         256
    MaxClients          200
    MaxRequestsPerChild 4000
</IfModule>

<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          200
    MaxRequestsPerChild 4000
</IfModule>

<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          200
    MaxRequestsPerChild 4000
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#User www-data
#Group www-data

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

DefaultType None
HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include list of ports to listen on and which to use for name based vhosts
Include ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%b" bytes

Include conf.d/

# Include the virtual host configurations:
#Include sites-enabled/

我的/etc/apache2/conf.d/vesta.conf文件:

Include /home/admin/conf/web/apache2.conf

我的/home/admin/conf/web/apache2.conf文件:

<VirtualHost 149.56.100.105:80>

    ServerName carinae-gaming.com
    ServerAlias www.carinae-gaming.com
    ServerAdmin [email protected]
    DocumentRoot /home/admin/web/carinae-gaming.com/public_html
    ScriptAlias /cgi-bin/ /home/admin/web/carinae-gaming.com/cgi-bin/
    Alias /vstats/ /home/admin/web/carinae-gaming.com/stats/
    Alias /error/ /home/admin/web/carinae-gaming.com/document_errors/
    #SuexecUserGroup admin admin
    CustomLog /var/log/apache2/domains/carinae-gaming.com.bytes bytes
    CustomLog /var/log/apache2/domains/carinae-gaming.com.log combined
    ErrorLog /var/log/apache2/domains/carinae-gaming.com.error.log
    <Directory /home/admin/web/carinae-gaming.com/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/admin/web/carinae-gaming.com/public_html:/home/admin/tmp
        php_admin_value upload_tmp_dir /home/admin/tmp
        php_admin_value session.save_path /home/admin/tmp
    </Directory>
    <Directory /home/admin/web/carinae-gaming.com/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid admin admin
        RGroups www-data
    </IfModule>
    <IfModule itk.c>
        AssignUserID admin admin
    </IfModule>

    Include /home/admin/conf/web/apache2.carinae-gaming.com.conf*

现在,这里是错误日志:

[Sun Jul 31 06:25:25 2016] [notice] mod_ruid2/0.9.7 enabled
[Sun Jul 31 06:25:25 2016] [notice] Apache/2.2.22 (Debian) mod_fcgid/2.3.6 mod_ssl/2.2.22 OpenSSL/1.0.1e configured -- resuming normal operations
[Sun Jul 31 08:20:58 2016] [error] [client 71.6.146.185] Invalid method in request \x16\x03\x01\x02
[Sun Jul 31 08:21:28 2016] [error] [client 74.82.47.3] Invalid method in request \x16\x03\x01
[Sun Jul 31 13:59:37 2016] [error] [client 141.212.122.32] Invalid method in request \x16\x03\x01
[Sun Jul 31 15:51:46 2016] [error] [client 182.118.45.231] Invalid method in request \x16\x03\x01
[Mon Aug 01 07:13:39 2016] [error] [client 216.218.206.68] Invalid method in request \x16\x03\x01
[Mon Aug 01 08:36:10 2016] [error] [client 54.206.9.146] Invalid method in request \x16\x03\x01
[Mon Aug 01 08:36:12 2016] [error] [client 54.206.9.146] Invalid method in request \x16\x03
[Mon Aug 01 09:06:23 2016] [error] [client 141.212.122.64] Invalid method in request \x16\x03\x01
[Mon Aug 01 21:49:09 2016] [notice] Graceful restart requested, doing restart
[Mon Aug 01 21:49:09 2016] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
apache2: Could not reliably determine the server's fully qualified domain name, using carinae-gaming.com for ServerName
[Mon Aug 01 21:49:14 2016] [warn] NameVirtualHost 149.56.100.105:443 has no VirtualHosts
[Mon Aug 01 21:49:14 2016] [notice] mod_ruid2/0.9.7 enabled
[Mon Aug 01 21:49:14 2016] [notice] Apache/2.2.22 (Debian) mod_fcgid/2.3.6 mod_ssl/2.2.22 OpenSSL/1.0.1e configured -- resuming normal operations
[Mon Aug 01 21:52:15 2016] [notice] Graceful restart requested, doing restart
[Mon Aug 01 21:52:15 2016] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
apache2: Could not reliably determine the server's fully qualified domain name, using carinae-gaming.com for ServerName
[Mon Aug 01 21:52:20 2016] [warn] NameVirtualHost 149.56.100.105:443 has no VirtualHosts
[Mon Aug 01 21:52:20 2016] [notice] mod_ruid2/0.9.7 enabled
[Mon Aug 01 21:52:20 2016] [notice] Apache/2.2.22 (Debian) mod_fcgid/2.3.6 mod_ssl/2.2.22 OpenSSL/1.0.1e configured -- resuming normal operations
[Tue Aug 02 01:03:17 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Tue Aug 02 01:03:22 2016] [notice] mod_ruid2/0.9.7 enabled
[Tue Aug 02 01:03:22 2016] [notice] Apache/2.2.22 (Debian) mod_fcgid/2.3.6 mod_ssl/2.2.22 OpenSSL/1.0.1e configured -- resuming normal operations

那我该如何解决呢?

萨钦·G。

升级(PHP或Apache)似乎给您带来麻烦。这样可以解决您的问题。确保conf文件的位置是/etc/apache2/apache2.conf

代替这个

LockFile ${APACHE_LOCK_DIR}/accept.lock

用这个

Mutex file:${APACHE_LOCK_DIR} default

一旦完成!

sudo apache2 service start

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Apache2无法启动

无法重新启动 Apache2 - 错误

无法在 WSL 中启动 apache2

apache2服务无法启动

无法重新启动 Apache2

启动apache2时出错“无法访问目录'/ var / log / apache2 /'的主要错误日志”

严重问题 - Apache2 错误无法启动 Ubuntu 20.04.LTS

Apache2“无法启动Apache HTTP服务器”

apache2无法停止,nginx无法启动

重新启动命令时出现Apache2错误

无法在 ubuntu 19.04 中启动 apache2

Apache2无法在Arch Linux中启动

无法启动apache2服务器

启用“ mod_rewrite”后,Apache2服务器无法启动,返回“不允许操作”错误

服务apache2重新启动没有任何错误(也重新加载了服务apache2)

apache2:无法打开配置文件/etc/apache2/apache2.conf:输入/输出错误

意外删除了/ var / log / apache2,现在无法重新启动apache

Apache,问题无法启动LSB:Apache2 Web服务器

无法登录我的用户帐户-apache2在20秒内无法启动-Ubuntu 14.04

Apache2在Ubuntu 14.04中无法正常工作:无法重新启动,作业未知

apache2服务在重新启动时失败-无法启动apache2.service:找不到单元

如何安装和启动apache2

清除并重新安装后Apache2无法启动

为什么apache2和tomcat7服务无法在Ubuntu Cloudimg上自动启动?

Apache2无法重新启动,“ systemctl状态”日志中的“ configtest”失败

Apache2无法在优胜美地上正常启动,与现有进程竞争

清除并重新安装后,apache2无法启动

Apache2无法启动-没有可用的监听套接字-Ubuntu 14.04

Apache2无法启动:libaprutil-1.so.0 =>找不到