今天PM跟我说可能要做下php相关的东西,作为新手先安装php+apache2,碰到一个问题,默认文件存放路径是/var/www/html,但是这个路径需要root权限,很不方便,所以要修改下apache配置:
假设需要定位到 /home/faith/php/
1.修改/etc/apache2/apache2.conf,增加一个Directory
<Directory /home/faith/php/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
2.修改/etc/apache2/sites-available/000-default.conf和/etc/apache2/sites-available/default-ssl.conf
#DocumentRoot /var/www/html
DocumentRoot /home/faith/php
3.重启apache server
sudo /etc/init.d/apache2 restart