I have studied the lnmp one-click installation package of June, and want to streamline it and use it as my own installation and configuration script. I deleted a lot of interaction and judgment parts. Some others haven't understood them yet, but I probably know the functions. After running it on a new virtual machine, after more than an hour of installation, you can access the test page, and phpinfo page. After the study is complete, add comments and put them on.
Starting the virtual machine this morning, I found that the test page could not be accessed. I checked the processes with ps aux | grep nginx and ps aux | grep php and started them. I suspect iptables is playing tricks. After stopping iptables with service iptables stop, the test page can be accessed normally.
View iptables settings in the next one-click installation package
# Add 80 port to iptables
If [-s/sbin/iptables]; then
/Sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT
/Sbin/iptables-save
Fi
There are indeed settings, but the settings are not saved.
Later, Google found a post with the settings
/Sbin/iptables-I INPUT-p tcp -- dport 80-j ACCEPT
/Sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT
/Etc/rc. d/init. d/iptables save
/Etc/init. d/iptables restart
Reboot after resetting. Start up and access the test page. OK! The main difference is that the location of the iptables called during storage is different.
Recommended reading:
Linux Firewall iptables
Iptables + L7 + Squid implements a complete software firewall
Basic use of iptables backup, recovery, and firewall scripts
Detailed description of firewall iptables usage rules in Linux