常用 开发服务搭建

常用 开发服务搭建





常用开发 服务搭建


java 1.8  jdk 安装

    # tar zxvf jdk-8u271-linux-x64.tar.gz -C /usr/local
    # ln -s /usr/local/jdk1.8.0_271 /usr/local/java
    # vim /etc/profile
        export JAVA_HOME=/usr/local/java
        export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib
        export PATH=$JAVA_HOME/bin:/usr/local/nginx/sbin:/usr/local/mysql/bin:$PATH
    # source /etc/profile
    # java -version                                                   \\ java version "1.8.0_271"

    注:
        jdk下载地址 https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html#license-lightbox
        k051535@work    Teo@1234


mvn 安装         需java环境  maven 3.6.3 下载地址 https://mirrors.cnnic.cn/apache/maven/

    # wget https://mirrors.cnnic.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz --no-check-certificate
    # tar zxf apache-maven-3.6.3-bin.tar.gz 
    # mv apache-maven-3.6.3 /usr/local/maven
    # ln -s /usr/local/maven/bin/mvn  /usr/bin/mvn
    # echo " ">>/etc/profile
    # echo "# Made for mvn env by zhaoshuai on $(date +%F)">>/etc/profile
    # echo 'export MAVEN_HOME=/usr/local/maven'>>/etc/profile
    # echo 'export PATH=$MAVEN_HOME/bin:$PATH'>>/etc/profile
    # tail -4 /etc/profile
    # source /etc/profile
    # echo $PATH
    # which mvn
    # mvn -version



mysql 5.7安装   yum安装           https://dev.mysql.com/downloads/repo/yum/ 官网yum源 可以去下载

    # wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
    # yum install mysql57-community-release-el7-10.noarch.rpm
    # yum install mysql-community-server
    # yum install mysql-devel
    # vim /etc/my.cnf
        max_connections=3600                   \\ 设置最大连接数3600
        wait_timeout=120                        \\ 等待时间
        interactive_timeout=300                  \\ 超时时间
    # systemctl restart mysqld
    # ss -tnl
    # grep "password" /var/log/mysqld.log            \\ 最后的是初始密码
    # mysql -uroot -p
        set global validate_password_policy=LOW;       \\ 安全等级低
        set global validate_password_length=6;          \\ 密码位数6
        alter user user() identified by "123456";        \\ 设置当前登录用户的密码
        grant all privileges on *.* to 'root'@'%' identified by '123456'   \\ 所有权限
        flush privileges;

        show global variables like '%CONNECTIONS%';               \\ 查看最大连接数
        show global variables like '%timeout%';                    \\ 查看超时时间


mysql 8.0安装   yum安装

    # wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
    # yum install mysql80-community-release-el7-3.noarch.rpm
    # yum install mysql-server
    # yum install mysql-devel
    # vim /etc/my.cnf
        max_connections=3600                   \\ 设置最大连接数3600
        wait_timeout=120                        \\ 等待时间
        interactive_timeout=300                  \\ 超时时间
    # systemctl restart mysqld
    # systemctl enable mysqld
    # grep "password" /var/log/mysqld.log             \\ 最后的是初始密码
    # mysql -uroot -p
        set global validate_password.policy=0;
        set global validate_password.length=1;
        CREATE USER 'root'@'%' IDENTIFIED BY '123456';                  \\ 给所有用户权限
        GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;     \\ 给所有用户权限

        show global variables like '%CONNECTIONS%';               \\ 查看最大连接数
        show global variables like '%timeout%';                    \\ 查看超时时间


php5.6 安装   yum安装

    # rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
    # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    # yum remove php-common                                                             \\ 移除系统自带的php-common
    # yum install php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
    # php -v                                                                               \\ 版本5.6
    # yum provides php-fpm    \\ 安装php-fpm,这里会提示多个安装源,选择5.6版本的安装就可以了
    # yum install php56w-fpm
    # systemctl restart php-fpm

    <?php  
        phpinfo();
    ?>

php7.0安装

    # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    # yum remove php-common
    # yum install -y php70w-devel php70w-pear php70w-pecl php70w-gd php70w-opcache php70w-cli php70w-pdo php70w-process php70w-pecl-apcu php70w-mcrypt php70w-mysql php70w-fpm php70w-pecl-memcached php70w-common php70w-xml php70w-mbstring php70w-pecl-igbinary
    # php -v
    # systemctl restart php-fpm


nginx安装   yum安装
    # cat > /etc/yum.repos.d/nginx1.repo <<-EOF
        [nginx-stable]
        name=nginx stable repo
        baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
        gpgcheck=1
        enabled=1
        gpgkey=https://nginx.org/keys/nginx_signing.key
        module_hotfixes=true
        EOF
    # yum install nginx
    # systemctl restart nginx


sentinel 安装
    # wget https://github.com/alibaba/Sentinel/releases/download/1.6.2/sentinel-dashboard-1.6.2.jar
    # mv sentinel-dashboard-1.6.2.jar /usr/local/sentinel-dashboard.jar
    # cd /usr/local/
    # java -Dserver.port=8849 -Dcsp.sentinel.dashboard.server=localhost:8849 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard.jar &

    http://172.21.34.80:8849/#/dashboard/home
        sentinel
        sentinel
    注:
        下载地址 https://github.com/alibaba/Sentinel/releases/


node 14.15 安装
    # wget https://cdn.npm.taobao.org/dist/node/v14.15.1/node-v14.15.1-linux-x64.tar.xz
    # tar xvf node-v14.15.1-linux-x64.tar.xz -C /usr/local
    # cd /usr/local
    # mv node-v14.15.1-linux-x64/ node-14.15.1
    # ln -s /usr/local/node-14.15.1/bin/npm /usr/local/bin/
    # ln -s /usr/local/node-14.15.1/bin/node /usr/local/bin/
    # node -v

    注: 
        官网下载地址 http://nodejs.cn/download/


node 12 yum 安装
    # curl -sL https://rpm.nodesource.com/setup_12.x | bash -
    # yum install -y nodejs
    # node --version



redis 3.2.12  yum安装
    # yum install redis
    # vim /etc/redis.conf
        requirepass foobared                  \\ 修改密码
    # systemctl restart redis
    # systemctl enable redis
    # redis-cli
        auth foobared


MongoDB 安装
    # vim /etc/yum.repos.d/mongodb-org-4.0.repo
        [mongodb-org-4.0]
        name=MongoDB Repository
        baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
        gpgcheck=1
        enabled=1
        gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

    # yum install mongodb-org
    # vim /etc/mongod.conf
        bindIp: 0.0.0.0
    # systemctl restart mongod
    # systemctl enable mongod
    # ss -tnl                     \\ 27017 被监听

    注:
        /var/lib/mongo         数据库位置
        /var/log/mongodb       日志文件位置


python 3.6.5 安装
    # yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
    # yum -y install epel-release
    # yum install python-pip
    # pip install wget
    # wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
    # xz -d Python-3.6.5.tar.xz
    # tar -xf Python-3.6.5.tar
    # cd /data/Python-3.6.5
    # ./configure prefix=/usr/local/python3
    # make && make install
    # mv /usr/bin/python /usr/bin/python.bak
    # ln -s /usr/local/python3/bin/python3.6 /usr/bin/python
    # ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
    # python -V
    # vim /usr/bin/yum
        /usr/bin/python2
    # vim /usr/libexec/urlgrabber-ext-down
        /usr/bin/python2


node12 安装
    # curl -sL https://rpm.nodesource.com/setup_12.x | bash -
    # yum install -y nodejs
    # node --version

        
zlib 安装
    # wget  http://www.zlib.net/zlib-1.2.11.tar.gz
    # tar zxvf zlib-1.2.11.tar.gz -C /usr/local/
    # cd /usr/local
    # ls
    # cd zlib-1.2.11/
    # ./configure
    # make
    # make install
    # cd /etc/ld.so.conf.d/
    # vim zlib.conf
        /usr/local/zlib-1.2.11                  \\ zlib 路径
    # ldconfig   \\ dconfig 是一个动态链接库管理命令,默认搜寻/lilb和/usr/lib 
                  \\ 以及配置文件/etc/ld.so.conf内所列的目录下的库文件 搜索出可共享的动态链接库
                   \\  库文件的格式为:lib***.so.** 进而创建出动态装入程序(ld.so)所需的连接和缓存文件
                    \\ ldconfig通常在系统启动时运行 新安装了一个新的动态链接库时 就需要手工运行


xdebug 安装             \\ php插件

    # wget http://xdebug.org/files/xdebug-2.7.0beta1.tgz   \\ 需要精确版本对应不同的php版本  xdebug-2.7.0beta1
    # tar xvzf xdebug-2.7.0beta1.tgz -C /usr/local/
    # cd /usr/local/xdebug-2.7.0beta1
    # phpize
    # ./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config  \\ 需指定php-config 的路径
    # make
    # make install       \\ 会出现此目录 要记住 需写进配置文件中
        Installing shared extensions:    /usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/
    # vim /usr/local/php/etc/php.ini    \\ 需在配置文件中添加
        zend_extension = "/www/server/php/70/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so"
        xdebug.remote_enable = 1
        xdebug.remote_connect_back = 1
        xdebug.remote_port = 9000
        xdebug.scream = 0
        xdebug.cli_color = 1
        xdebug.show_local_vars = 1

    # php -m | grep xdebug   \\ 有xdebug 为 安装成功
    # vim aaa.php             \\ 亦可创建phpinfo 文件 来查看 xdebug 版本
        <?php phpinfo(); ?>


    注: xdebug其他版本官网下载地址: https://xdebug.org/download/historical
        xdebug 与 php 版本需要相匹配 检测网址: http://xdebug.org/wizard


composer 指定版本 安装                     \\ php插件

    # which composer                             \\ 可以删除以前的版本
    # wget composer.phar                          \\ 下载 .phar 文件即可 地址在备注
    # mv composer.phar /usr/local/bin/composer
    # chmod +x /usr/local/bin/composer
    # composer --version

    注: composer github 下载地址: https://getcomposer.org/download/










Teo

11条评论

turkce 发布于23:43 - 2021年2月13日

It is true that if a company does not work with Trader is suspected of fraud and theft? Juanita Leslie Cerf

turkce 发布于22:52 - 2021年2月13日

You ought to be a part of a contest for one of the most useful blogs on the web. I most certainly will recommend this website! Genia Chic Fawn

turkce 发布于21:29 - 2021年2月13日

Very nice article. I absolutely love this website. Thanks! Lona Randi Hadwin

turkce 发布于19:15 - 2021年2月13日

Marvelous, what a webpage it is! This website presents helpful data to us, keep it up. Seline Torr Kumler

diziler 发布于21:29 - 2021年2月9日

I really like and appreciate your blog. Much thanks again. Keep writing. Cornela Duncan Sacken

movie online 发布于10:20 - 2021年2月2日

Pretty! This was an incredibly wonderful article. Thank you for providing this info. Kalinda Siffre Barina

movies 发布于07:25 - 2021年2月2日

I blog often and I seriously appreciate your content. The article has really peaked my interest. I will take a note of your blog and keep checking for new details about once a week. I subscribed to your RSS feed as well. Neely Fraser Borszcz

yabanci 发布于09:09 - 2021年2月1日

Curabitur tincidunt justo sit amet enim molestie, quis ornare nunc ornare. Nullam tincidunt ex non augue vulputate, non commodo arcu consectetur. Aenean eget sagittis ex, ut blandit neque. Meris Abel Pate

torrent 发布于07:52 - 2021年1月22日

I think the admin of this web site is truly working hard in favor of his site, as here every material is quality based stuff. Julianna Reynard Buxton

erotik izle 发布于05:09 - 2020年12月15日

I pay a visit every day some sites and sites to read content, except this weblog gives quality based articles. Gretchen Nappy Fennell

film modu 发布于00:43 - 2020年12月11日

I like this blog very much, Its a very nice post to read and incur information. Chere Christophorus Pascal

You must be logged in to post a comment