# LAMP(Apache+MariaDB+PHP7.2 **安裝具有Apache+MariaDB+PHP7.2語言+資料庫管理介面phpMyAdmin套件,完成一個具有資料庫的動態網頁程式設計的開發環境** * 安裝 Apache Server `sudo apt-get intstall apache2` * 安裝 phpmyadmin 套件 `sudo apt-get install phpmyadmin` * 下載 EPEL Repository 及 Remi Repo : `yum install epel-release` `rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm` * 安裝MariaDB `sudo yum -y install nginx php70-php-fpm mariadb-server` * 安裝httpd `sudo yum -y install httpd` * 避免網頁目錄被讀取 修改 /etc/apache2/apache2.conf 檔案 移除<Directory / > 和 </Directory> 中間的Indexs字眼 * 移除網頁伺服器資訊 修改/etc/apache2/conf-available/localized-error-pages.conf 設定ErrorDocume 403 內容 * 修改/etc/apache2/mods-available/php5.conf,設定 ``` <IfModule mod_userdir.c> <Directory /home/*/public_html> php_admin_value engine On </Directory> </IfModule> ``` * 重啟apache `sudo service apache2 restart` * 允許防火牆讓 HTTP、HTTPS 封包通過。 `sudo firewall-cmd --permanent --zone=public --add-service=http` `sudo firewall-cmd --permanent --zone=public --add-service=https` `sudo firewall-cmd --reload` * 啟動 httpd,並讓它在開機後自動啟動。 `sudo systemctl start httpd` `sudo systemctl enable httpd` * 啟動 MariaDB Server,並讓它在開機後自動啟動。 `sudo systemctl restart mariadb` `sudo systemctl enable mariadb` * 為 Apache 加入 PHP 的支援,重新啟動 Apache 就可以了。 `sudo systemctl restart httpd` * 建立一個 PHP 測試檔。 `sudo vi /var/www/html/info.php` * 呼叫內建函數。 `<?php phpinfo(); ?>` * **http ://ip addr/info.php**``就可以看到全部的資料 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up