Linux:启动http服务
1、安装apache
yum install httpd #根据提示,输入Y安装即可成功安装
systemctl start httpd.service #启动apache
systemctl stop httpd.service #停止apache
systemctl restart httpd.service #重启apache
systemctl enable httpd.service #设置apache开机启动
2、启动http服务
httpd -version #检查是否安装
yum install httpd #安装http服务
service httpd start #启动http服务
service httpd status #检查http服务状态(会显示绿色的active(running)表示启动成功)
service httpd restart #重启http服务
3、配置文件
httpd相关配置文件:
主配置文件:/etc/httpd/conf/httd.conf ,这个是httpd最主要的配置文档
扩展配置文件:/etc/httpd/conf.d/*.conf ,这个是httpd的额外配置文档
文档根目录: /var/www/html ,这个是apache 首页的文档目录 ,即输入http://127.0.0.1 显示页面所在的目录
服务脚本:/etc/rc.d/init.d/httpd
错误目录:/var/www/error ,服务器设定错误,请求的资源错误或浏览器访问出现错误等错误文件的存储目录
CGI目录: /var/www/cgi-bin/ ,预设为CGI运行脚本的存储目录
日志目录:/var/log/httpd ,client端登录httpd时,记录的登录日志等信息存储目录
脚本配置文件: /etc/sysconfig/httpd
Listen端口:80/tcp ,443/tcp
命令执行文件:/usr/sbin/apachectl ,/usr/sbin/httpd,/usr/bin/htpasswd
PID文件:/var/run/httpd/httpd.pid
4、开放80端口 打开防火墙
查看指定区域所有开启的端口号
firewall-cmd --zone=public --list-ports
在指定区域开启端口(如80端口号,命令方式)
firewall-cmd --zone=public --add-port=80/tcp --permanent
重新启动防火墙
firewall-cmd --reload
参考网址:https://blog.csdn.net/u014079773/article/details/79745819
5、测试网页
echo “This is my first web page.”>/var/www/html/index.html
打开http://127.0.0.1 查看是否正常启动
Linux:启动http服务的更多相关文章
- 如何查看和停止Linux启动的服务
1. 查看Linux启动的服务chkconfig --list 查询出所有当前运行的服务chkconfig --list atd 查询atd服务的当前状态 2.停止所有服务并且在下次系统启动时不再启 ...
- Linux启动ssh服务
Linux启动ssh服务 在Linux下启动ssh服务使用如下命令其一即可: # service sshd start # /etc/init.d/sshd start 开机启动 使用如下方法其就可以 ...
- linux启动httpd服务出现 Could not reliably determine the server`s fully qualified domain name.
安装好apache启动httpd服务时,出现httpd: Could not reliably determine the server's fully qualified domain name, ...
- linux启动http服务
1.安装apache yum install httpd #根据提示,输入Y安装即可成功安装 systemctl start httpd.service #启动apache systemctl sto ...
- Linux 启动SVN服务
#使用默认端口3690启动svn服务svnserve -d -r /home/svndata # 如果出现#svnserve: Can't bind server socket: Address al ...
- linux 启动ftp服务,sftp服务
启动ftp服务:yum install vsftpd 在/etc/rc.d/init.d/目录下:命令 service vsftp start启动ssh服务,sftp服务在/etc/init.d/目录 ...
- Linux启动一个服务后,服务的某个文件所在的目录下出现类似:systemd-private.xxxxxx的目录
Linux的目录下面形如: [root@:vg_adn_tidbCkhsTest:172.31.17.203 /var/lib/mysql]#ll /tmp total drwxr root root ...
- linux启动oracle服务 和监听
(1) su - oracle 切换成oracle 用户 (2)sqlplus / as sysdba (3)startup: (4)quit:退出sql模式 exit 退出oracle用户 (5)l ...
- 【转】Linux学习之路--启动VNC服务
我的Linux是Fedora 13,安装方法如下: 1.打开终端,执行 # yum install -y tigervnc tigervnc-server 2.编辑/etc/sysconfi/vncs ...
- linux下tomcat服务的启动、关闭与错误跟踪
linux下tomcat服务的启动.关闭与错误跟踪,远程连接到服务器以后,通常通过以下几种方式启动关闭tomcat服务: 1).启动tomcat服务 进入tomcat主目录下的bin目录,然后执行如下 ...
随机推荐
- 由世界坐标系转换到摄像机坐标系的lookAt()函数
在学习图形学和opengl的时候,都涉及到坐标转化,从物体坐标转换为世界的坐标,从世界的坐标转换为摄像机的坐标. 在世界坐标到摄像机转换的过程中常用lookAt函数得到转化矩阵.GLM官方文档对它的解 ...
- Spring Cloud 理论篇
show me the code and talk to me,做的出来更要说的明白 github同步收录 我是布尔bl,你的支持是我分享的动力! 微服务 在 jsp 时代,应用前后端耦合,前后端 a ...
- List remove ConcurrentModificationException源码分析
代码块 Java Exception in thread "main" java.util.ConcurrentModificationException at j ...
- vue基础----组件通信($parent,$children)
1.按照dom的父子级关系,在子组件中可以通过$parent 直接调用父组件的方法,也可得到父组件的属性. 2.在父组件中通过$childrens可以得到一个子组件数组,能够在父组件中调用子组件的方法 ...
- javascript中怎么判断两个数据类型相等
在 JavaScript 中,判断一个变量的类型尝尝会用 typeof 运算符,在使用 typeof 运算符时采用引用类型存储值会出现一个问题,无论引用的是什么类型的对象,它都返回 "obj ...
- 【SpringBoot基础系列-实战】如何指定 bean 最先加载(应用篇)
[基础系列-实战]如何指定 bean 最先加载(应用篇) 在日常的业务开发中,绝大多数我们都是不关注 bean 的加载顺序,然而如果在某些场景下,当我们希望某个 bean 优于其他的 bean 被实例 ...
- java实现QQ、微信、轰炸机,撩妹,抖图功能,轻松自如
今天交大家一个很牛的功能,让你朋友服你,他不扶你你来找我. 打游戏被骂,骂不过你来找我,我们有神器,直到他怕了为止. 废话少说,代码如下,动手,干就完了 乞丐版如下 参考连接:Java实现QQ微信轰炸 ...
- Cisco 模拟配置
本次模拟:采用Cisco Packet Tracer 软件,进行cisco网络设备的模拟.可以实现CLI界面命令配置,同实际交换机一样. 1.同一VLAN 可以互相访问,不同VLAN 不能访问 PC0 ...
- 北邮OJ103.反转单词 c++/java
103. 反转单词 时间限制 1000 ms 内存限制 65536 KB 题目描述 给出一句英文句子(只由大小写字母和空格组成,不含标点符号,也不会出现连续的空格),请将其中的所有单词顺序翻转 输入格 ...
- Building Applications with Force.com and VisualForce(Dev401)( 九):Designing Applications for Multiple Users: Putting It All Together
Module Objectives1.Apply profiles, organization wide defaults, role hierarchy and sharing to given a ...