# apt install apache2
# systemctl status apache2.service
打開瀏覽器http://IP 確認Apache 服務正常
如果Web要使用HTTPS,必須啟動Apache SSL
# a2ensite default-ssl.conf
# systemctl restart apache2.service
# netstat -tlpn
打開瀏覽器https://IP 確認Apache 服務正常
安裝PHP
# apt search php7.0
# apt install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-xml php7.0-gd
# php -v
# vi /var/www/html/info.php 新增此檔,內容如下:
<?php
phpinfo();
?>
# systemctl restart apache2
開啟瀏覽器 http://ip/info.php
如果要額外安裝PHP模組,可以使用下列指令列出可安裝之麼組
# apt install php7.0
安裝MariaDB 10
# apt install php7.0-mysql mariadb-server mariadb-client
# mysql_secure_installation
# mysql
MariaDB [(none)]> use mysql;
MariaDB [mysql]> update user set plugin=’‘ where User=’root’;
MariaDB [mysql]> flush privileges;
MariaDB [mysql]> exit
# systemctl restart mysql.service
# mysql -u root -p
沒有留言:
張貼留言