您的位置:首页 > 运维架构 > Apache

debian-apache2配置多个站点

2015-06-18 19:03 751 查看
1、进入到sites-available文件夹下,cd /etc/apache2/sites-available。

2、复制default,cp default site1。

3、修改site1内容,红字文字地方修改

<VirtualHost *:80>

        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/site1

        <Directory /var/www/site1>

                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}/site1_error.log

        # Possible values include: debug, info, notice, warn, error, crit,

        # alert, emerg.

        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/site1_access.log combined

</VirtualHost>

4、建立软连接,

ln -s /etc/apache2/sites-available/site1 /etc/apache2/sites-enabled/site1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息