关于apache2: Could not reliably determine the server’s fully qualified domain name 解决方法
首先来到apache配置文件:
vim /etc/apache2/apache2.conf
在文件的末尾出,添加一句:ServerName localhost:80即可。
独立开启小站:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName blog.liang
DocumentRoot /var/www/ourblog
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/ourblog>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
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
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
cd /etc/apache2/sites-available
//复制一份default,命名为新的域名
sudo cp default blog.liang
//修改好之后启动该站点
a2ensite blog.liang
//重新加载Apache
sudo service apache2 reload
//or重启Apache
sudo service apache2 restart
//可以用ping命令来测试是否能连接
ping blog.liang