ubuntu安裝php nginx mysql mongodb redis的教程

來源:互聯網
上載者:User


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 = <you password>
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = <you 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
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.