Questions :
Install Apache on CentOS and configure the server to be accessible, but external LAN IP is not accessible
Workaround:
1. My project configuration file passenger.conf
LoadModule Passenger_module/usr/local/rvm/gems/[email Protected]/gems/passenger-4.0.53/buildout/apache2/mod_ Passenger.so
<ifmodule mod_passenger.c>
Passengerroot/usr/local/rvm/gems/[email protected]/gems/passenger-4.0.53
Passengerdefaultruby/usr/local/rvm/gems/[email Protected]/wrappers/ruby
</IfModule>
Listen 192.168.1.106:3005
<virtualhost *:3005>
RAILSENV Development
Errorlog/etc/httpd/logs/error_log
ServerName 192.168.1.106
Documentroot/var/www/html/rails_blog/public
<Directory/var/www/html/rails_blog/public>
AllowOverride All
Options-multiviews
</Directory>
</VirtualHost>
2. Add port mapping, which is the security feature of the CentOS system and why it is suitable for the server.
Method <1>: Modify firewall configuration file directly (/etc/sysconfig/iptables)
-A input-p tcp-m state--state new-m TCP--dport 3005-j ACCEPT
Method <2>: Command modification
/sbin/iptables-i input-p tcp--dport 3005-jaccept
Restart Service
Service Iptables Restart
Check Status
Service Iptables Status
iptables boot automatically:
Open: Chkconfig iptables onoff: chkconfig iptables off
iptables shutdown Service:
Open: Service iptables startClose: Service iptables stop
Reference: http://blog.csdn.net/qianguozheng/article/details/37611859
centos7+apache+passenger+rails4.1.6 deployed servers for LAN internal access