Apache
安装:
yum install httpd加入开机启动:
systemctl enable httpd启动:
systemctl start httpd
隐藏Apache版本
- vim /etc/http/conf/httpd.conf
在尾部加入:
ServerTokens Prod
ServerSignature off
配置Apache,让80端口指向Tomcat
- 注释掉中心主机
vim /etc/httpd/conf/httpd.conf
#DocumentRoot “/var/www/html”
- 新增配置文件
vim /etc/httpd/conf.d/virtual.conf
<VirtualHost *:80>
DocumentRoot /usr/apache-tomcat-8.5.31/webapps/ROOT/
ServerName localhost
ProxyVia Off
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
开启服务
开启Tomcat
systemctl start tomcat开启Apache
systemctl start httpd
Apache相关目录信息
日志目录
/var/log/httpd/默认主页testing123文件位置
/usr/share/httpd/