比斯米拉...
在 oracle linux 8 上安裝 apache、php 和 mysql 的說明
- 安裝 apache web 服務(wù)器
sudo yum install -y httpd
關(guān)注:愛掏網(wǎng)
- 安裝 apache http 服務(wù)器。
- 啟用并啟動 apache
sudo systemctl enable httpd sudo systemctl restart httpd
關(guān)注:愛掏網(wǎng)
- 使 apache 能夠在啟動時啟動并重新啟動以應(yīng)用更改。
- 配置防火墻
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --reload
關(guān)注:愛掏網(wǎng)
- 在防火墻上打開 http(端口 80)并重新加載防火墻以應(yīng)用規(guī)則。
- 安裝php
dnf module list php sudo dnf module reset php sudo dnf install @php:7.4 sudo dnf install php-mysqli
關(guān)注:愛掏網(wǎng)
- 列出可用的 php 模塊,重置 php 模塊,并安裝支持 mysql 的 php 7.4。
- 允許 apache 連接到外部數(shù)據(jù)庫(可選)
setsebool -p httpd_can_network_connect_db 1
關(guān)注:愛掏網(wǎng)
- 配置 selinux 以允許 apache 通過網(wǎng)絡(luò)連接到數(shù)據(jù)庫。
- 設(shè)置 apache 的權(quán)限
chown -r apache:apache * # if you have folder to store uploaded file (optional) sudo chcon -r -t httpd_sys_rw_content_t docsuploaded find /var/www/html -type d -exec chmod 755 {} \; find /var/www/html -type f -exec chmod 644 {} \; systemctl restart httpd
關(guān)注:愛掏網(wǎng)
- 將文件的所有權(quán)更改為 apache,設(shè)置目錄的安全上下文,調(diào)整文件權(quán)限,并重新啟動 apache。
- 安裝mysql服務(wù)器
yum install https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm yum-config-manager --disable mysql-8.4-lts-community yum-config-manager --disable mysql-tools-8.4-lts-community yum-config-manager --enable mysql80-community yum-config-manager --enable mysql-tools-community yum repolist enabled | grep mysql sudo yum module disable mysql yum install mysql-community-server
關(guān)注:愛掏網(wǎng)
- 安裝mysql社區(qū)版,禁用不必要的存儲庫,并安裝mysql服務(wù)器。
- 啟動 mysql 并檢查狀態(tài)
systemctl start mysqld systemctl status mysqld
關(guān)注:愛掏網(wǎng)
- 啟動 mysql 服務(wù)器并檢查其狀態(tài)。
- 找回mysql臨時root密碼
sudo grep 'temporary password' /var/log/mysqld.log
關(guān)注:愛掏網(wǎng)
- 從日志文件中獲取 mysql 的臨時 root 密碼。
請我喝杯咖啡
以上就是在 Oracle Linux 8 上安裝 Apache、PHP 和 MySQL的詳細(xì)內(nèi)容,更多請關(guān)注愛掏網(wǎng) - it200.com其它相關(guān)文章!
聲明:所有內(nèi)容來自互聯(lián)網(wǎng)搜索結(jié)果,不保證100%準(zhǔn)確性,僅供參考。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進(jìn)行處理。