歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> Ubuntu下安裝和設置Apache2

Ubuntu下安裝和設置Apache2

日期:2017/3/3 16:43:40   编辑:關於Linux

在Ubuntu中安裝apache

安裝指令:sudo apt-get install apache2

安裝結束後:

產生的啟動和停止文件是:/etc/init.d/apache2

啟動:sudo apache2ctl -k start

停止:sudo apache2ctl -k stop

重新啟動:sudo apache2ctl -k restart

配置文件保存在:/etc/apache2

需要說明的是,普通的apache發行版本配置文件是:

httpd.conf

Ubuntu發行版本的主配置文件是:

apache2.conf

在apache2.conf引用到了以下文件:

# 包含動態模塊的配置:

Include /etc/apache2/mods-enabled/*.load

Include /etc/apache2/mods-enabled/*.conf

# 包含用戶自己的配置:

Include /etc/apache2/httpd.conf

# 包含端口監聽的配置:

Include /etc/apache2/ports.conf

# 包含一般性的配置語句片斷:

Include /etc/apache2/conf.d/

# 包含虛擬主機的配置指令:

Include /etc/apache2/sites-enabled/

修改httpd.conf

增加以下內容:

ServerName 127.0.0.1:80

進一步的配置和使用,就可以查閱APACHE的手冊了

Copyright © Linux教程網 All Rights Reserved