zoukankan      html  css  js  c++  java
  • apache2添加模块和添加站点

    apache2添加模块和添加站点

    linux下的apache2的目录和windows上的区别还是很大的,但是用起来却更方便了,详解请看另一篇文章http://www.cnblogs.com/wancy86/p/linux_apache2.html

    这里补充两个命令:

    添加模块:

    model_name是mods-available 下的模块名

    sudo a2enmod model_name
    sudo a2enmod proxy 
    

    开启vhost:

    vhost_conf 是sites-available下的vhost配置文件名,文件名中不带.#

    sudo a2ensite vhost_conf
    sudo a2ensite mysite
    

    vhost配置文件模板:

    NameVirtualHost 127.0.0.1
    <VirtualHost 127.0.0.1>
    	ServerName tuitu.cn
    	ServerAdmin wancy86@sina.com
    	
    	DocumentRoot /var/www/demo/
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory /var/www/demo/>
    		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 /var/log/apache2/error.log
    
    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
    
    	CustomLog /var/log/apache2/access.log combined
    
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    
    </VirtualHost>
    
    
  • 相关阅读:
    爬取网页图片
    python 猜数字游戏
    位移运算
    生成随机的名字
    不截半个汉字
    一致性hash的实现
    安装前端脚手架
    什么是快速排序?
    HTML5有趣的标签
    stopPropagation / stopImmediatePropagation
  • 原文地址:https://www.cnblogs.com/wancy86/p/apache2_vhosts_02.html
Copyright © 2011-2022 走看看