99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

Ubuntu怎么安裝Apache、PHP和MySQL

這篇“Ubuntu怎么安裝Apache、PHP和MySQL”文章的知識點大部分人都不太理解,所以小編給大家總結了以下內容,內容詳細,步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“Ubuntu怎么安裝Apache、PHP和MySQL”文章吧。

成都創新互聯專業為企業提供旌德網站建設、旌德做網站、旌德網站設計、旌德網站制作等企業網站建設、網頁設計與制作、旌德企業網站模板建站服務,10余年旌德做網站經驗,不只是建網站,更提供有價值的思路和整體網絡服務。

更新操作系統

在安裝之前,我們更新操作系統到最新版本,并重啟云服務器

sudo apt-get update -y
sudo apt-get upgrade -y
reboot

安裝Apache

通過以下命令安裝Apache:

sudo apt-get install apache2 -y

通過以下命令查看Apache的版本:

apache2 -v

顯示結果如下:

Server version: Apache/2.4.29 (Ubuntu)
Server built:   2019-12-03T15:55:03

還需要設置Apache跟隨系統啟動:

sudo systemctl enable apache2.service

如果我們在瀏覽器上訪問云服務器的IP地址 http://IPAddress ,出現Apache的默認頁面,就說明Apache已經安裝成功了。

Ubuntu怎么安裝Apache、PHP和MySQL

安裝PHP

通過以下命令安裝PHP:

sudo apt-get install php -y

接下來,安裝必要的PHP擴展:

sudo apt-get install php-{bcmath,bz2,intl,gd,mbstring,mysql,fpm} -y

通過以下命令查看PHP的版本:

php -v

顯示結果如下:

PHP 7.2.24-0ubuntu0.18.04.3 (cli) (built: Feb 11 2020 15:55:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.24-0ubuntu0.18.04.3, Copyright (c) 1999-2018, by Zend Technologies

通過以下命令查看PHP安裝的模塊:

php -m

顯示結果如下:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
date
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

安裝MySQL

通過以下命令安裝MySQL:

sudo apt-get install mysql-server -y

通過以下命令查看MySQL的版本:

mysql -V

顯示結果如下:

mysql  Ver 14.14 Distrib 5.7.29, for Linux (x86_64) using  EditLine wrapper

然后,運行MySQL安裝配置向導:

sudo mysql_secure_installation

在MySQL安裝配置向導中,我們需要輸入root密碼,并回答一些安全性相關的問題,通常只需要選擇向導提供的默認值即可。

Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: Y
There are three levels of password validation policy:
LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Please set the password for root here.
New password:
Re-enter new password:
Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
Success.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
Success.
By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
 - Dropping test database...
Success.
 - Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.
All done!

還需要設置MySQL跟隨系統啟動:

sudo systemctl enable mysql.service

設置UFW

默認情況下,Ubuntu的防火墻UFW是禁用狀態的。我們需要啟用UFW,并允許SSH和Apache相關端口的訪問。

sudo ufw allow OpenSSH
sudo ufw allow in "Apache Full"
sudo ufw enable

以上就是關于“Ubuntu怎么安裝Apache、PHP和MySQL”這篇文章的內容,相信大家都有了一定的了解,希望小編分享的內容對大家有幫助,若想了解更多相關的知識內容,請關注創新互聯行業資訊頻道。

本文題目:Ubuntu怎么安裝Apache、PHP和MySQL
鏈接分享:http://www.yijiale78.com/article34/pjdose.html

成都網站建設公司_創新互聯,為您提供網站制作小程序開發網站營銷標簽優化網站內鏈網站收錄

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都做網站