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 research is complete
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.
Start the VM this morning and find that the test page is inaccessible. Use ps aux | grepNginxAnd ps aux | grepphp check that the processes are started, so it is suspected thatIptablesPlaying tricks. Use serviceIptablesAfter stopping iptables, 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.