新手笔记[Ubuntu] - Apache虚拟目录、自定义监听端口配置和默认首页修改

编辑于:2023-11-24

一、创建虚拟目录

$ vi /etc/apache2/sites-enabled/000-default.conf


<VirtualHost *:8080>

        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/brand

        <Directory />

                Options FollowSymLinks

                AllowOverride None

        </Directory>

        <Directory /var/www/brand/>

                Options Indexes FollowSymLinks MultiViews

                AllowOverride None

                Order allow,deny

                allow from all

                # 默认首页加下面关键字即可,后面跟页面地址,多个用空格隔开

                DirectoryIndex index.cfm index.html

        </Directory>

..............................


二、添加端口监听

$ vi /etc/apache2/ports.conf


三、重启Apache

$ /etc/init.d/apache2 restart

返回列表