انجمنهای فارسی اوبونتو
کمک و پشتیبانی => شبکه و سرویس دهندهها => نویسنده: linuxdb در 28 مهر 1396، 09:34 قظ
-
سلام
هنگام راه اندازی مجدد Apache سرور خطای زیر رخ می دهد و راه اندازی نمی شود
apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/httpd.conf: Cannot load mod_authz_h
-
سلام
خروجی این دستور رو بذارین:
cat /etc/apache2/apache2.conf
پ.ن: سیستم عامل شما چیه ؟ چه نسخه دارین استفاده می کنین ؟ (برای فایل httpd.conf و نوشتن دستورات بعدی می پرسم)
بروزرسانی: خروجی این دستورات رو هم بذاین:
ll /etc/apache2/mods-available/
ll /etc/apache2/mods-enabled/
-
سلام و تشکر
خروجی دستور
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
ServerName 192.168.0.26
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 800
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 200
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
##
## Server-Pool Size Regulation (MPM specific)
##
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
# graceful restart. ThreadLimit can only be changed by stopping
# and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>
#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
# Include module configuration:
#Include mods-enabled/*.load
Include mods-enabled/*.conf
# Include all the user configurations:
Include httpd.conf
# Include ports listing
Include ports.conf
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
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
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
Include conf.d/
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
<VirtualHost _default_:9988>
DocumentRoot /etc/apache2/htdocs/html
<Directory "/etc/apache2/htdocs/html">
allow from all
Options -Indexes
</Directory>
</VirtualHost>
<VirtualHost _default_:5555>
DocumentRoot /var/www/puya
<Directory "/var/www/puya">
allow from all
Options -Indexes
</Directory>
</VirtualHost>
Listen *:9988
Listen *:5555
-
drwxrwxrwx 2 root root 12288 Oct 19 12:01 ./
drwxrwxrwx 9 root root 4096 Oct 20 09:10 ../
-rw-rw-rw- 1 root root 100 Dec 8 2016 access_compat.load
-rw-rw-rw- 1 root root 332 Oct 19 12:01 actions.conf
-rw-rw-rw- 1 root root 66 Oct 19 12:01 actions.load
-rw-rw-rw- 1 root root 815 Oct 19 12:01 alias.conf
-rw-rw-rw- 1 root root 62 Oct 19 12:01 alias.load
-rw-rw-rw- 1 root root 76 Dec 8 2016 allowmethods.load
-rw-rw-r-- 1 user user 8553 Oct 19 11:56 apache2.conf
-rw-rw-rw- 1 root root 60 Oct 19 12:01 asis.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 auth_basic.load
-rw-rw-rw- 1 root root 74 Oct 19 12:01 auth_digest.load
-rw-rw-rw- 1 root root 100 Dec 8 2016 auth_form.load
-rw-rw-r-- 1 user user 72 Oct 19 12:01 auth_mysql.load
-rw-rw-r-- 1 user user 74 Oct 19 12:01 authn_alias.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 authn_anon.load
-rw-rw-rw- 1 root root 72 Dec 8 2016 authn_core.load
-rw-rw-rw- 1 root root 85 Oct 19 12:01 authn_dbd.load
-rw-rw-rw- 1 root root 70 Oct 19 12:01 authn_dbm.load
-rw-rw-r-- 1 user user 78 Oct 19 12:01 authn_default.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 authn_file.load
-rw-rw-rw- 1 root root 78 Dec 8 2016 authn_socache.load
-rw-rw-rw- 1 root root 74 Dec 8 2016 authnz_fcgi.load
-rw-rw-rw- 1 root root 90 Oct 19 12:01 authnz_ldap.load
-rw-rw-rw- 1 root root 72 Dec 8 2016 authz_core.load
-rw-rw-rw- 1 root root 96 Dec 8 2016 authz_dbd.load
-rw-rw-rw- 1 root root 70 Oct 19 12:01 authz_dbm.load
-rw-rw-r-- 1 user user 78 Oct 19 12:01 authz_default.load
-rw-rw-rw- 1 root root 82 Oct 19 12:01 authz_groupfile.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 authz_host.load
-rw-rw-rw- 1 root root 74 Oct 19 12:01 authz_owner.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 authz_user.load
-rw-rw-rw- 1 root root 3265 Oct 19 12:01 autoindex.conf
-rw-rw-rw- 1 root root 70 Oct 19 12:01 autoindex.load
-rw-rw-rw- 1 root root 64 Dec 8 2016 buffer.load
-rw-rw-rw- 1 root root 889 Dec 8 2016 cache_disk.conf
-rw-rw-rw- 1 root root 89 Dec 8 2016 cache_disk.load
-rw-rw-rw- 1 root root 62 Oct 19 12:01 cache.load
-rw-rw-rw- 1 root root 95 Dec 8 2016 cache_socache.load
-rw-rw-rw- 1 root root 70 Oct 19 12:01 cern_meta.load
-rw-rw-rw- 1 root root 69 Oct 19 12:01 cgid.conf
-rw-rw-rw- 1 root root 60 Oct 19 12:01 cgid.load
-rw-rw-rw- 1 root root 58 Oct 19 12:01 cgi.load
-rw-rw-rw- 1 root root 76 Oct 19 12:01 charset_lite.load
-rw-rw-rw- 1 root root 60 Dec 8 2016 data.load
-rw-rw-rw- 1 root root 37 Oct 19 12:01 dav_fs.conf
-rw-rw-rw- 1 root root 79 Oct 19 12:01 dav_fs.load
-rw-rw-rw- 1 root root 58 Oct 19 12:01 dav.load
-rw-rw-rw- 1 root root 68 Oct 19 12:01 dav_lock.load
-rw-rw-rw- 1 root root 58 Oct 19 12:01 dbd.load
-rw-rw-rw- 1 root root 438 Oct 19 12:01 deflate.conf
-rw-rw-rw- 1 root root 66 Oct 19 12:01 deflate.load
-rw-rw-rw- 1 root root 64 Dec 8 2016 dialup.load
-rw-rw-rw- 1 root root 122 Oct 19 12:01 dir.conf
-rw-rw-rw- 1 root root 58 Oct 19 12:01 dir.load
-rw-rw-r-- 1 user user 604 Oct 19 12:01 disk_cache.conf
-rw-rw-r-- 1 user user 89 Oct 19 12:01 disk_cache.load
-rw-rw-rw- 1 root root 64 Oct 19 12:01 dump_io.load
-rw-rw-rw- 1 root root 60 Dec 8 2016 echo.load
-rw-rw-rw- 1 root root 58 Oct 19 12:01 env.load
-rw-rw-rw- 1 root root 66 Oct 19 12:01 expires.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 ext_filter.load
-rw-rw-rw- 1 root root 89 Oct 19 12:01 file_cache.load
-rw-rw-rw- 1 root root 64 Oct 19 12:01 filter.load
-rw-rw-rw- 1 root root 66 Oct 19 12:01 headers.load
-rw-rw-rw- 1 root root 176 Dec 8 2016 heartbeat.load
-rw-rw-rw- 1 root root 182 Dec 8 2016 heartmonitor.load
-rw-rw-rw- 1 root root 62 Oct 19 12:01 ident.load
-rw-rw-rw- 1 root root 68 Oct 19 12:01 imagemap.load
-rw-rw-rw- 1 root root 66 Oct 19 12:01 include.load
-rw-rw-rw- 1 root root 408 Oct 19 12:01 info.conf
-rw-rw-rw- 1 root root 60 Oct 19 12:01 info.load
-rw-rw-rw- 1 root root 116 Dec 8 2016 lbmethod_bybusyness.load
-rw-rw-rw- 1 root root 116 Dec 8 2016 lbmethod_byrequests.load
-rw-rw-rw- 1 root root 114 Dec 8 2016 lbmethod_bytraffic.load
-rw-rw-rw- 1 root root 114 Dec 8 2016 lbmethod_heartbeat.load
-rw-rw-rw- 1 root root 176 Oct 19 12:01 ldap.conf
-rw-rw-rw- 1 root root 60 Oct 19 12:01 ldap.load
-rw-rw-rw- 1 root root 70 Dec 8 2016 log_debug.load
-rw-rw-rw- 1 root root 76 Oct 19 12:01 log_forensic.load
-rw-rw-rw- 1 root root 58 Dec 8 2016 lua.load
-rw-rw-rw- 1 root root 62 Dec 8 2016 macro.load
-rw-rw-r-- 1 user user 185 Oct 19 12:01 mem_cache.conf
-rw-rw-r-- 1 user user 87 Oct 19 12:01 mem_cache.load
-rw-rw-rw- 1 root root 7411 Oct 19 12:01 mime.conf
-rw-rw-rw- 1 root root 60 Oct 19 12:01 mime.load
-rw-rw-rw- 1 root root 81 Oct 19 12:01 mime_magic.conf
-rw-rw-rw- 1 root root 72 Oct 19 12:01 mime_magic.load
-rw-rw-rw- 1 root root 668 Dec 8 2016 mpm_event.conf
-rw-rw-rw- 1 root root 106 Dec 8 2016 mpm_event.load
-rw-rw-rw- 1 root root 571 Dec 8 2016 mpm_prefork.conf
-rw-rw-rw- 1 root root 108 Dec 8 2016 mpm_prefork.load
-rw-rw-rw- 1 root root 836 Dec 8 2016 mpm_worker.conf
-rw-rw-rw- 1 root root 107 Dec 8 2016 mpm_worker.load
-rw-rw-rw- 1 root root 666 Oct 19 12:01 negotiation.conf
-rw-rw-rw- 1 root root 74 Oct 19 12:01 negotiation.load
-rw-rw-r-- 1 user user 60 Oct 19 12:01 perl.load
-rw-rw-r-- 1 user user 217 Oct 19 12:01 php5.conf
-rw-rw-r-- 1 user user 59 Oct 19 12:01 php5.load
-rw-rw-rw- 1 root root 867 Mar 1 2017 php7.0.conf
-rw-rw-rw- 1 root root 102 Mar 1 2017 php7.0.load
-rw-rw-rw- 1 root root 87 Oct 19 12:01 proxy_ajp.load
-rw-rw-rw- 1 root root 355 Oct 19 12:01 proxy_balancer.conf
-rw-rw-rw- 1 root root 97 Oct 19 12:01 proxy_balancer.load
-rw-rw-rw- 1 root root 803 Oct 19 12:01 proxy.conf
-rw-rw-rw- 1 root root 95 Oct 19 12:01 proxy_connect.load
-rw-rw-rw- 1 root root 95 Dec 8 2016 proxy_express.load
-rw-rw-rw- 1 root root 89 Dec 8 2016 proxy_fcgi.load
-rw-rw-rw- 1 root root 93 Dec 8 2016 proxy_fdpass.load
-rw-rw-rw- 1 root root 141 Oct 19 12:01 proxy_ftp.conf
-rw-rw-rw- 1 root root 87 Oct 19 12:01 proxy_ftp.load
-rw-rw-rw- 1 root root 93 Dec 8 2016 proxy_hcheck.load
-rw-rw-rw- 1 root root 2511 Dec 8 2016 proxy_html.conf
-rw-rw-rw- 1 root root 97 Dec 8 2016 proxy_html.load
-rw-rw-rw- 1 root root 89 Oct 19 12:01 proxy_http.load
-rw-rw-rw- 1 root root 62 Oct 19 12:01 proxy.load
-rw-rw-rw- 1 root root 89 Oct 19 12:01 proxy_scgi.load
-rw-rw-rw- 1 root root 97 Dec 8 2016 proxy_wstunnel.load
-rw-rw-rw- 1 root root 85 Dec 8 2016 ratelimit.load
-rw-rw-rw- 1 root root 70 Dec 8 2016 reflector.load
-rw-rw-rw- 1 root root 68 Dec 8 2016 remoteip.load
-rw-rw-rw- 1 root root 1126 Oct 19 12:01 reqtimeout.conf
-rw-rw-rw- 1 root root 72 Oct 19 12:01 reqtimeout.load
-rw-rw-rw- 1 root root 66 Dec 8 2016 request.load
-rw-rw-rw- 1 root root 66 Oct 19 12:01 rewrite.load
-rw-rw-r-- 1 user user 60 Oct 19 12:01 ruby.load
-rw-rw-rw- 1 root root 58 Dec 8 2016 sed.load
-rw-rw-rw- 1 root root 99 Dec 8 2016 session_cookie.load
-rw-rw-rw- 1 root root 99 Dec 8 2016 session_crypto.load
-rw-rw-rw- 1 root root 93 Dec 8 2016 session_dbd.load
-rw-rw-rw- 1 root root 66 Dec 8 2016 session.load
-rw-rw-rw- 1 root root 1211 Oct 19 12:01 setenvif.conf
-rw-rw-rw- 1 root root 68 Oct 19 12:01 setenvif.load
-rw-rw-rw- 1 root root 78 Dec 8 2016 slotmem_plain.load
-rw-rw-rw- 1 root root 74 Dec 8 2016 slotmem_shm.load
-rw-rw-rw- 1 root root 74 Dec 8 2016 socache_dbm.load
-rw-rw-rw- 1 root root 84 Dec 8 2016 socache_memcache.load
-rw-rw-rw- 1 root root 78 Dec 8 2016 socache_shmcb.load
-rw-rw-rw- 1 root root 66 Oct 19 12:01 speling.load
-rw-rw-rw- 1 root root 2790 Oct 19 12:01 ssl.conf
-rw-rw-rw- 1 root root 58 Oct 19 12:01 ssl.load
-rw-rw-rw- 1 root root 753 Oct 19 12:01 status.conf
-rw-rw-rw- 1 root root 64 Oct 19 12:01 status.load
-rw-rw-rw- 1 root root 72 Oct 19 12:01 substitute.load
-rw-rw-rw- 1 root root 64 Oct 19 12:01 suexec.load
-rw-rw-rw- 1 root root 70 Oct 19 12:01 unique_id.load
-rw-rw-rw- 1 root root 604 Oct 19 12:01 userdir.conf
-rw-rw-rw- 1 root root 66 Oct 19 12:01 userdir.load
-rw-rw-rw- 1 root root 70 Oct 19 12:01 usertrack.load
-rw-rw-r-- 1 user user 66 Oct 19 12:01 version.load
-rw-rw-rw- 1 root root 74 Oct 19 12:01 vhost_alias.load
-rw-rw-rw- 1 root root 66 Dec 8 2016 xml2enc.load
-
نگفتین نسخه ی سیستم عامل شما و خود سیستم عامل چیه ؟
پس فعلاً من رو این فرض جواب می دم که شما یکی از نسخه های 14.04 - 16.04 - 17.04 - 17.10 اوبونتو رو دارین استفاده می کنین:
آپاچی موجود تو مخازن خیلی وقته که فایل httpd.conf رو منقضی کرده و دیگه از این فایل استفاده نمی شه و تمامی کانفیگ ها توی فایل apache2.conf نوشته می شه پس اصولاً خط زیر تو فایل کانفیگ apache2.conf نباید موجود باشه:
Include httpd.conf
و متن خطا هم دقیقاً به خاطر وجود همین خط هستش
دلیل خاصی داره که شما این خط رو اضافه کردین؟ کانفیگ ها رو از جایی کپی پیست نکردین که ؟
لطفاً خروجی این دستور رو هم بذارین:
cat /etc/apache2/httpd.conf
در ضمن خروجی این دستور هم فراموش شده بود:
ll /etc/apache2/mods-enabled/
-
تشکر ، حدس شما درست است فایل کانفیگ را از جایی کپی شده است
4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
خروجی ها :
LoadModule authz_host_module mod_authz_host.souser@FeizA:/etc/apache2/mods-enabled$
drwxrwxrwx 2 root root 4096 Oct 20 07:57 ./
drwxrwxrwx 9 root root 4096 Oct 20 09:10 ../
lrwxrwxrwx 1 root root 36 Sep 5 17:40 access_compat.load -> ../mods-available/access_compat.load
lrwxrwxrwx 1 root root 28 Sep 5 17:40 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root 28 Sep 5 17:40 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 authn_core.load -> ../mods-available/authn_core.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 authz_core.load -> ../mods-available/authz_core.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root 32 Sep 5 17:40 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root 32 Sep 5 17:40 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root 30 Sep 5 17:40 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root 30 Sep 5 17:40 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root 26 Sep 5 17:40 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root 26 Sep 5 17:40 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root 26 Sep 5 17:40 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root 29 Sep 5 17:40 filter.load -> ../mods-available/filter.load
lrwxrwxrwx 1 root root 27 Sep 5 17:40 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root 27 Sep 5 17:40 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root 34 Sep 5 17:40 mpm_prefork.conf -> ../mods-available/mpm_prefork.conf
lrwxrwxrwx 1 root root 34 Sep 5 17:40 mpm_prefork.load -> ../mods-available/mpm_prefork.load
lrwxrwxrwx 1 root root 34 Sep 5 17:40 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root 34 Sep 5 17:40 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root 29 Sep 5 17:40 php7.0.conf -> ../mods-available/php7.0.conf
lrwxrwxrwx 1 root root 29 Sep 5 17:40 php7.0.load -> ../mods-available/php7.0.load
lrwxrwxrwx 1 root root 33 Sep 5 17:40 reqtimeout.conf -> ../mods-available/reqtimeout.conf
lrwxrwxrwx 1 root root 33 Sep 5 17:40 reqtimeout.load -> ../mods-available/reqtimeout.load
lrwxrwxrwx 1 root root 31 Sep 5 17:40 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root 31 Sep 5 17:40 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root 26 Oct 20 07:57 ssl.conf -> ../mods-available/ssl.conf
lrwxrwxrwx 1 root root 26 Oct 20 07:57 ssl.load -> ../mods-available/ssl.load
lrwxrwxrwx 1 root root 29 Sep 5 17:40 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root 29 Sep 5 17:40 status.load -> ../mods-available/status.load
-
خطی که فرمودید را غیر فعال کردم
خطای زیر داده می شود :
/etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/: No such file or di
-
اون فایل apache2.con به کلی فایل درستی نیست و تقریباً می شه گفت خیلی چیزایی که توش include شده منقضی شدن.
محتوی اون فایل رو پاک کنین و اینا رو توش قرار بدین
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# 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-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
# together by including all remaining configuration files when starting up the
# web server.
#
# * ports.conf is always included from the main configuration file. It is
# supposed to determine listening ports for incoming connections which can be
# customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
# directories contain particular configuration snippets which manage modules,
# global configuration fragments, or virtual host configurations,
# respectively.
#
# They are activated by symlinking available configuration files from their
# respective *-available/ counterparts. These should be managed by using our
# helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
# their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
# the default configuration, apache2 needs to be started/stopped with
# /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
# work with the default configuration.
# Global configuration
#
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"
#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default
#
# The directory where shm and other runtime files will be stored.
#
DefaultRuntimeDir ${APACHE_RUN_DIR}
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log
#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
# Include list of ports to listen on
Include ports.conf
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
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
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf
# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
اگه شخصی سازی یا تغییری هم دارین به همین محتوی ، خودتون دستی اضافه کنین
حالا سرویس رو ری استارت کنین:
sudo service apache2 restart
-
خطی که فرمودید را غیر فعال کردم
خطای زیر داده می شود :
/etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/: No such file or di
همون طور که گفتم این کانفیگ یه عالمه ایراد داره دلیل این خطا هم حضور این خط توی کانفیگ هستش:
Include conf.d/
-
apache2.service: Unit entered failed state.
apache2.service: Failed with result 'exit-code'.
تشکر دوست عزیز از راهنمایی
باز اپاچی اجرا نمی شود و خطای بالا داده می شود
-
بعد ری استارت کردن آپاچی خروجی این دستورات رو بذارین:
systemctl status apache2.service
sudo apache2ctl configtest
-
apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2017-10-20 17:49:44 +0330; 15h a
Process: 5809 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILU
CPU: 30ms
Oct 20 17:49:44 FeizA systemd[1]: Starting The Apache HTTP Server...
Oct 20 17:49:44 FeizA apachectl[5809]: AH00534: apache2: Configuration error: No
Oct 20 17:49:44 FeizA apachectl[5809]: Action 'start' failed.
Oct 20 17:49:44 FeizA apachectl[5809]: The Apache error log may have more inform
Oct 20 17:49:44 FeizA systemd[1]: apache2.service: Control process exited, code=
Oct 20 17:49:44 FeizA systemd[1]: Failed to start The Apache HTTP Server.
Oct 20 17:49:44 FeizA systemd[1]: apache2.service: Unit entered failed state.
Oct 20 17:49:44 FeizA systemd[1]: apache2.service: Failed with result 'exit-code
log file: udo apache2ctl configtest
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Fri 2017-10-20 17:49:44 +0330; 15h ago
Process: 5809 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
CPU: 30ms
Oct 20 17:49:44 FeizA systemd[1]: Starting The Apache HTTP Server...
Oct 20 17:49:44 FeizA apachectl[5809]: AH00534: apache2: Configuration error: No MPM loaded.
Oct 20 17:49:44 FeizA apachectl[5809]: Action 'start' failed.
Oct 20 17:49:44 FeizA apachectl[5809]: The Apache error log may have more information.
Oct 20 17:49:44 FeizA systemd[1]: apache2.service: Control process exited, code=exited status=1
Oct 20 17:49:44 FeizA systemd[1]: Failed to start The Apache HTTP Server.
Oct 20 17:49:44 FeizA systemd[1]: apache2.service: Unit entered failed state.
Oct 20 17:49:44 FeizA systemd[1]: apache2.service: Failed with result 'exit-code'.
~
-
AH00534: apache2: Configuration error: No MPM loaded.
Action 'configtest' failed.
The Apache error log may have more information.
-
مشکل از اینه که ماژول mpm_prefork برای آپاچی تون فعاله ولی درست کانفیگ نشده پس:
این ماژول apache رو فعالش کنین:
sudo a2enmod mpm_prefork
-
سلام مجدد دوست عزیز و تشکر
متاسفانه برای اکتیو شدن این پیغام را می دهد
user@FeizA:~$ Module mpm_prefork already enabled
-
شما تغییراتی تو اون apache2.conf که من بهتون دادم ، دادین ؟ اگه دادین چیه ؟
در ضمن شما قبلاً کانفیگی به مسیر /etc/apache2/conf-enabled اضافه کردین ؟ یا کانفیگ های موجود تو اون مسیر رو تغییر دادین ؟
-
مجدد آپاچی را حذف و دوباره نصب کردم ولی این بار صفحه دیفالت آپاچی لود نمیشه و محتویات پوشه www بصورت ftp نمایش داده می شود .
بله فایلی که شما داده بودید را تغییر دادم و محتویات پوشه ای که گفتید کپی شده بود
-
با توجه به اینکه گفتین محتویات پوشه ی etc/apache2/conf-enabled رو هم کپی کردین به احتمال زیاد مشکل از همون بودش که با پاک کردن و نصب دوباره ی آپاچی رفع شدش (لطفاً دیگه از جایی کپی نکنین چون همون طور که می بینین مشکلات بسیار زیادی رو همین کپی کردن منجر می شه)
در مورد مشکل جدیدی که بعد نصب دوباره apache پیش اومده:
اصولاً اگه کانفیگ پیش فرض آپاچی رو تغییر نداده باشین ، مسیر روت آپاچی /var/www نمی شه بلکه باید مسیرش ، /var/www/html باشه (البته این مسیر قبلاً همون var/www بودش ، ولی الان خیلی وقته که به /var/www/html تغییر پیدا کرده) . شما کانفیگ ها رو تغییر دادین ؟
سوال بعدی هم اینکه شما چطور اون صفحه ی پیش فرض آپاچی رو لود می کنین ؟ اصولاً باید با زدن localhost و یا آی پی تو مرورگر اون صفحه بالا میادش
اگه شما همین طوری (با زدن localhost) صفحه ی Apache2 Ubuntu Default Page رو فراخوانی می کنین و هم چنان مشکل دارین خروجی این دو دستور رو بذارین:
cat /etc/apache2/sites-enabled/000-default.conf
cat /etc/apache2/mods-enabled/dir.conf
و در ضمن چک کنین که تو مسیر زیر فایل index.html رو داشته باشین:
/var/www/html
-
احتمالا بهتر باشه بجای کپی کردن فایل تنظیمات، ابتدا تنظیمات رو بخونید، بعد سرور رو به همون شکلی که تنظیم شده بود دوباره تنظیم کنید :) احتمالا وقت کمتری هم ازتون بگیره.
-
سلام
یه سوال دارم، اینکه، چرا اکثر کاربران بصورت جداگانه آپاچی و پیاچیپی و مایاسکیوال رو نصب میکنند؟ دلیل خاصی داره؟