新しいサーバでnginx+python+supervisorを構成する

2997 ワード

新しいubuntuから構成を開始
1.新規ユーザーの追加
コマンドの使用#adduser bobo
Adding user 'second' ...
Adding new group 'second' (1001) ...
Adding new user 'second' (1001) with group 'second' ...
Creating home directory '/home/second' ...
Copying files from '/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for second
Enter the new value, or press ENTER for the default
    Full Name []: 
    Room Number []: 
    Work Phone []: 
    Home Phone []: 
    Other []: 
Is the information correct? [Y/n] y

/etc/sudoersではsudoに関する構成が表示され、boboをsudoグループに追加するとsudoを実行できます.#usermod -g sudo bobo
2.アリのソースを追加
バックアップ/etc/apt/sources.list
#cd /etc/apt
#mv sources.list sources.list.bak

新しいsourcesを作成します.List、次の内容を新しいファイルに書き込む
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

その後、#sudo apt updateを実行すると、ソフトウェアソースを正常に交換できます.
3.oh my zshのインストール
まず新しいユーザーboboに切り替えてログインします.その後$sudo apt install zsh gitにzshとgitをインストールし、完了したら以下のコマンドでohmyzshをインストールします.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

その後、/etc/passwd対応口座を変更した後の内容は、デフォルトshellをzshに変更できます.
4.python 3をインストールする.6,virtualenv,独立環境の構築
インストールzlib依存
apt-get install zlib1g-dev

python 36のインストール
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
xz -d Python-3.6.0.tar.xz
tar -xvf  Python-3.6.0.tar
cd Python-3.6.0
./configure
make
sudo make install

最初のコンパイルインストール後、python 3の入力が検出される可能性があります.6以降、方向キーが無効になります.readlineライブラリがインストールされていないためです.
解決方法:
readlineライブラリ$sudo apt-get install libreadline-devのインストール
インストール後、pythonを再コンパイルしてインストールします
cd Python-3.6.0
./configure
make
sudo make install

環境のpythonバージョンを指定します(3.6 zlibがなくて、とても瓜皮で、使いにくいです)
virtualenv python36 --python=python3.5