Apache Master profile templates and domain-based virtual host profile templates

Source: Internet
Author: User

1, Master profile template # 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\" &NBsp;\ "%{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 >   &nBsp 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&GT;2, the default profile template # 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, disable IP access template # 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, Virtual host profile template #  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      &nBsp allowoverride all      require all granted   </ Directory></virtualhost>


Apache Master profile templates and domain-based virtual host profile templates

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.