ubuntu中apache的安装

来源:互联网 发布:淘宝网店产品摄影 编辑:程序博客网 时间:2024/06/03 19:47

apache2的安装

sudo apt-get install apache2


apache2的启动,停止和重启

sudo /etc/init.d/apache2 stop

sudo /etc/init.d/apache2 start

sudo /etc/init.d/apache2 restart


配置文件一般是在etc/apache2/apache2.conf


修改默认目录

sudo gedit /etc/apache2/apache2.conf

修改<Directory /var/www/>

为<Directory /var/www>

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

修改DocumentRoot /var/www/html

为DocumentRoot /var/www


重启apache

sudo /etc/init.d/apache2 restart


复制一个文件

sudo cp /var/www/html/index.html /var/www


删除目录

sudo rm -r /var/www/html




0 0
原创粉丝点击