1、在Fedora / CentOS / Red Hat Enterprise Linux上安装
sudo yum install httpd
sudo systemctl enable httpd
sudo systemctl start httpd
2、在Ubuntu / Debian上安装
sudo apt install apache2
sudo service apache2 start
3、源代码安装
下载:http://httpd.apache.org/download.cgi 提取: $ gzip -d httpd-NN.tar.gz $ tar xvf httpd-NN.tar $ cd httpd-NN Configure $ ./configure --prefix=PREFIX 编译:$ make 安装:$ make install Customize $ vi PREFIX/conf/httpd.conf Test $ PREFIX/bin/apachectl -k start #启动与停止 $ PREFIX/bin/apachectl -k start/$ PREFIX/bin/apachectl -k stop #NN必须替换为当前版本号,并且PREFIX必须替换为应安装服务器的文件系统路径。如果 未指定PREFIX,则默认为 /usr/local/apache
4、升级
$ ./config.nice
$ make
$ make install
$ PREFIX/bin/apachectl -k graceful-stop
$ PREFIX/bin/apachectl -k start