分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

centos7安装配置apache(httpd)

发布时间:2023-09-06 01:55责任编辑:白小东关键词:apache配置http
  • 安装:
    yum ?-y ?install ?httpd
  • 支持目录索引:
    a. 首页索引:
    vim ?/etc/httpd/conf.d/welcome.conf

    b. 自定义索引样式:
    vim /etc/httpd/conf/httpd.conf
  • 支持php:
  • 开启pathinfo:
  • 解决跨域:
  • 开启rewrite功能:
  • 配置虚拟主机:
  • 配置文件参考:
    ServerRoot "/etc/httpd"Listen 80Include conf.modules.d/*.confUser apacheGroup apacheServerAdmin root@localhost<Directory />AllowOverride noneRequire all denied</Directory>DocumentRoot "/var/www/html"<Directory "/var/www">AllowOverride NoneRequire all granted</Directory><Directory "/var/www/html">Header set Access-Control-Allow-Origin *Options Indexes FollowSymLinksIndexStyleSheet "/css/style.css"IndexOptions FancyIndexing HTMLTable ScanHTMLTitles FoldersFirst NameWidth=85 DescriptionWidth=128 IconWidth=16 IconHeight=16 VersionSort Charset=UTF-8AllowOverride allRequire all grantedAcceptPathInfo on</Directory><IfModule dir_module>DirectoryIndex index.html</IfModule><Files ".ht*">Require all denied</Files>ErrorLog "logs/error_log"LogLevel warn<IfModule log_config_module>LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedLogFormat "%h %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" combined</IfModule><IfModule alias_module>ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"</IfModule><Directory "/var/www/cgi-bin">AllowOverride NoneOptions NoneRequire all granted</Directory><IfModule mime_module>TypesConfig /etc/mime.typesAddType application/x-compress .ZAddType application/x-gzip .gz .tgzAddType text/html .shtmlAddType application/x-httpd-php .php .phtml .php3 .incAddOutputFilter INCLUDES .shtml</IfModule>AddDefaultCharset UTF-8<IfModule mime_magic_module>MIMEMagicFile conf/magic</IfModule>EnableSendfile onIncludeOptional conf.d/*.conf<VirtualHost *:80>ServerName virtual.dollar.comDocumentRoot "/var/www/html/virtual/"DirectoryIndex index.php index.html<Directory "/var/www/html/virtual/"> ???Options Indexes FollowSymLinks ???AllowOverride All ???Require all granted</Directory></VirtualHost>
  • centos7安装配置apache(httpd)

    原文地址:http://blog.51cto.com/12173069/2118634

    知识推荐

    我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
    icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved