Since Alibaba Cloud's import of custom Ubuntu images requires activation of OSS snapshots, which is charged (it doesn't seem expensive, but it's also very troublesome), and the image you have configured needs to be converted to a different format if you want to import it, and there may be cases where it cannot be used, so it's a bit troublesome to directly configure the required content in Alibaba Cloud's original Ubuntu. First of all, the default version of Ubuntu on Alibaba Cloud Server is 14.04. You need to log in to Alibaba, enter the console-ESC instance-Management-Pause server-Update system disk (more options in the configuration information block)-Public image-here I choose 64-bit Ubuntu 16.04 (currently the highest version of Alibaba Cloud public image is Ubuntu 16.04). 0. Install sudo apt-get install sudo 1. Set up users Create User Set password # After completion, there will be an additional directory named after the user in the home directory Set root permissions for ordinary users Get write permission to sudoers (Some basic operations of VIM: i switches input mode, esc switches command mode, and in command mode, enter :wq to save and exit) Enter VIM Add this code below the root line, save and exit UsernameALL=(ALL) ALL Revoke sudoers write permissions 2. Download python3.x (download it if you need a higher version) Ubuntu 16.04 comes with python 2.7 and python 3.5.2. Here we will use 3.5.2. 3. Install and configure the virtual environment Download Package pip install virtualenv pip install virtualenvwrapper Then log in with the newly created user. Here I use Xshell5 Create a directory to store the virtual environment Install the directory where the virtual environment is stored (Here, in the /home/username directory, ls -a queries hidden files) Open the .bashrc file and add 2 lines of code export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh After saving and exiting, run source ~/.bashrc 4. Create a virtual environment with the default python3.x Query the Python path Return result: /usr/bin/python3.5 Create a new virtual environment mkvirtualenv -p python path virtual environment name Example: mkvirtualenv -p /usr/bin/python3.5 dj Automatically activate the virtual environment every time you start the virtual machine Every time the virtual machine is turned on, .bashrc will be run, so just edit .bashrc In the last line enter workon virtual environment name Example: workon dj -------------------------------------------------------------------------------- Note: The default Python in the virtual environment is 3.5.2, while the default Python outside the virtual environment is 2.7.12 Query Python version python -V Exit the virtual environment deactivate Enter the virtual environment workon virtual environment name View the existing virtual environment workon -------------------------------------------------------------------------------- Some content of Django configuration will be updated in the near future Summarize The above is the Alibaba Cloud Server Ubuntu configuration tutorial introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
>>: How to export CSV file with header in mysql
This article shares the installation of MySQL 5.7...
Add monitoring host Host 192.168.179.104 is added...
This article example shares the specific code of ...
Table of contents 1. Enter the network card confi...
Table of contents Brief Introduction setInterval ...
A considerable number of websites use digital pagi...
1 Introduction PostgreSQL is a free software obje...
Solution to mysql not closing: Right-click on the...
I was recently working on a project about face co...
Table of contents What is an agent Basic knowledg...
Table of contents Preface Summary of the principl...
MySQL can be connected not only through the netwo...
This article shares the specific code for the WeC...
1. Environment and related software Virtual Machi...
Docker takes up a lot of space. Whenever we run c...