apache主設定檔範本和基於網域名稱虛擬機器主機設定檔範本

來源:互聯網
上載者:User

標籤:apache主設定檔範本 預設設定檔範本   禁止ip訪問 基於網域名稱虛擬機器主機設定檔範本   記錄

1,主設定檔範本# cat  httpd.confServerRoot "/usr/local/apache"Listen 80LoadModule authn_file_module modules/mod_authn_file.soLoadModule authn_core_module modules/mod_authn_core.soLoadModule authz_host_module modules/mod_authz_host.soLoadModule authz_groupfile_module modules/mod_authz_groupfile.soLoadModule authz_user_module modules/mod_authz_user.soLoadModule authz_core_module modules/mod_authz_core.soLoadModule access_compat_module modules/mod_access_compat.soLoadModule auth_basic_module modules/mod_auth_basic.soLoadModule reqtimeout_module modules/mod_reqtimeout.soLoadModule filter_module modules/mod_filter.soLoadModule mime_module modules/mod_mime.soLoadModule log_config_module modules/mod_log_config.soLoadModule env_module modules/mod_env.soLoadModule headers_module modules/mod_headers.soLoadModule setenvif_module modules/mod_setenvif.soLoadModule version_module modules/mod_version.soLoadModule unixd_module modules/mod_unixd.soLoadModule status_module modules/mod_status.soLoadModule autoindex_module modules/mod_autoindex.soLoadModule negotiation_module modules/mod_negotiation.soLoadModule dir_module modules/mod_dir.soLoadModule alias_module modules/mod_alias.soLoadModule rewrite_module modules/mod_rewrite.soLoadModule php5_module        modules/libphp5.soAddType application/x-httpd-php .php .php5AddType application/x-httpd-php-source .phps<IfModule unixd_module>User wwwGroup www</IfModule>ServerAdmin [email protected]ServerName localhost<Directory />    AllowOverride none    Require all denied</Directory>DocumentRoot "/usr/local/apache/htdocs"<Directory "/usr/local/apache/htdocs">    Options FollowSymLinks    AllowOverride None    Rquire all granted</Directory><IfModule dir_module>    DirectoryIndex index.php index.html</IfModule><Files ".ht*">    Require all denied</Files>ErrorLog "logs/error_log"LogLevel warn<IfModule log_config_module>    LogFormat "%h %a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined    LogFormat "%h %a %l %u %t \"%r\" %>s %b" common    <IfModule logio_module>      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio    </IfModule>    CustomLog "logs/access_log" common</IfModule><IfModule alias_module>    ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"</IfModule><IfModule cgid_module>    #    # ScriptSock: On threaded servers, designate the path to the UNIX    # socket used to communicate with the CGI daemon of mod_cgid.    #    #Scriptsock cgisock</IfModule><Directory "/usr/local/apache/cgi-bin">    AllowOverride None    Options None    Require all granted</Directory><IfModule mime_module>    TypesConfig conf/mime.types    AddType application/x-compress .Z    AddType application/x-gzip .gz .tgz</IfModule>Include conf/extra/httpd-mpm.confInclude conf/extra/httpd-multilang-errordoc.confInclude conf/vhosts/*.confInclude conf/extra/httpd-default.conf<IfModule proxy_html_module>Include conf/extra/proxy-html.conf</IfModule><IfModule ssl_module>SSLRandomSeed startup builtinSSLRandomSeed connect builtin</IfModule>LoadModule remoteip_module modules/mod_remoteip.soRemoteIPHeader X-Forwarded-ForRemoteIPInternalProxy 127.0.0.1 1.1.1.1 2.2.2<Files ~ "\.tar|\.bz2|\.svn|\*.gz">    Require all denied</Files><DirectoryMatch .*\.svn/.*>    Require all denied</DirectoryMatch>2,預設設定檔範本# cat defaults.conf #2.4<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot /usr/local/apache/htdocs/    <Directory "/usr/local/apache/htdocs/" >        Options  FollowSymLinks        AllowOverride None        Require all denied    </Directory></VirtualHost>3,禁止ip訪問模板# cat 1.1.1.1.conf<VirtualHost *:80>    ServerAdmin [email protected]    ServerName 1.1.1.1    ServerAlias 2.2.2.2    DocumentRoot /usr/local/apache/htdocs/    <Directory "/usr/local/apache/htdocs/" >        Options  FollowSymLinks        AllowOverride None        Require all denied    </Directory></VirtualHost>4,虛擬機器主機設定檔範本# cat www.test.com.conf#www.test.com<VirtualHost *:80>    ServerAdmin [email protected]    DocumentRoot /data/web_root/www.test.com/www    ServerName www.test.com    ServerAlias iwww.test.com    ErrorLog "/data/logs/apache/www.test.com-error_log"    CustomLog "|/usr/local/apache/bin/rotatelogs /data/logs/apache/www.test.com-access_log_%Y%m%d.log 86400 480" combined     RewriteEngine On   <Directory "/data/web_root/www.test.com/www">      Options FollowSymLinks      AllowOverride all      Require all granted   </Directory></VirtualHost>


apache主設定檔範本和基於網域名稱虛擬機器主機設定檔範本

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.