V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Gary_Cheung
V2EX  ›  PHP

Mac 自带 apache 被玩儿坏了,肿么办?

  •  
  •   Gary_Cheung · 2016-05-17 19:56:37 +08:00 · 5092 次点击
    这是一个创建于 3142 天前的主题,其中的信息可能已经有所发展或是发生改变。
    httpd.conf 已经被改的面目全非,而且没有备份。肿么办?

    mac 10.11.4 , apache 2.4.18
    8 条回复    2016-05-23 18:17:08 +08:00
    cxbig
        1
    cxbig  
       2016-05-17 20:09:33 +08:00   ❤️ 1
    rebeccaMyKid
        2
    rebeccaMyKid  
       2016-05-17 20:12:06 +08:00 via Android
    哈哈哈,叫你不拷贝一份,上网找个覆盖吧。
    wwek
        3
    wwek  
       2016-05-17 20:16:35 +08:00
    什么什么怎么办

    不非要用系统自带默认的

    我发一份我的,没改过


     


    ```
    #
    # This is the main Apache HTTP server configuration file. It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
    # In particular, see
    # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
    # for a discussion of each configuration directive.
    #
    # 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.
    #
    # 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 "logs/access_log"
    # with ServerRoot set to "/usr/local/apache2" will be interpreted by the
    # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
    # will be interpreted as '/logs/access_log'.

    #
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    #
    # Do not add a slash at the end of the directory path. If you point
    # ServerRoot at a non-local disk, be sure to specify a local disk on the
    # Mutex directive, if file-based mutexes are used. If you wish to share the
    # same ServerRoot for multiple httpd daemons, you will need to change at
    # least PidFile.
    #
    ServerRoot "/usr"

    #
    # Mutex: Allows you to set the mutex mechanism and mutex file directory
    # for individual mutexes, or change the global defaults
    #
    # Uncomment and change the directory if mutexes are file-based and the default
    # mutex file directory is not on a local disk or is not appropriate for some
    # other reason.
    #
    # Mutex default:/private/var/run

    #
    # Listen: Allows you to bind Apache to specific IP addresses and/or
    # ports, instead of the default. See also the <VirtualHost>
    # directive.
    #
    # Change this to Listen on specific IP addresses as shown below to
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 12.34.56.78:80
    Listen 80

    #
    # Dynamic Shared Object (DSO) Support
    #
    # To be able to use the functionality of a module which was built as a DSO you
    # have to place corresponding `LoadModule' lines at this location so the
    # directives contained in it are actually available _before_ they are used.
    # Statically compiled modules (those listed by `httpd -l') do not need
    # to be loaded here.
    #
    # Example:
    # LoadModule foo_module modules/mod_foo.so
    #
    LoadModule authn_file_module libexec/apache2/mod_authn_file.so
    #LoadModule authn_dbm_module libexec/apache2/mod_authn_dbm.so
    #LoadModule authn_anon_module libexec/apache2/mod_authn_anon.so
    #LoadModule authn_dbd_module libexec/apache2/mod_authn_dbd.so
    #LoadModule authn_socache_module libexec/apache2/mod_authn_socache.so
    LoadModule authn_core_module libexec/apache2/mod_authn_core.so
    LoadModule authz_host_module libexec/apache2/mod_authz_host.so
    LoadModule authz_groupfile_module libexec/apache2/mod_authz_groupfile.so
    LoadModule authz_user_module libexec/apache2/mod_authz_user.so
    #LoadModule authz_dbm_module libexec/apache2/mod_authz_dbm.so
    #LoadModule authz_owner_module libexec/apache2/mod_authz_owner.so
    #LoadModule authz_dbd_module libexec/apache2/mod_authz_dbd.so
    LoadModule authz_core_module libexec/apache2/mod_authz_core.so
    #LoadModule authnz_ldap_module libexec/apache2/mod_authnz_ldap.so
    LoadModule access_compat_module libexec/apache2/mod_access_compat.so
    LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so
    #LoadModule auth_form_module libexec/apache2/mod_auth_form.so
    #LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
    #LoadModule allowmethods_module libexec/apache2/mod_allowmethods.so
    #LoadModule file_cache_module libexec/apache2/mod_file_cache.so
    #LoadModule cache_module libexec/apache2/mod_cache.so
    #LoadModule cache_disk_module libexec/apache2/mod_cache_disk.so
    #LoadModule cache_socache_module libexec/apache2/mod_cache_socache.so
    #LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so
    #LoadModule socache_dbm_module libexec/apache2/mod_socache_dbm.so
    #LoadModule socache_memcache_module libexec/apache2/mod_socache_memcache.so
    #LoadModule watchdog_module libexec/apache2/mod_watchdog.so
    #LoadModule macro_module libexec/apache2/mod_macro.so
    #LoadModule dbd_module libexec/apache2/mod_dbd.so
    #LoadModule dumpio_module libexec/apache2/mod_dumpio.so
    #LoadModule echo_module libexec/apache2/mod_echo.so
    #LoadModule buffer_module libexec/apache2/mod_buffer.so
    #LoadModule data_module libexec/apache2/mod_data.so
    #LoadModule ratelimit_module libexec/apache2/mod_ratelimit.so
    LoadModule reqtimeout_module libexec/apache2/mod_reqtimeout.so
    #LoadModule ext_filter_module libexec/apache2/mod_ext_filter.so
    #LoadModule request_module libexec/apache2/mod_request.so
    #LoadModule include_module libexec/apache2/mod_include.so
    LoadModule filter_module libexec/apache2/mod_filter.so
    #LoadModule reflector_module libexec/apache2/mod_reflector.so
    #LoadModule substitute_module libexec/apache2/mod_substitute.so
    #LoadModule sed_module libexec/apache2/mod_sed.so
    #LoadModule charset_lite_module libexec/apache2/mod_charset_lite.so
    #LoadModule deflate_module libexec/apache2/mod_deflate.so
    #LoadModule xml2enc_module libexec/apache2/mod_xml2enc.so
    #LoadModule proxy_html_module libexec/apache2/mod_proxy_html.so
    LoadModule mime_module libexec/apache2/mod_mime.so
    #LoadModule ldap_module libexec/apache2/mod_ldap.so
    LoadModule log_config_module libexec/apache2/mod_log_config.so
    #LoadModule log_debug_module libexec/apache2/mod_log_debug.so
    #LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so
    #LoadModule logio_module libexec/apache2/mod_logio.so
    LoadModule env_module libexec/apache2/mod_env.so
    #LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so
    #LoadModule expires_module libexec/apache2/mod_expires.so
    LoadModule headers_module libexec/apache2/mod_headers.so
    #LoadModule usertrack_module libexec/apache2/mod_usertrack.so
    ##LoadModule unique_id_module libexec/apache2/mod_unique_id.so
    LoadModule setenvif_module libexec/apache2/mod_setenvif.so
    LoadModule version_module libexec/apache2/mod_version.so
    #LoadModule remoteip_module libexec/apache2/mod_remoteip.so
    LoadModule proxy_module libexec/apache2/mod_proxy.so
    LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so
    LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so
    LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
    LoadModule proxy_fcgi_module libexec/apache2/mod_proxy_fcgi.so
    LoadModule proxy_scgi_module libexec/apache2/mod_proxy_scgi.so
    #LoadModule proxy_fdpass_module libexec/apache2/mod_proxy_fdpass.so
    LoadModule proxy_wstunnel_module libexec/apache2/mod_proxy_wstunnel.so
    LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so
    LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so
    LoadModule proxy_express_module libexec/apache2/mod_proxy_express.so
    #LoadModule session_module libexec/apache2/mod_session.so
    #LoadModule session_cookie_module libexec/apache2/mod_session_cookie.so
    #LoadModule session_dbd_module libexec/apache2/mod_session_dbd.so
    LoadModule slotmem_shm_module libexec/apache2/mod_slotmem_shm.so
    #LoadModule slotmem_plain_module libexec/apache2/mod_slotmem_plain.so
    #LoadModule ssl_module libexec/apache2/mod_ssl.so
    #LoadModule dialup_module libexec/apache2/mod_dialup.so
    LoadModule lbmethod_byrequests_module libexec/apache2/mod_lbmethod_byrequests.so
    LoadModule lbmethod_bytraffic_module libexec/apache2/mod_lbmethod_bytraffic.so
    LoadModule lbmethod_bybusyness_module libexec/apache2/mod_lbmethod_bybusyness.so
    #LoadModule lbmethod_heartbeat_module libexec/apache2/mod_lbmethod_heartbeat.so
    LoadModule unixd_module libexec/apache2/mod_unixd.so
    #LoadModule heartbeat_module libexec/apache2/mod_heartbeat.so
    #LoadModule heartmonitor_module libexec/apache2/mod_heartmonitor.so
    #LoadModule dav_module libexec/apache2/mod_dav.so
    LoadModule status_module libexec/apache2/mod_status.so
    LoadModule autoindex_module libexec/apache2/mod_autoindex.so
    #LoadModule asis_module libexec/apache2/mod_asis.so
    #LoadModule info_module libexec/apache2/mod_info.so
    #LoadModule cgi_module libexec/apache2/mod_cgi.so
    #LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
    #LoadModule dav_lock_module libexec/apache2/mod_dav_lock.so
    #LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
    LoadModule negotiation_module libexec/apache2/mod_negotiation.so
    LoadModule dir_module libexec/apache2/mod_dir.so
    #LoadModule imagemap_module libexec/apache2/mod_imagemap.so
    #LoadModule actions_module libexec/apache2/mod_actions.so
    #LoadModule speling_module libexec/apache2/mod_speling.so
    #LoadModule userdir_module libexec/apache2/mod_userdir.so
    LoadModule alias_module libexec/apache2/mod_alias.so
    #LoadModule rewrite_module libexec/apache2/mod_rewrite.so
    #LoadModule php5_module libexec/apache2/libphp5.so
    LoadModule hfs_apple_module libexec/apache2/mod_hfs_apple.so

    <IfModule unixd_module>
    #
    # If you wish httpd to run as a different user or group, you must run
    # httpd as root initially and it will switch.
    #
    # User/Group: The name (or #number) of the user/group to run httpd as.
    # It is usually good practice to create a dedicated user and group for
    # running httpd, as with most system services.
    #
    User _www
    Group _www

    </IfModule>


    ```
    wwek
        4
    wwek  
       2016-05-17 20:16:53 +08:00
    还有一点
    ```

    # 'Main' server configuration
    #
    # The directives in this section set up the values used by the 'main'
    # server, which responds to any requests that aren't handled by a
    # <VirtualHost> definition. These values also provide defaults for
    # any <VirtualHost> containers you may define later in the file.
    #
    # All of these directives may appear inside <VirtualHost> containers,
    # in which case these default settings will be overridden for the
    # virtual host being defined.
    #

    #
    # ServerAdmin: Your address, where problems with the server should be
    ```
    jhdxr
        5
    jhdxr  
       2016-05-17 20:24:29 +08:00
    congeec
        6
    congeec  
       2016-05-17 21:11:41 +08:00   ❤️ 1
    这种组件是开源的,去 www.opensource.apple.com 上找
    wwek
        7
    wwek  
       2016-05-21 11:47:29 +08:00
    @jhdxr 嘿嘿`
    lotushzy
        8
    lotushzy  
       2016-05-23 18:17:08 +08:00
    原有的禁用了, port 或者 brew 重新安装一个,也行啊
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4286 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 01:03 · PVG 09:03 · LAX 17:03 · JFK 20:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.