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

Ubuntu 14.04下Apache修改网站根目录及默认网页

2016-10-19 19:41 585 查看
Linux服务器端系统是Ubuntu 14.04。

修改根目录:

在 /etc/apache2/sites-available 中修改 000-default.conf

中的DocumentRoot /var/www/ 修改为想要的目录

比如:DocumentRoot /var/www/html/mainpage

接下来重启apache,sudo apache2ctl -k restart 即可

修改默认网页:

修改/etc/apache2/mods-available/dir.conf中的内容

原来是:

<IfModule mod_dir.c>

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

</IfModule>

添加上想要的/wordpress

<IfModule mod_dir.c>

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm /wordpress

</IfModule>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: