最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ubuntu安装php nginx mysql mongodb redis的教程
时间:2022-06-30 19:14:38 编辑:袖梨 来源:一聚教程网
ubuntu apt-get安装软件:
1、安装php:
apt-get install python-software-properties
apt-get install -y ppa-purge
add-apt-repository ppa:ondrej/php5
apt-get update
apt-get install php5-fpm php5-gd php5-cli php5-redis php5-mongo php5-curl php5-mysqlnd php5-bcmath php5-mcrypt php5-dev
2、安装nginx:
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx
3、安装mysql:
add-apt-repository 'deb http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu precise main'
apt-get install mysql-server-5.6
mysql_install_db --user=mysql --basedir=/usr --datadir=/data/mysql/var/
service mysql start
如果在安装过程中,遇到如下错误:
ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
解决办法:
mysql -uroot -p
执行:GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'your password';
并修改/etc/mysql/debian.cnf 内容如下:
[client]
host = localhost
user = debian-sys-maint
password =
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password =
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
4、安装redis:
add-apt-repository -y ppa:rwky/redis
apt-get update
apt-get install redis
5、mongodb安装:
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
apt-get update
apt-get install -y mongodb-org
6、解决shell脚本运行报错:
Syntax error: "(" unexpected
解决办法:
dpkg-reconfigure dash
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22