準(zhǔn)備篇
一、防火墻配置
CentOS 7.x默認(rèn)使用的是firewall作為防火墻,這里改為iptables防火墻。
1、關(guān)閉firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機(jī)啟動(dòng)
2、安裝iptables防火墻
yum install iptables-services
#安裝
vi /etc/sysconfig/iptables #編輯防火墻配置文件
# sample configuration for iptables service# you can edit this manually or use system-config-firewall# please do not ask us to add additional ports/services to this default configuration*filter:INPUT ACCEPT [0:0]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [0:0]-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT-A INPUT -j REJECT --reject-with icmp-host-prohibited-A FORWARD -j REJECT --reject-with icmp-host-prohibitedCOMMIT
:wq! #保存退出
systemctl restart iptables.service #最后重啟防火墻使配置生效
systemctl enable iptables.service #設(shè)置防火墻開機(jī)啟動(dòng)
/usr/libexec/iptables/iptables.init restart #重啟防火墻
二、關(guān)閉SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注釋掉
#SELINUXTYPE=targeted #注釋掉
SELINUX=disabled #增加
:wq! #保存退出
setenforce 0 #使配置立即生效
三 、系統(tǒng)約定
軟件源代碼包存放位置:/usr/local/src
源碼包編譯安裝位置:/usr/local/軟件名字
四、下載軟件包
1、下載nginx
http://nginx.org/download/nginx-1.10.1.tar.gz
2、下載MySQL
http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.33.tar.gz
3、下載php
http://cn2.php.net/distributions/php-5.6.26.tar.gz
4、下載cmake(MySQL編譯工具)
https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
5、下載pcre (支持nginx偽靜態(tài))
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
6、下載openssl(nginx擴(kuò)展)
https://www.openssl.org/source/openssl-1.0.2j.tar.gz
7、下載zlib(nginx擴(kuò)展)
http://zlib.net/zlib-1.2.8.tar.gz
8、下載libmcrypt(php擴(kuò)展)
http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
9、下載yasm(php擴(kuò)展)
http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
10、t1lib(php擴(kuò)展)
ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.1.2.tar.gz
11、下載gd庫安裝包
https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.1.tar.gz
12、libvpx(gd庫需要)
http://ftp.osuosl.org/pub/blfs/conglomeration/libvpx/libvpx-1.6.0.tar.bz2
13、tiff(gd庫需要)
http://download.osgeo.org/libtiff/tiff-4.0.6.tar.gz
14、libpng(gd庫需要)
新聞熱點(diǎn)
疑難解答
圖片精選