Linux下Apache2的安装与配置

1.安装Apache2

sudo apt-get install apache2

2.配置Apache2  

vim etc/apache2/apache2.conf
配置文件位置

 /etc/apache2/sites-available/ 000-default.conf

配置项目路径

 DocumentRoot /var/www/homePage


Start Apache 2 Server /启动apache服务
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
Task: Restart Apache 2 Server /重启apache服务
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
Task: Stop Apache 2 Server /停止apache服务
# /etc/init.d/apache2 stop

你可能感兴趣的:(Apache)