linux Basic Configuration
linux environment compiler installation python3 1 way to install the software under. Linux - choice yum utility, convenience, resolve dependencies between the software itself and automatically download and install a configuration yum source (that is, a depot, which put a bunch. rpm package) can choose to Ali cloud sources, Tsinghua yum source configuration of a warehouse, there are a lot of system software used wget -O /etc/yum.repos.d/CentOS-Base.repo HTTP: //mirrors.aliyun. COM / repo / Centos-7 .repo have to configure a second warehouse, carrying a large number of third-party software (nginx, redis, mongodb, mairadb etc.) wget -O /etc/yum.repos.d/epel.repo HTTP: / /mirrors.aliyun.com/repo/epel-7 .repo 2 . you have to understand yum repository directory cd /etc/yum.repos.d/ # will be asked to identify a yum repo file in this directory first layer warehouse 3Empty the cache yum, yum empty centos official software cache yum Clean All 4 generates a new cache Ali cloud yum. Yum makecache - wget url command in a resource of -apt- GET Ubuntu under the yum - use yum repository, not only You can use third-party warehouse yum, yum, or you can specify an official source (like yum official source mariadb database, the latest software packages) - RPM manual installation, you have to deal with dependency - the freedom to choose the version, and install third-party functionality can be extended way, called source code to compile and install
View-dependent module
Freeze PIP3> requirements.txt # This file is the module requirements.txt python programmers know dependencies
The first step Starting mariadb database
-
Yum configuration source
1 .yum configuration source yum yum install MariaDB -server MariaDB - the y- 2 . Yum install the software, how to start systemctl Start MariaDB # systemctl Start / STOP / Status / restart MariaDB 3 . Log database cmd Login
-
Export windows of the database, to import linux machine
cmd Log Export command mysqldump -uroot--p se_crm> se_crm.sql # specify the database export to se_crm.sql this data file transfer to linux, the import simple tool use lrzsz transfer or download xftp tool to import data command mariadb install yum MariaDB install - Server : mode 1 1 to create a se_crm database. ; the create database se_crm # command to import data in MySQL-uroot-se_crm -p </opt/se_crm.sql # specify se_crm database, import a sql file : mode 2 after landing database import data command 1 creates a database se_crm. Create database se_crm; 2 . switching database use se_crm; . 3 . sql read files, write data sets mareiadb> source /opt/se_crm.sql;
Step 2: Prepare python3 environments, and virtual environments
- Compile and install python3, address environmental variable
way centos7 compiled installation of python3
1 must compile the necessary infrastructure to solve development environment yum install gcc Patch libffi -devel Python-devel zlib-devel bzip2-devel OpenSSL-devel ncurses-devel SQLite-devel readline-devel tk-devel gdbm-devel-devel libpcap- DB4 an xz-devel devel - Y 2 . python3 download compiled code package is decompressed wget HTTPS: //www.python.org/ftp/python/3.6.7/Python-3.6.7 .tar.xz an xz -d-the Python 3.6 .7 .tar.xz the tar -xf the Python-3.6.7 .tar . 4 . into the generated source code decompressed folder CD the Python -3.6.7 . 5 compile trilogy command first track: to find a [arranged executable files, configure], execute it, and specify the location to install the software ./ configure --prefix = / opt / python367 / second curved: in the previous step, will generate a Makefile, compiler installation, must be used to compile gcc tool in linux, command used the make the make the third song: This step is the installation, it generates a / opt / python367 folder, available interpreter are here the make the install . 6 . configure the environment variables, facilitating fast use python3 . 1 . to get the current PATH variable, then python3 bin directory added to the list $ PATH echo / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / the root / bin: / the root / bin 2 . permanently modify the value of PATH - first a soft connection - directly modify / etc / profile, system-wide configuration files, each user login system, that they will load the file vim / etc / profile write the new PATH variable PATH = "/ opt / python367 / bin: / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin: / root / bin " 3. have to re-visit, or manually read the / etc / Profile Source / etc / Profile # make the file variables to take effect
- Download virtualenvwrapper tool
virtualenvwrapper, an upgraded version of the virtual environment tool
1 . Installation, do not activate the virtual environment PIP3 install -i https://pypi.douban.com/ the Simple virtualenvwrapper 2 . Modifying the configuration file, every time you turn on the tool load virtualenvwrapper 1 Open a personal user profile environment variables globally configuration file / etc / profile # each user login take effect the user's personal configuration file ~ / .bash_profile vim ~ / .bash_profile # root landing time, the code reads this file 2 . fill in the following information for you their environmental modification python Export WORKON_HOME = ~ / Envs that # set virtualenv unified management directory Export VIRTUALENVWRAPPER_VIRTUALENV_ARGS = ' --no-Site-Packages ' # add parameters virtualenvwrapper generate a clean environment isolated VIRTUALENVWRAPPER_PYTHON = Export / opt / python367 / bin / python3.6 # Specifies the python interpreter Source /opt/python367/bin/virtualenvwrapper.sh # execute the installation script virtualenvwrapper 3 . At this point you can use this tool to quickly create a virtual environment mkvirtualenv virtual environmental name # to create a virtual environment lsvirtualenv # listed in the virtual environment name workon virtual environment name # activate or switch virtual environment lssitepackages # listed in the module information in a virtual environment, in fact, cdvirtualenv # to enter the virtual environment home directory cdsitepackages # to enter the virtual environment first tripartite module directory
- Use mkvirtualenv command to create a new virtual environment for start crm
mkvirtualenv s23_crm
- Crm copy code into machine linux
rz # talk about crm project archive onto Linux,
# decompression - Crm needed to solve the operation depend on the environment, django modules, and pymysql
Solution 1: awkward, one error to see, to solve PIP3 install -i https://pypi.douban.com/simple Django == 1.11.23 PIP3 install -i https://pypi.douban.com/ pymysql the Simple PIP3 install -i https://pypi.douban.com/simple django- multiselectfield PIP3 install -i https://pypi.douban.com/simple Django == 1.11.23 not stupid approach: export python interpreter command module PIP3 Freeze > requirements.txt # this file is the module requirements.txt python programmers know the dependencies to install the file requirements.txt all modules PIP3 install -r requirements.txt # specify dependencies to install, read All modules take the information file