1、检查是否已经安装apache
CentOS7.4安装Apache

2、安装pache
CentOS7.4安装Apache

3、安装完成截图
CentOS7.4安装Apache

4、修改配置文件,将端口号修改成8888。(由于我的阿里云上安装了nginx,使用了80端口,这里使用nginx转发到8888端口)

CentOS7.4安装Apache

5、修改配置文件后启动服务,但启动时报错了
CentOS7.4安装Apache
网上搜索了下资料,参考:http://blog.163.com/sir_876/blog/static/11705223201426114342528/

发现是SELinux阻止了启动,需要在SELinux中增加端口号8888,我这里直接增加了8000-10000的tcp和udp端口:

CentOS7.4安装Apache

启动成功
CentOS7.4安装Apache

现在在浏览器上使用域名已经可以访问:http://blog.dev1024.top/

6、将httpd加入开机启动
vi /etc/rc.local
在文件末尾加上  service httpd start



相关文章:

  • 2021-12-29
  • 2021-09-25
  • 2021-11-04
  • 2021-07-30
  • 2021-05-15
  • 2021-10-04
  • 2021-05-18
猜你喜欢
  • 2021-05-01
  • 2021-06-10
  • 2022-12-23
  • 2021-10-20
  • 2021-04-28
  • 2021-09-23
  • 2021-04-19
相关资源
相似解决方案