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

时间:2016-08-02 05:04:40

标签: apache debian

我正在尝试使用命令

启动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 info@carinae-gaming.com
    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

我该如何解决?

1 个答案:

答案 0 :(得分:1)

似乎升级(PHP或apache)让你陷入困境。这将解决您的问题。确保conf文件位置为/etc/apache2/apache2.conf

而不是这个

LockFile ${APACHE_LOCK_DIR}/accept.lock

使用此

Mutex file:${APACHE_LOCK_DIR} default

一旦完成!

sudo apache2 service start