sh 安装Ubuntu 16.04 LAMP
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 安装Ubuntu 16.04 LAMP相关的知识,希望对你有一定的参考价值。
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get upgrade
export LC_ALL=C
sudo apt-get install -y mysql-server
#esenciales
apt-get install -y build-essential
sudo apt-get -y install apache2 apache2-utils nano vim
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install software-properties-common
#Repositorio de php extra
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
#php7
sudo apt-get -y install curl php-cli php-mbstring git unzip
#composer
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
#extras php
sudo apt-get -y install php-mysql php-apcu php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext
sudo apt-get -y install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php-imagick php7.0-imap php7.0-mcrypt php-memcache php7.0-pspell php7.0-recode php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-mbstring php-gettext
sudo a2enconf php7.0-fpm
sudo apt-get install -y php7.0-fpm php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php-pear php7.0-imap php7.0-mcrypt php7.0-ps php7.0-pspell php7.0-recode php7.0-snmp php7.0-sqlite php7.0-tidy php7.0-xmlrpc php7.0-xsl
sudo apt-get install -y php7.1-fpm php7.1-mysql php7.1-curl php7.1-gd php7.0-intl php-pear php7.1-imap php7.1-mcrypt php7.1-ps php7.1-pspell php7.1-recode php7.1-snmp php7.1-sqlite php7.1-tidy php7.1-xmlrpc php7.1-xsl
sudo apt-get install -y php5.6-fpm php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php-pear php5.6-imap php5.6-mcrypt php5.6-ps php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite php5.6-tidy php5.6-xmlrpc php5.6-xsl
sudo apt-get install php-json php7.0-imap php7.0-json php7.0-gd
#php7.0 - server-side, HTML-embedded scripting language (metapackage)
sudo apt-get install -y php7.0-cgi # server-side, HTML-embedded scripting language (CGI binary)
sudo apt-get install -y php7.0-cli # command-line interpreter for the PHP scripting language
sudo apt-get install -y php7.0-common # documentation, examples and common module for PHP
sudo apt-get install -y php7.0-curl # CURL module for PHP
sudo apt-get install -y php7.0-dev # Files for PHP7.0 module development
sudo apt-get install -y php7.0-gd # GD module for PHP
sudo apt-get install -y php7.0-gmp # GMP module for PHP
sudo apt-get install -y php7.0-json # JSON module for PHP
sudo apt-get install -y php7.0-ldap # LDAP module for PHP
sudo apt-get install -y php7.0-mysql # MySQL module for PHP
sudo apt-get install -y php7.0-odbc # ODBC module for PHP
sudo apt-get install -y php7.0-opcache # Zend OpCache module for PHP
sudo apt-get install -y php7.0-pgsql # PostgreSQL module for PHP
sudo apt-get install -y php7.0-pspell # pspell module for PHP
sudo apt-get install -y php7.0-readline # readline module for PHP
sudo apt-get install -y php7.0-recode # recode module for PHP
sudo apt-get install -y php7.0-snmp # SNMP module for PHP
sudo apt-get install -y php7.0-sqlite3 # SQLite3 module for PHP
sudo apt-get install -y php7.0-tidy # tidy module for PHP
sudo apt-get install -y php7.0-xml # DOM, SimpleXML, WDDX, XML, and XSL module for PHP
sudo apt-get install -y php7.0-xmlrpc # XMLRPC-EPI module for PHP
sudo apt-get install -y libphp7.0-embed # HTML-embedded scripting language (Embedded SAPI library)
sudo apt-get install -y php7.0-bcmath # Bcmath module for PHP
sudo apt-get install -y php7.0-bz2 #bzip2 module for PHP
sudo apt-get install -y php7.0-enchant # Enchant module for PHP
sudo apt-get install -y php7.0-fpm
sudo apt-get install -y php7.0-imap
sudo apt-get install -y php7.0-interbase
sudo apt-get install -y php7.0-intl
sudo apt-get install -y php7.0-mbstring
sudo apt-get install -y php7.0-mcrypt
sudo apt-get install -y php7.0-phpdbg
sudo apt-get install -y php7.0-soap
sudo apt-get install -y php7.0-sybase
sudo apt-get install -y php7.0-xsl
sudo apt-get install -y php7.0-zip
sudo apt-get install -y php7.0-dba
sudo apt-get -y install php-soap php-curl
sudo apt-get -y install php7.0 libapache2-mod-php7.0 libapache2-mod-php
sudo apt-get install -y php7.1-cgi # server-side, HTML-embedded scripting language (CGI binary)
sudo apt-get install -y php7.1-cli # command-line interpreter for the PHP scripting language
sudo apt-get install -y php7.1-common # documentation, examples and common module for PHP
sudo apt-get install -y php7.1-curl # CURL module for PHP
sudo apt-get install -y php7.1-dev # Files for PHP7.1 module development
sudo apt-get install -y php7.1-gd # GD module for PHP
sudo apt-get install -y php7.1-gmp # GMP module for PHP
sudo apt-get install -y php7.1-json # JSON module for PHP
sudo apt-get install -y php7.1-ldap # LDAP module for PHP
sudo apt-get install -y php7.1-mysql # MySQL module for PHP
sudo apt-get install -y php7.1-odbc # ODBC module for PHP
sudo apt-get install -y php7.1-opcache # Zend OpCache module for PHP
sudo apt-get install -y php7.1-pgsql # PostgreSQL module for PHP
sudo apt-get install -y php7.1-pspell # pspell module for PHP
sudo apt-get install -y php7.1-readline # readline module for PHP
sudo apt-get install -y php7.1-recode # recode module for PHP
sudo apt-get install -y php7.1-snmp # SNMP module for PHP
sudo apt-get install -y php7.1-sqlite3 # SQLite3 module for PHP
sudo apt-get install -y php7.1-tidy # tidy module for PHP
sudo apt-get install -y php7.1-xml # DOM, SimpleXML, WDDX, XML, and XSL module for PHP
sudo apt-get install -y php7.1-xmlrpc # XMLRPC-EPI module for PHP
sudo apt-get install -y libphp7.1-embed # HTML-embedded scripting language (Embedded SAPI library)
sudo apt-get install -y php7.1-bcmath # Bcmath module for PHP
sudo apt-get install -y php7.1-bz2 #bzip2 module for PHP
sudo apt-get install -y php7.1-enchant # Enchant module for PHP
sudo apt-get install -y php7.1-fpm
sudo apt-get install -y php7.1-imap
sudo apt-get install -y php7.1-interbase
sudo apt-get install -y php7.1-intl
sudo apt-get install -y php7.1-mbstring
sudo apt-get install -y php7.1-mcrypt
sudo apt-get install -y php7.1-phpdbg
sudo apt-get install -y php7.1-soap
sudo apt-get install -y php7.1-sybase
sudo apt-get install -y php7.1-xsl
sudo apt-get install -y php7.1-zip
sudo apt-get install -y php7.1-dba
sudo apt-get -y install php-soap php-curl
sudo apt-get -y install php7.1 libapache2-mod-php7.1 libapache2-mod-php
sudo a2enmod proxy_fcgi setenvif
sudo a2enmod rewrite
sudo a2dismod worker #arreglo vagrant
sudo apt-get -y install sendmail
#Reniciar apache
sudo service apache2 restart
#mongo DB
sudo apt-get install -y mongodb
#phpmyadmin
sudo apt-get -y install phpmyadmin
#echo "update user set plugin='' where User='root'; flush privileges;" | mysql -u root -p mysql
#pip python
sudo apt-get install -y python3-pip
sudo apt-get install -y python-pip
pip install --upgrade pip
sudo pip3 install -y pymongo
#postgre SQL
sudo apt-get -y install postgresql postgresql-contrib
#reiniciar
sudo service apache2 restart
#FTP
sudo apt-get install -y proftpd-basic proftpd-mod-mysql
#ajuste para mysql remoto
sudo iptables -A INPUT -i eth0 -p tcp -m tcp --dport=3306 -j ACCEPT
sudo ufw allow 3306
#instalar auto virtualhost
cd /usr/local/bin
sudo wget -O virtualhost https://raw.githubusercontent.com/RoverWire/virtualhost/master/virtualhost.sh
sudo chmod +x virtualhost
#sqlite
sudo apt-get install -y sqlite
#clean
apt-get -y autoremove
#xdebug
sudo apt-get -y install php7-dev
sudo apt-get install php7-xdebug
#open ssh
sudo apt-get -y install openssh-server
#mariaDB
#sudo apt-get install -y mariadb-server mariadb-client
#Ajustes MySQL
sudo /usr/bin/mysqladmin -u root password 'federico'
sudo mysql -u root -pfederico -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'federico' WITH GRANT OPTION; FLUSH PRIVILEGES;"
sudo mysql -u root -pfederico -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY 'federico' WITH GRANT OPTION; FLUSH PRIVILEGES;"
sudo mysql -u root -pfederico -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.10.10.10' IDENTIFIED BY 'federico' WITH GRANT OPTION; FLUSH PRIVILEGES;"
sudo mysql -u root -pfederico -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'federico' WITH GRANT OPTION; FLUSH PRIVILEGES;"
sudo mysql -u root -pfederico -e "DROP USER ''@'localhost';"
sudo mysql -u root -pfederico -e "DROP USER ''@'$(hostname)';"
sudo /etc/init.d/mysql restart
sudo apt-get -y install php-xdebug
sudo apt-get -y install xclip
#configurar php.ini
#sudo mv /etc/php/7.0/apache2/php.ini /etc/php/7.0/apache2/php.ini.back
#cd /etc/php/7.0/apache2
#sudo wget -O php.ini https://gist.githubusercontent.com/rodrigobertin/60337d506d225dc659970106580bb714/raw/dba16d956c712b498272487d99ef7e4b4b22d49a/php.ini
#sudo chmod +x php.ini
#xdebug configurar
#sudo mv /etc/php/7.0/mods-available/xdebug.ini /etc/php/7.0/mods-available/xdebug.ini.back
#cd /etc/php/7.0/mods-available/
#sudo wget -O xdebug.ini https://gist.githubusercontent.com/rodrigobertin/72e1b432af1490c04142f5a45ae5ee7f/raw/7886701acf08f0cc1ccef849ffd3655807f99cfd/xdebug.ini
sudo service apache2 restart
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y upgrade
export LC_ALL=C
#esenciales
sudo apt-get install -y build-essential
sudo apt-get -y install nano vim htop
sudo locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#sudo add-apt-repository ppa:ondrej/php
sudo apt-get install software-properties-common
#php7
sudo apt-get -y install curl git unzip
echo "-------------> PHP 7.2"
sudo apt-get -y install php7.2-sqlite
sudo apt-get -y install php7.2-cli php7.2-mbstring php7.2-apcu php7.2-mysql php7.2-curl php7.2-gd php7.2-intl php7.2-imagick php7.2-imap php7.2-mcrypt php7.2-memcache php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-mbstring php7.2-gettext
sudo apt-get -y install php7.2-mysql php7.2-curl php7.2-gd php7.2-intl php7.2-pear php7.2-imagick php7.2-imap php7.2-mcrypt php7.2-memcache php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php7.2-mbstring php7.2-gettext
sudo apt-get install -y php7.2-fpm php7.2-mysql php7.2-curl php7.2-gd php7.2-intl php7.2-pear php7.2-imap php7.2-mcrypt php7.2-ps php7.2-pspell php7.2-recode php7.2-snmp php7.2-sqlite php7.2-tidy php7.2-xmlrpc php7.2-xsl
sudo apt-get install php7.2-json php7.2-imap php7.2-json php7.2-gd
sudo apt-get install -y php7.2-cgi # server-side, HTML-embedded scripting language (CGI binary)
sudo apt-get install -y php7.2-cli # command-line interpreter for the PHP scripting language
sudo apt-get install -y php7.2-common # documentation, examples and common module for PHP
sudo apt-get install -y php7.2-curl # CURL module for PHP
sudo apt-get install -y php7.2-dev # Files for PHP7.2 module development
sudo apt-get install -y php7.2-gd # GD module for PHP
sudo apt-get install -y php7.2-gmp # GMP module for PHP
sudo apt-get install -y php7.2-json # JSON module for PHP
sudo apt-get install -y php7.2-ldap # LDAP module for PHP
sudo apt-get install -y php7.2-mysql # MySQL module for PHP
sudo apt-get install -y php7.2-odbc # ODBC module for PHP
sudo apt-get install -y php7.2-opcache # Zend OpCache module for PHP
sudo apt-get install -y php7.2-pgsql # PostgreSQL module for PHP
sudo apt-get install -y php7.2-pspell # pspell module for PHP
sudo apt-get install -y php7.2-readline # readline module for PHP
sudo apt-get install -y php7.2-recode # recode module for PHP
sudo apt-get install -y php7.2-snmp # SNMP module for PHP
sudo apt-get install -y php7.2-sqlite3 # SQLite3 module for PHP
sudo apt-get install -y php7.2-tidy # tidy module for PHP
sudo apt-get install -y php7.2-xml # DOM, SimpleXML, WDDX, XML, and XSL module for PHP
sudo apt-get install -y php7.2-xmlrpc # XMLRPC-EPI module for PHP
sudo apt-get install -y libphp7.2-embed # HTML-embedded scripting language (Embedded SAPI library)
sudo apt-get install -y php7.2-bcmath # Bcmath module for PHP
sudo apt-get install -y php7.2-bz2 #bzip2 module for PHP
sudo apt-get install -y php7.2-enchant # Enchant module for PHP
sudo apt-get install -y php7.2-fpm
sudo apt-get install -y php7.2-imap
sudo apt-get install -y php7.2-interbase
sudo apt-get install -y php7.2-intl
sudo apt-get install -y php7.2-mbstring
sudo apt-get install -y php7.2-mcrypt
sudo apt-get install -y php7.2-phpdbg
sudo apt-get install -y php7.2-soap
sudo apt-get install -y php7.2-sybase
sudo apt-get install -y php7.2-xsl
sudo apt-get install -y php7.2-zip
sudo apt-get install -y php7.2-dba
sudo apt-get -y install php7.2-soap php7.2-curl
echo "-------------> PHP 5.6"
sudo apt-get -y install php5.6-sqlite
sudo apt-get -y install php5.6-cli php5.6-mbstring php5.6-apcu php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php5.6-imagick php5.6-imap php5.6-mcrypt php5.6-memcache php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-mbstring php5.6-gettext
sudo apt-get -y install php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php5.6-pear php5.6-imagick php5.6-imap php5.6-mcrypt php5.6-memcache php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-mbstring php5.6-gettext
sudo apt-get install -y php5.6-fpm php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php5.6-pear php5.6-imap php5.6-mcrypt php5.6-ps php5.6-pspell php5.6-recode php5.6-snmp php5.6-sqlite php5.6-tidy php5.6-xmlrpc php5.6-xsl
sudo apt-get install php5.6-json php5.6-imap php5.6-json php5.6-gd
sudo apt-get install -y php5.6-cgi # server-side, HTML-embedded scripting language (CGI binary)
sudo apt-get install -y php5.6-cli # command-line interpreter for the PHP scripting language
sudo apt-get install -y php5.6-common # documentation, examples and common module for PHP
sudo apt-get install -y php5.6-curl # CURL module for PHP
sudo apt-get install -y php5.6-dev # Files for PHP5.6 module development
sudo apt-get install -y php5.6-gd # GD module for PHP
sudo apt-get install -y php5.6-gmp # GMP module for PHP
sudo apt-get install -y php5.6-json # JSON module for PHP
sudo apt-get install -y php5.6-ldap # LDAP module for PHP
sudo apt-get install -y php5.6-mysql # MySQL module for PHP
sudo apt-get install -y php5.6-odbc # ODBC module for PHP
sudo apt-get install -y php5.6-opcache # Zend OpCache module for PHP
sudo apt-get install -y php5.6-pgsql # PostgreSQL module for PHP
sudo apt-get install -y php5.6-pspell # pspell module for PHP
sudo apt-get install -y php5.6-readline # readline module for PHP
sudo apt-get install -y php5.6-recode # recode module for PHP
sudo apt-get install -y php5.6-snmp # SNMP module for PHP
sudo apt-get install -y php5.6-sqlite3 # SQLite3 module for PHP
sudo apt-get install -y php5.6-tidy # tidy module for PHP
sudo apt-get install -y php5.6-xml # DOM, SimpleXML, WDDX, XML, and XSL module for PHP
sudo apt-get install -y php5.6-xmlrpc # XMLRPC-EPI module for PHP
sudo apt-get install -y libphp5.6-embed # HTML-embedded scripting language (Embedded SAPI library)
sudo apt-get install -y php5.6-bcmath # Bcmath module for PHP
sudo apt-get install -y php5.6-bz2 #bzip2 module for PHP
sudo apt-get install -y php5.6-enchant # Enchant module for PHP
sudo apt-get install -y php5.6-fpm
sudo apt-get install -y php5.6-imap
sudo apt-get install -y php5.6-interbase
sudo apt-get install -y php5.6-intl
sudo apt-get install -y php5.6-mbstring
sudo apt-get install -y php5.6-mcrypt
sudo apt-get install -y php5.6-phpdbg
sudo apt-get install -y php5.6-soap
sudo apt-get install -y php5.6-sybase
sudo apt-get install -y php5.6-xsl
sudo apt-get install -y php5.6-zip
sudo apt-get install -y php5.6-dba
sudo apt-get -y install php5.6-soap php5.6-curl
#composer
sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
echo "---------->SendMail"
# sudo apt-get -y install sendmail
echo "----------> Python"
pyton -V
echo "----------------->"
sudo apt-get -y install virtualenv
#sudo apt-get install -y python3-pip
#sudo apt-get install -y python-pip
# pip install --upgrade pip
echo "----------> FTP"
sudo apt-get install -y proftpd-basic proftpd-mod-mysql
#ajuste para mysql remoto
sudo ufw allow 3306
ufw allow 44200
ufw allow 80
#composer
sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
#sqlite
sudo apt-get install -y sqlite
#clean
apt-get -y autoremove
#open ssh
sudo apt-get -y install openssh-server
以上是关于sh 安装Ubuntu 16.04 LAMP的主要内容,如果未能解决你的问题,请参考以下文章
sh 在Ubuntu 16.04中,Lamp堆栈,sublime,appache2配置更改,wp cli安装,节点安装