1、安装apahce
apt-get install apache2
2、默认网站根目录
Apache的安装路径为/var
默认的网站根目录的路径为/var/www/html
3、Apache自启动
自启动出错,错误信息如下:
apache2:Could not reliaby determine the server's fully domain name,using
127.0.0.1 for SeverName...
4、配置apache自启动
Apache2.conf 位置: /etc/apache2/apache2.conf
vim /etc/apache2/apache2.conf
在打开的apache2.conf文件尾部添加如下信息:
#ServerName
ServerName [ip地址]
5、重启apache
目录:/etc/init.d/apache2 restart
./apache2 restart
6、重启电脑,检测服务器能否自启动;本机访问
浏览器输 http:[之前配置的ip地址] 回车之后看到