ubuntu14.04 apache修改网站根目录以及默认网页

来源:互联网 发布:电话轰炸机原理知乎 编辑:程序博客网 时间:2024/06/05 09:23

服务器端系统是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>
0 0
原创粉丝点击