1.安装Apache2.2.3
(虚机的操作系统是CentOS7)
1 sudo yum install wget -y 2 cd /opt 3 sudo wget http://archive.apache.org/dist/httpd/httpd-2.2.3.tar.gz 4 sudo gzip -d httpd-*.tar.gz 5 sudo tar xvf httpd-*.tar 6 cd httpd-* 7 8 sudo yum install gcc gcc-c++ -y 9 10 sudo ./configure --with-mpm=worker --prefix=/opt/httpd --enable-proxy --enable-proxy-http --enable-proxy-ajp 11 sudo make && sudo make install
验证安装
1 cd /opt/httpd 2 bin/httpd -v
启动服务
1 cd /opt/httpd 2 bin/apachectl start
验证服务已启动
ps aux | grep httpd
浏览器中使用外部IP就可以访问页面。It works!