主机为金山云centos7.1
一.安装图形化界面
查看系统自带可用源
yum grouplist
安装图形界面
yum groupinstall "Server with GUI"
查看默认运行级别
systemctl get-default
设置默认运行级别为图形化
systemctl set-default graphical.target
二.编译安装apache
查看是否安装 APR APR-util
rpm -qa | grep apr 查看当前主机上是否安装apr/apr-util,这个库为apache提供跨平台的支持
rpm -ql apr 查看具体位置
下载需要的源文件 (没安装的话就需下载编译库)
httpd-2.4.27.tar.gz http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.27.tar.gz
apr-1.6.2.tar.gz http://mirrors.hust.edu.cn/apache//apr/apr-1.6.2.tar.gz
apr-util-1.6.0.tar.gz http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.6.0.tar.gz
解压 apr apr-util 拷贝到 httpd的srclib中 不能有版本名
./configure --prefix=/usr/local/apache2 --with-include-apr --with-include-apr-util --enable-so --enable-ssl --enable-cgi --enable-rewrite --enable-zlib --enable-module=most --enable-mpms-shared=all --with-mpm=event
make && make install
配置httpd