apache服务器安装教程

weblog 947 0 0

1.卸载apache服务器

查看有没有安装过 yum list | grep httpd

停止服务:systemctl stop httpd.service

卸载httpdyum erase -y httpd.x86_64

 

 

2.在线安装:yum -y install httpd

开启apache服务 systemctl start httpd.service

设置apache服务开机启动:systemctl enable httpd.service

设置防火墙

访问,默认端口80

 

默认安装位置:/etc/httpd

默认访问目录:/var/www/html

 

.修改禁止显示目录索引:

去掉Indexes,重启:service httpd restart即可

 

 

4.修改apache默认网站目录

修改httpd.configvi /etc/httpd/conf/httpd.conf

找到 DocumentRoot "/var/www/html"

/var/www/html 这个目录改为/usr/local/www/html

再找到 <Directory "/var/www/html">

/var/www/html改成/usr/local/www/html

修改用户权限:chmod -R 755 /usr/local/www/html

重启服务即可:service httpd restart

 

 

命令:

service httpd start 启动

service httpd restart 重新启动

service httpd stop 停止服务

猜你喜欢
其他 4096 1.卸载apache查看有没有过:yumlist|grephttpd停止:systemctlstophttpd.service卸载httpd:yumerase
框架 1549 环境:系统:centos7java环境:jdk1.8版本:elasticsearch-7.3.2elasticsearch下载官网:https://www.elastic.co/cn
算法基础,linux 960 拉取最新的redis镜像dockerpullredis:latest运行redis容dockerrun-itd--nameredis-test-p6379:6379redis如果是在vm虚拟机中运行的记得开放相应的端口
linux系统 1836 软件版本:一、linux系统版本:CentOS-7-x86_64-DVD-1708.iso下载地址:http://mirror.nsc.liu.se/centos-store/7.4.1708/isos/x86_64/二、gitlib版本:gitlab-ce-10.8.2-ce.0.el7.x86_64.rpm下载地址:https://mirrors.tuna.tsinghua.edu.cn/gi
weblog 1021 环境系统:centos7rabbitmq:rabbitmq-server-3.6.10-1.el7.noarch.rpmsocatyum-yinstallsocat
框架 1355 软件下载地址:https://pan.baidu.com/s/13gX0ParcOMO_XYcdfSPlzg提取码:9y0e的时候注意jdk和elasticsearch版本问题,本次测试版本
linux 1063 一、erlang二、socat三、rabbitmq四、启动五、开启用户远访问六、rabbitmq常用命令一、erlang文件下载地址:https://github.com
weblog 1139 centos7版本部署的tomcat,需要将8080端口放开执行如下命令:firewall-cmd--zone=public--add-port=8080/tcp--permanentfirewall
目录