在ubuntu下搭建好了LAMP环境,假设网站目录是/var/www/abc,在sites-available中设置好虚拟主机,并启用:
<VirtualHost *:80>
ServerAdmin
[email protected] ServerName
www.abc.com DocumentRoot /var/www/abc
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/abc/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
问题是,网站目录下所有的php文件都读不出来,只能读取静态文件。现在连wordpress都安装不了。而在/var/www/目录中就可以读取。