zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    第一章——第二节 启动模式
    Android 展示键盘时候布局被修改的问题
    JAVA混型和潜在类型机制
    第一章——Activity的生命周期
    android 程序中禁止屏幕旋转和重启Activity
    项目知识—九
    项目知识——八
    项目知识——七
    Drawable复习—第六章
    项目知识(六)
  • 原文地址:https://www.cnblogs.com/arcer/p/2973106.html
Copyright © 2011-2022 走看看