安装htppd ( 非root用户操作请在指令前加sudo )
第一步: 安装httpd ( yum会默认安装对应当前centos版本默认的httpd版本 )
yum install httpd
第二步: 检查http安装是否成功
apachectl -v
-- 安装成功应显示相关信息:
Server version: Apache/2.4.6 (CentOS)
Server built: Aug 24 2015 18:11:25
安装不成功显示未找到命令,请返回第一步重新安装
第三步: 设置apache服务启动级别
chkconfig --levels 235 httpd on
第四步: 启动httpd
service httpd restart
第五步:检查httpd进程
ps axu | grep httpd
进程存在会显示多个httpd,如:
root 16224 0.0 0.1 209836 4936 ? Ss 7月22 0:11 /usr/sbin/httpd -DFOREGROUND
apache 24423 0.0 0.1 211920 3932 ? S 13:42 0:00 /usr/sbin/httpd -DFOREGROUND
进程如不存在可通过systemctl status httpd.service或查看httpd安装目录log定位错误
第六步:访问服务器ip对应80端口进入apache默认页确认安装成功
默认页参考: http://wap.quanminbb.com/
或者: http://xxx.xxx.xxx.xxx:80(AWS中需要先确认已完成备案)
推荐:
服务器最低86元/年
拼团链接: 阿里云点击进入