大家好,又见面了,我是你们的朋友全栈君。
1./etc/httpd/conf.d/test.conf
<VirtualHost *:8000>
ServerName test.com//也可以是ip地址
DocumentRoot /var/www/test
DirectoryIndex index.html index.php
AddDefaultCharset utf-8
DefaultLanguage utf-8
LanguagePriority
<Directory "/var/www/test">
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>
2./etc/httpd/conf/httpd.conf
加入端口号
#test
Listen 8000
Listen 80
3.配置防火墙/etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
# test
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
# kingbase bak
# -A INPUT -m state --state NEW -m tcp -p tcp --dport 54321 -j ACCEPT
COMMIT
4重启服务
service httpd restart 重启apache服务
/etc/init.d/iptables restart 最后重启防火墙使配置生效
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/142880.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...