Last active
April 15, 2021 04:52
-
-
Save fasthold/6026926 to your computer and use it in GitHub Desktop.
装好ubuntu server后的那些事
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 请注意修改部分参数,如安装mysql-server时,设置 MySQL root 密码,以便自动安装 | |
# System related | |
sudo apt-get update | |
sudo apt-get -y install build-essential ssh curl software-properties-common python-software-properties python g++ make | |
# Editor | |
sudo apt-get -y install vim | |
# VCS | |
sudo apt-get -y install subversion git | |
# LAMP | |
sudo apt-get -y install apache2 | |
#sudo apt-get install mysql-server | |
# Install mysql-server and set the mysql root password | |
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password your_password' | |
sudo debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password your_password' | |
sudo apt-get -y install mysql-server | |
sudo apt-get -y install php5 php5-cli php5-gd php5-curl php5-mysql php5-xmlrpc libmcrypt-dev mcrypt php5-mcrypt libgd-tools libapache2-mod-php5 php5-imagick | |
# xdebug is only needed in development environment | |
#sudo apt-get -y install php5-xdebug | |
# Enable apache modules | |
sudo a2enmod rewrite | |
sudo a2enmod proxy | |
sudo a2enmod proxy_http | |
sudo a2enmod proxy_balancer | |
sudo apache2ctl restart | |
# Apps | |
sudo apt-get -y install imagemagick | |
# Install Composer | |
mkdir ~/installations | |
cd ~/installations | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar /usr/local/bin/composer | |
# Node.js | |
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
# Optional: install Fish shell | |
#sudo apt-add-repository -y ppa:fish-shell/release-2 | |
#sudo apt-get update | |
#sudo apt-get -y install fish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 请注意修改部分参数,如安装mysql-server时,设置 MySQL root 密码,以便自动安装 | |
# System related | |
sudo apt-get update | |
sudo apt-get -y install build-essential ssh curl software-properties-common python-software-properties python g++ make | |
# Editor | |
sudo apt-get -y install vim | |
# VCS | |
sudo apt-get -y install subversion git | |
# LAMP | |
sudo apt-get -y install apache2 | |
#sudo apt-get install mysql-server | |
# Install mysql-server and set the mysql root password | |
sudo debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password password your_password' | |
sudo debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password_again password your_password' | |
sudo apt-get -y install mysql-server | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt install -y php7.2 php7.2-curl php7.2-gmp php7.2-intl php7.2-mbstring php7.2-opcache php7.2-pspell php7.2-xmlrpc php7.2-cli php7.2-imap php7.2-json php7.2-mysql php7.2-tidy php7.2-bz2 php7.2-common php7.2-dev php7.2-gd php7.2-ldap php7.2-sqlite3 php7.2-xml php7.2-zip php7.2-bcmath | |
# Enable apache modules | |
sudo a2enmod rewrite | |
sudo a2enmod proxy | |
sudo a2enmod proxy_http | |
sudo a2enmod proxy_balancer | |
sudo apache2ctl restart | |
# Apps | |
sudo apt-get -y install imagemagick | |
# Install Composer | |
mkdir ~/installations | |
cd ~/installations | |
curl -sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composer | |
# Node.js | |
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - | |
sudo apt-get install -y nodejs | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install build-essential ssh curl software-properties-common python g++ make | |
sudo apt-get -y install vim | |
sudo apt-get -y install subversion git | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt install -y php7.2 php7.2-curl php7.2-gmp php7.2-intl php7.2-mbstring php7.2-opcache php7.2-pspell php7.2-xmlrpc php7.2-cli php7.2-imap php7.2-json php7.2-mysql php7.2-tidy php7.2-bz2 php7.2-common php7.2-dev php7.2-gd php7.2-ldap php7.2-sqlite3 php7.2-xml php7.2-zip php7.2-bcmath | |
sudo a2enmod rewrite | |
sudo a2enmod proxy | |
sudo a2enmod proxy_http | |
sudo a2enmod proxy_balancer | |
sudo serivice apache2 restart | |
# Install mysql-server and set the mysql root password | |
sudo debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password password your_password' | |
sudo debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password_again password your_password' | |
sudo apt-get -y install mysql-server mysql-client | |
# Enable remote connect | |
#sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf | |
# comment the line with text '127.0.0.1' | |
#Add a remote user | |
# grant all on *.* to remote_user@'%' identified by 'your_password' with grant option; | |
sudo service mysql start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 20.04 版本安装时就可以设置软件源,所以不再需要后面手动改了 | |
# 阿里云源: | |
sudo apt install build-essential ssh curl software-properties-common python g++ make | |
sudo apt-get -y install subversion git | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt install -y php7.4 php7.4-curl php7.4-gmp php7.4-intl php7.4-mbstring php7.4-opcache php7.4-pspell php7.4-xmlrpc php7.4-cli php7.4-imap php7.4-json php7.4-mysql php7.4-tidy php7.4-bz2 php7.4-common php7.4-dev php7.4-gd php7.4-xml php7.4-zip php7.4-bcmath | |
sudo a2enmod rewrite | |
sudo a2enmod proxy | |
sudo a2enmod proxy_http | |
sudo a2enmod proxy_balancer | |
sudo serivice apache2 restart | |
# Install mysql-server and set the mysql root password | |
#sudo debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password password your_password' | |
#sudo debconf-set-selections <<< 'mysql-server-5.7 mysql-server/root_password_again password your_password' | |
sudo apt-get install mysql-server mysql-client | |
# Enable remote connect | |
#sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf | |
# comment the line with text '127.0.0.1' | |
#Add a remote user | |
# grant all on *.* to remote_user@'%' identified by 'your_password' with grant option; | |
sudo service mysql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment