rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install php72w php72w-opcache php72w-cli php72w-common php72w-devel php72w-fpm php72w-gd php72w-imap php72w-mbstring php72w-mcrypt php72w-opcache php72w-pdo php72w-xml php72w-snmp php72w-soap php72w-tidy php72w-mysql php-getid3 php72w-bcmath
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install php71w php71w-opcache php71w-cli php71w-common php71w-devel php71w-fpm php71w-gd php71w-imap php71w-mbstring php71w-mcrypt php71w-opcache php71w-pdo php71w-xml php71w-snmp php71w-soap php71w-tidy php71w-mysql php-getid3 php71w-bcmath
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install apache mariadb-server mariadb yum install php71w php71w-opcache yum install php71w-cli php71w-common php71w-devel php71w-fpm php71w-gd php71w-imap php71w-mbstring php71w-mcrypt php71w-opcache php71w-pdo php71w-xml php71w-snmp php71w-soap php71w-tidy php71w-mysql yum install libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm yum install apache mariadb-server mariadb yum install php56w php56w-opcache yum install php56w-cli php56w-common php56w-devel php56w-fpm php56w-gd php56w-imap php56w-mbstring php56w-mcrypt php56w-opcache php56w-pdo php56w-xml php56w-snmp php56w-soap php56w-tidy php56w-mysql yum install libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
yum install telnet ntpdate sntp unzip wget mlocate net-tools mailx iftop id3lib libid3tag
vi /etc/selinux/config
[global] unix charset = UTF8 guest account = apache load printers = no printing = bsd usershare allow guests = Yes max protocol = SMB2 security = user map to guest = Bad User strict locking = no [www] comment = Web Directory path = /var/www public = yes writable = yes browseable = yes printable = no guest ok = yes write list = +staff create mode = 0777 directory mode = 0777 create mask = 0777 force create mode = 0777 directory mask = 0777 force directory mode = 0777 force user = apache force group = apache acl check permissions = False
LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog "logs/access_log" vcommon UseCanonicalName off <VirtualHost *:80> ServerAlias * VirtualDocumentRoot /var/www/cloud/%0/ CustomLog logs/cloud-access_log vcombined ErrorLog logs/cloud-error_log <Directory "/var/www/cloud/*/"> Options FollowSymLinks AllowOverride All </Directory> </VirtualHost>
# 加入 80/443 port (永久) firewall-cmd --add-port=80/tcp --permanent firewall-cmd --add-port=443/tcp --permanent # 允許某個 ip 才能連線 firewall-cmd --add-rich-rule="rule family="ipv4" source address="192.168.1.1" accept" --permanent # 允許某個區段的 IP 才能連線 firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='192.168.1.0/24' accept" # 設定好後需要執行 reload firewall-cmd --reload # 也可以執行以下指令顯示目前的設定 firewall-cmd --list-all # 如果要刪除的話,就改成 remove-port 即可 firewall-cmd --remove-port=8080/tcp --permanent
<?xml version="1.0" encoding="utf-8"?> <zone> <short>Public</short> <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description> <service name="dhcpv6-client"/> <service name="ssh"/> <port protocol="tcp" port="443"/> <port protocol="tcp" port="80"/> <rule family="ipv4"> <source address="192.168.1.1"/> <accept/> </rule> <rule family="ipv4"> <source address="192.168.1.2"/> <accept/> </rule> </zone> </zone>
memory_limit = 1024M max_execution_time = 300 post_max_size = 1024M upload_max_filesize = 1024M max_input_time = 600 always_populate_raw_post_data = -1
systemctl enable firewalld; systemctl restart firewalld; systemctl enable httpd; systemctl restart httpd; systemctl enable mariadb; systemctl restart mariadb;