zoukankan      html  css  js  c++  java
  • centos 安装 apache

    跟新:(可选) yum -y update

    #netstat -an | grep 80 (检查端口是否被占用)

    # yum install httpd httpd-devel  或者 yum -y install httpd httpd-manual httpd-devel mod_ssl mod_perl mod_auth_mysql

    # systemctl enable httpd.service (开机自启动设置)

    # systemctl list-unit-files | grep httpd (查看是否开机自启动)

    # systemctl start httpd.service (启动服务)

    # curl http://127.0.0.1 (检查是否成功)

    =============================

    Apache配置文件:/etc/httpd/conf/httpd.conf (可配置,网站目录,日志目录等)
    Apache配置目录,其他配置文件目录:/etc/httpd/conf.d/
    Apache网站根目录:/var/www/html/
    Apache日志文件目录:/var/log/httpd
     

    防火墙中打开 80 端口: 

    # firewall-cmd --zone=public --add-port=80/tcp --permanent (持久化开启80端口)

    # firewall-cmd –reload 

    在浏览器输入公网地址:http://ip/

    ------------------------

    其他补充知识:

    查看版本: firewall-cmd --version

    显示状态: firewall-cmd --state

    查看所有打开的端口: netstat -anp

    开启防火墙 systemctl start firewalld

    关闭防火墙 systemctl stop firewalld

    查询指定端口是否已开

       firewall-cmd --query-port=80/tcp

    systemctl disable firewald.service (永久关闭防火墙)

    systemctl enable firewald.service (永久开启防火墙)

    systemctl start httpd.service #启动apache

    systemctl stop httpd.service #停止apache

    systemctl restart httpd.service #重启apache

    systemctl enable httpd.service #设置apache开机启动

     
  • 相关阅读:
    jQuery 折叠,自动完成,小提示,树,验证插件(bassistance.de)
    多样化的连结提示效果(Tips)
    Ext开源 Extjs2.0 人力资源管理(ASP.NET)
    JavaScript面向对象编程
    访问Ext.data.store的数据
    Ext核心代码分析之Function.createDelegate
    支持firefox的省略符
    Ext 2.0下Jquery的整合使用示例
    多样化的垂直菜单(OUTLOOK菜单)
    使用 jQuery 简化 Ajax 开发
  • 原文地址:https://www.cnblogs.com/Sam-2018/p/centos7-apache.html
Copyright © 2011-2022 走看看