18th common Software Installation and usage guide in Linux environment

Source: Internet
Author: User
Tags install openssl virtual environment virtualenv

Reminder: If you want to install Virtualenvwrapper later, you can jump to the method of installing Virtualenvwrapper without having to install the Virtualenv installation virtualenv and build the virtual environment first.
    • Installing virtualenv:yum-y Install Python-virtualenv
    • To build a virtual environment:
    • Switch to the directory under which you want to generate the virtual environment
    • Generate Python2 Virtual Environment: VIRTUALENV Virtual Environment name, for example: Virtualenv test_py2
    • Build Python3 Virtual Environment: Virtualenv-p Python3 's installation directory virtual environment name, for example: Virtualenv-p/usr/local/bin/python3.6 test_py3
    • To start the virtual environment:
    • Switch to the bin directory first: CD Test_py2/bin or CD Test_py3/bin
    • To start a virtual environment using the source command: source Activate
    • Exiting the virtual environment: deactivate
Quickly start a virtual environment (install virtualenvwrapper)
    • Installing Vitualenvwrapper:pip install-i Https://pypi.douban.com/simple/virtualenvwrapper
    • Use the Find command to find the location of virtualenvwrapper.sh: Find/-name=virtualenvwrapper.sh
    • Locate the following path:/usr/local/bin/virtualenvwrapper.sh
    • Configure the. bashrc file: Vim ~/.BASHRC
    • Add the following 3 items:
    • Export Workon_home= $HOME/.virtualenvs
    • Export Virtualenvwrapper_python=/usr/bin/python3
    • source/usr/local/bin/virtualenvwrapper.sh
    • Save exit
    • Refresh the configuration file so that the configuration takes effect: source ~/.BASHRC
    • Recommended ways to generate a virtual environment:
    • Build Python3 Virtual Environment: mkvirtualenv-p/usr/bin/python3 Virtual Environment name
    • Build python2 Virtual Environment: mkvirtualenv-p/usr/bin/python2 Virtual Environment name
    • All virtual environments are installed by default in the directory: ~/.virutalenvs
    • View all virtual environments installed under the current system: Workon
    • Fast access to the specified name of the virtual environment: Workon Virtual Environment name
    • Quickly turn off virtual environments: Deactivate
Installing Python3.6
    • Installation Environment Dependency Package: Yum-y Install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
    • Ways to remotely copy files from local to server: SCP python-3.6.1.tgz [Email protected]:/root/
    • Unpacking: TAR-ZXF python-3.6.1.tgz
    • Directory after unpacking: CD PYTHON-3.6.1/
    • Check the configuration and specify the installation directory:./configure--prefix=/usr/local/
    • You may be prompted to install the GCC compiler without the GCC compiler: yum-y install gcc gcc-c++
    • Perform the check configuration again and specify the installation directory:./configure--prefix=/usr/local/
    • Compile and install: Make && make install
    • Installation Complete
    • python3.6 was eventually installed in the/usr/local/bin/
    • Switch to/usr/bin
    • To create a soft connection: Ln-s/usr/local/bin/python3.6/usr/bin/python3
    • The python file used in the production environment needs to be added at the beginning: #!/usr/bin/python3 Specify interpreter

Installing Pycharm
    • Find a downloaded installation package in a Windows-ready environment
    • Send the installation package to Linux: SCP pycharm-professional-2018.1.4.tar.gz [Email protected]:/root/downloads
    • Decompression: TAR-ZXF pycharm-professional-2018.1.4.tar.gz
    • Place the extracted files under the/opt directory: MV pycharm-professional-2018.1.4/opt/
    • Switch to/opt:cd/opt
    • Enter PYCHARM-PROFESSIONAL-2018.1.4:CD pycharm-professional-2018.1.4
    • Go to Bin directory: CD bin
    • Start pycharm:./pycharm.sh
Quick Start Pycharm
    • Edit configuration file: Vim ~/.BASHRC
    • The shortcut key shift+g to the last line, inserting the following: alias pycharm= "bash/opt/pycharm-2018.1.4/bin/pycharm.sh"
    • Run the source command to make the configuration file effective: source ~/.BASHRC
    • Then enter Pycharm directly to start the pycharm quickly.

Installing Nginx
    • Install software dependency Package: yum-y install gcc gcc-c++ openssl-devel pcre-devel httpd-tools
    • Unpacking: TAR-ZXF nginx-1.12.0.tar.gz
    • CD nginx-1.12.0/
    • Create Nginx User: Useradd nginx
    • Configuration check and specify the installation directory:./configure--prefix=/usr/local/nginx--user=nginx--group=nginx--with-http_ssl_module--with-http_mp4 _module--with-http_flv_module
    • Compiling: Make
    • Install: Make install #注: Make && make install install directly
    • To create a soft connection: Ln-s/usr/local/nginx/sbin/nginx/usr/sbin/
    • Start Nginx Service: Nginx
    • To view Nginx operating port number: NETSTAT-ANPTU | grep nginx
    • Stop Nginx service: nginx-s stop

installing MARIADB (mysql)
    • Yum-y Install Mariadb-server
    • Start database: Systemctl start Mariadb.service
    • Set boot up: Systemctl enable Mariadb.service
    • Modify database server password: mysqladmin-uroot password "root"
    • Log on to the database server: Mysql-uroot-proot
    • \s View database Server Basic Configuration
    • \q exiting the database server
    • Modify MySQL configuration file: vim/etc/my.cnf
    • Modify the character encoding in the configuration file to Utf8:character-set-server=utf8
    • Restart database server: Systemctl restart Mariadb.service
Create a database and import data
    • Log on to the database server: Mysql-uroot-proot
    • Creating a database: Create DB movie; (Note semicolon)
    • Enter the created database: Use movie;
    • Import data: Source/root/desktop/movie.sql;
    • View tables in the database: show tables;
    • s delete a database: Drop DB Jie;

install dependency packages with dependencies specified by TXT file
    • Pip install-i https://pypi.douban.com/simple/--trusted-host pypi.douban.com-r req.txt

18th common Software Installation and usage guide in Linux environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.