• Debain下配置apache2


    1、安装apache2

    apt-get install apache2 

    2、配置 Apache2 默认站点

    vi /etc/apache2/sites-enabled/000-default

     加入一行RedirectMatch ^/$ /apache2-default/

    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
    
            DocumentRoot /var/www
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            </Directory>
            <Directory /var/www/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            </Directory>
    
            ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
            <Directory "/usr/lib/cgi-bin">
                    AllowOverride None
                    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                    Order allow,deny
                    Allow from all
            </Directory>
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
    
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel warn
    
            CustomLog ${APACHE_LOG_DIR}/access.log combined
            RedirectMatch ^/$ /apache2-default/
    </VirtualHost>

    3、修改 Apache2 主配置

    vi /etc/apache2/apache2.conf 

    要改为:

    Include module configuration:

    Include /etc/apache2/mods-enabled/*.load

    Include /etc/apache2/mods-enabled/*.conf

    # Include module configuration:
    Include /etc/apache2/mods-enabled/*.load
    Include /etc/apache2/mods-enabled/*.conf

    4、httdpd.conf文件添加支持类型

    vi /etc/apache2/httdpd.conf 

    AddType  application/x-httpd-php  .php
    AddType  application/x-httpd-php-source  .phps

  • 相关阅读:
    软件开发模版与规范 & 项目组规范
    CSS代码结构初探
    DIV+CSS 一行两列布局
    AE 9.3代码 升级到AE10.0
    栅格相减 异常
    鹰眼视图异常
    十进制度批量转换度分秒
    javascript是一朵奇葩
    pku 1065 pku 1548
    hdu 1254 推箱子
  • 原文地址:https://www.cnblogs.com/arcer/p/2973106.html
Copyright © 2020-2023  润新知