做下列安裝之前,可以先做CentOS 7.6 minimal 關閉 SELinux 與 firewall
1.更新套件
#yum update -y2.安裝Apache
#yum install httpd -y
可觀察安裝後的狀態,可用下列指令
#systemctl status httpd.service
3.啟用Apache
#service httpd start
或是
#systemctl start httpd.service
可觀察安裝後的狀態,可用下列指令
#systemctl status httpd.service
#yum install mariadb mariadb-server -y
5.啟動mariadb
#service mariadb start
或是
#systemctl start mariadb.service
6.設定mariadb
#/usr/bin/mysql_secure_installation
7.安裝php 與其他擴充套件
#yum install php php-cli php-json php-mbstring php-gd php-xml php-ldap php-mysql php-zip -y
8.開機啟動httpd mariadb
#systemctl enable httpd.service
#systemctl enable mariadb.service
9.開機不啟動httpd mariadb
#systemctl disable httpd.service
#systemctl disable mariadb.service
資料來源:
1.CentOS 7.X Lamp環境安裝 (Linux+Apache+MariaDB+PHP)
2.CentOS7 已用 systemd 取代服務的啟動、停止
沒有留言:
張貼留言