Ubuntu服务器安装lamp
**
Apache2 web服務(wù)器的安裝:
sudo apt upgrade //更新系統(tǒng)軟件
sudo apt update //更新軟件
sudo apt autoremove //卸載不需要的舊的組件
sudo apt install apache2 //安裝apache2
sudo systemctl start apache2.service //開始apache2服務(wù)
sudo systemctl enable apache2.service
sudo systemctl status apache2.service //查看apache2服務(wù)狀態(tài)
如果你開啟了Ubuntu的防火墻(ufw),那么你可以使用如下的命令來解除web服務(wù)器的端口(80和443)限制
sudo ufw status //查看狀態(tài)
sudo ufw allow in ‘Apache Full’
數(shù)據(jù)庫服務(wù)器的安裝(MySQL Server 5.7):
apt install mysql-server mysql-client
設(shè)置密碼
sudo systemctl status mysql.service //查看mysql服務(wù)狀態(tài)
sudo service mysql restart //重啟mysql服務(wù)
PHP腳本語言的安裝:
sudo apt install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 //所有軟件
phpMyAdmin的安裝:
sudo apt install php-mbstring php7.0-mbstring php-gettext
sudo systemctl restart apache2.service
sudo apt install phpmyadmin
總結(jié)
1,如果不能解析php,就是apache配置文件有問題
2,需要到php配置文件php.in中修改 ;extension=php_mysql.dll,將注釋;去掉,如果已經(jīng)去掉可以忽略這一步;
3,配置mysql默認(rèn)字符集。在【client】添加default-set-character=utf8;在【mysqld】添加character-set-server=utf8;
總結(jié)
以上是生活随笔為你收集整理的Ubuntu服务器安装lamp的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 蚕蛹虫草的功效与作用、禁忌和食用方法
- 下一篇: 珍珠米的功效与作用、禁忌和食用方法