Please note, that this only applies for Ubuntu 14.04 LTS and newer releases.
(请注意,这仅适用于Ubuntu 14.04 LTS和更新版本。)
In my Ubuntu 14.04 LTS, the document root was set to /var/www/html
.
(在我的Ubuntu 14.04 LTS中,文档根目录设置为/var/www/html
。)
It was configured in the following file: (它在以下文件中配置:)
/etc/apache2/sites-available/000-default.conf
So just do a
(所以,做一个)
sudo nano /etc/apache2/sites-available/000-default.conf
and change the following line to what you want:
(并将以下行更改为您想要的:)
DocumentRoot /var/www/html
Also do a
(还做一个)
sudo nano /etc/apache2/apache2.conf
and find this
(找到这个)
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
and change /var/www/html
to your preferred directory
(并将/var/www/html
更改为您的首选目录)
and save it.
(并保存。)
After you saved your changes, just restart the apache2 webserver and you'll be done :)
(保存更改后,只需重新启动apache2 webserver即可完成:))
sudo service apache2 restart
If you prefer a graphical text editor, you can just replace the sudo nano
by a gksu gedit
.
如果你更喜欢图形文本编辑器,你可以用gksu gedit
替换sudo nano
。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…