centos 7 x64 裝了 neo4j 想用其它機器訪問,無奈一直被拒絕,後來發現是防火牆啓用了。
systemctl status firewalld
可以查看防火牆狀態。
現在爲 neo4j 添加服務
拷貝一個配置文件作爲 neo4j 的服務樣例文件,然後進行修改。 如使用ssh.xml
cp /usr/lib/firewalld/services/ssh.xml /usr/lib/firewalld/services/neo4j.xml
然後修改 neo4j.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>SSH</short>
<description>Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on accessing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh-server package installed for this option to be useful.</description>
<port protocol="tcp" port="22"/>
</service>
改爲:
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>neo4j-web</short>
<description>neo4j http https</description>
<port protocol="tcp" port="7474"/>
<port protocol="tcp" port="7473"/>
</service>
重新加載 firewall 服務配置
firewall-cmd --reload
然後添加服務
firewall-cmd --zone=public --add-service=neo4j
More detail see ref.