yum命令輕鬆搭建lamp架構
阿新 • • 發佈:2022-04-02
圖解lamp架構
關於linux防火牆
cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted 執行中 # enforcing - SELinux security policy is enforced. 臨時關閉中,下次開機還會啟動 # permissive - SELinux prints warnings instead of enforcing. 永久關閉了 # disabled - No SELinux policy is loaded. 修改selinux狀態,enforcing > permissive setenforce 0 想永久關閉,還得修改配置檔案,然後reboot reboot 關閉firewalld防火牆 iptables -F 清空iptables規則 systemctl stop firewalld 停止防火牆執行 systemctl disable firewalld 禁止防火牆開機自啟 以上兩條命令敲完就相當於永久禁用firewalld
通過yum命令點點點搭建lamp架構
安裝準備其執行環境 [root@xinxin ~]# yum install httpd -y 安裝apache [root@xinxin ~]#yum install php -y 安裝php後端語言 [root@xinxin ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm [root@xinxin ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm 下載資料庫yum源配置檔案 [root@xinxin yum,repos.d]# rpm -ivh mysql-community-release-el7-5.noarch.rpm 獲取該repo檔案 [root@xinxin yum,repos.d]# yum -y install mysql-community-server 安裝資料庫 [root@xinxin yum,repos.d]# systemctl restart mysqld 啟動資料庫 [root@xinxin yum,repos.d]# mysql_secure_installation 初始化資料庫密碼 [root@xinxin yum,repos.d]# mysql -uroot -p 用新密碼登入資料庫 [root@xinxin ~]# wget https://www.dismall.com/forum.php?mod=attachment&aid=MTA0fGZlYmVhN2ZlfDE2NDg3ODQ3ODV8MHw3Mw%3D%3D 下載該 論壇原始碼 [root@xinxin ~]# unzip -d /var/www/html/ Discuz_X3.4_SC_UTF8_20220131.zip 通過該命令將其解壓到指定目錄下 [root@xinxin ~]# cd /var/www/html/ 進入到該目錄下 [root@xinxin html]# mv upload/* ./ 將該檔案內的所有內容全部移到當前目錄下才能訪問到該網頁 [root@xinxin html]# chmod -R 777 ./* 需要對這些檔案提權才能讀取到這些檔案內容 [root@xinxin html]# systemctl restart httpd 重啟Apache服務即可通過自己的ip進入到網頁中操作 [root@xinxin html]# yum install php-mysqli -y 安裝過程中發現少一個驅動,通過此命令安裝該驅動 最終安裝完成介面