centos安装apche
来源:互联网 发布:传至大数据3期百度云 编辑:程序博客网 时间:2024/05/22 18:22
yum -y install httpd
安装完之后 看看 他在那个位置(rpm -ql httpd)
#在/usr/bin/
cd进入 /usr/bin/
[root@localhost bin]# apachectl -k start
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
[root@localhost bin]# firewall-cmd --zone=public --add-port=80/tcp --permanent 对防火墙需要访问80端口
success
[root@localhost bin]# systemctl restart firewalld.service 重启防火墙
开打浏览器输入 你虚拟机ip:80
默认目录是/var/www/html下。修改方法:打开/etc/httpd/conf/httpd.conf文件,找到下面这行DocumentRoot "/var/www/html"可以改成你想要的目录。
(有些小伙伴apche不能解析php代码是apche少了下面的配置,配置之后重启就可以了)
修改APACHE配置文件
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
启动APACHE服务
[root@localhost ~]# systemctl start httpd.service
[root@localhost ~]# ps -ef | grep httpd
- centos安装apche
- apche 安装
- 基于CentOS 5.7下编译安装apche+php+mysql+wordpress
- centos linux 版本下 安装apche php mysql 环境
- Linux 安装Apche Http
- APCHE+TOMCAT集成安装
- 利用YUM 在CentOS 下安装LAMP(Linux,apche,mysql,php)
- ubuntu安装php+mysql+apche
- Centos下apche与tomcat整合
- CentOS防火墙开通apche/mysql端口
- linux下安装apche的安装
- j2sdk+tomcat+apche安装与配置
- win7 下安装 apche php mysql
- 在windows2003Server上安装bugzilla+apche
- apche mahout0.8安装与测试
- Linux下编译安装apche+php+mysql
- ubuntu安装apche出错:APR not found.
- win7下apche+mysql+php安装日志
- ios 代理、block和通知
- C#167课的主要内容
- c语言排序
- HDU4576 A very hard mathematic problem(很好的搜索)
- MySQL 'root'@'localhost'无法登录
- centos安装apche
- 高并发服务器架构笔记(3)——muduo_base 源码分析
- 坚持#第181天~海贼王
- Building Apps with Content Sharing
- css3 flexbox layout(弹性布局)完全解析
- 使用python Tkinter制作一个可以生成重复文本片段的小工具
- 解决Maven更新后错误Dynamic Web Module 3.0 requires Java 1.6 or newer
- sdut-离散题目10
- 数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter