2017年1月5日 星期四

[研究] LAMP(Linux, Apache 2.4.6, MariaDB 5.5.52, PHP 5.4.16)+OpenSSL 1.0.1e (yum)快速安裝程式(CentOS 7.3)

[研究] LAMP(Linux, Apache, MariaDB, PHP)+OpenSSL(yum)快速安裝程式(CentOS 7.3)

2017-01-05

su   root 切換到 root
執行  sh   install.sh
快速安裝程式 install.sh

# su   root

# Kill nptd on running...
ProcessID="`ps aux | grep ntpd | awk '{print $2}' `"
for i in $ProcessID
do
  echo $i
  kill -9 $i
done
ntpdate tick.stdtime.gov.tw

# Kill yum on running...
ProcessID="`ps aux | grep yum | awk '{print $2}' `"
for i in $ProcessID
do
  echo $i
  kill -9 $i
done

# Kill yum on running...
ProcessID="`ps aux | grep  PackageKit | awk '{print $2}' `"
for i in $ProcessID
do
  echo $i
  kill -9 $i
done

yum -y install httpd mariadb-server mariadb php php-mysql openssl mod_ssl
#yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

systemctl start httpd.service
systemctl enable httpd.service

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

systemctl start mariadb.service
systemctl enable mariadb.service
# http://dev.mysql.com/doc/refman/5.7/en/mysql-secure-installation.html
#mysql_secure_installation

echo "<?php  phpinfo();  ?>"  >  /var/www/html/info.php



(下圖) 測試 http


(下圖) 測試 https (SSL)


(下圖) 測試 http + php





Apache Web Server (http) 設定檔案在
/etc/httpd/conf/httpd.conf

Apache Web Server 的  https(SSL) 設定檔案在
/etc/httpd/conf.d/ssl.conf

其中兩個憑證檔案已經自動產生了
#   Server Certificate:
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
#   Server Private Key:
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

PHP 設定檔案在
/etc/php.ini

MariaDB 設定檔案在
/etc/my.cnf

(完)

相關文章

[研究] LAMP(Linux, Apache, MariaDB, PHP)+OpenSSL(yum)快速安裝程式(CentOS 7.3)
http://shaurong.blogspot.com/2017/01/lamplinux-apache-mariadb_5.html

[研究] phpMyAdmin 4.4.6 安裝 (CentOS 7.1 x64)
http://shaurong.blogspot.com/2015/05/phpmyadmin-446-centos-71-x64.html

[研究] phpMyAdmin 4.0.10.10 安裝 (CentOS 6.6 x64)
http://shaurong.blogspot.com/2015/05/phpmyadmin-401010-centos-66-x64.html


沒有留言:

張貼留言