centos7+apache+passenger+rails4.1.6 deployed servers for LAN internal access

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.