安装apache2
sudo apt-get install apache2
apache配置文件
cd /etc/apache2/sites-available
先备份一个配置文件
cp 000-default.conf xxx.conf //xxx代表自己起名字
修改文件内容
sudo vim xxx.conf
增加一个ServerName 后面跟上你的网址
DocumentRoot后面跟着网站访问的文件夹
把修改后的配置文件链接到site-enabled目录下
sudo ln -s /etc/apache2/sites-available/xxx.conf ../sites-enabled/
重启apache2服务器
sudo /etc/init.d/apache2 restart
这样就基本完成了,然后可以改一下index.html文件看一下是否成功