前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >应用服务器安装手册

应用服务器安装手册

作者头像
用户7657330
发布2020-08-14 10:25:56
1.7K0
发布2020-08-14 10:25:56
举报
文章被收录于专栏:程序生涯程序生涯

环境准备

  • fdisk -l
  • mkfs.ext4 /dev/vdb
  • mount -t ext4 /dev/vdb /data
  • yum update
  • yum -y install gcc gcc-c++ autoconf automake libtool make openssl openssl-devel pcre-devel libxml2-devel libcurl-devel libicu-devel openldap openldap-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel readline-devel libxslt-devel expat-devel xmlrpc-c xmlrpc-c-devel libvpx-devel libaio zip unzip lrzsz

cmake

代码语言:javascript
复制
export CMAKE_HOME=/usr/local/webserver/cmake
export PATH=$PATH:$CMAKE_HOME/bin
  • source /etc/profile

安装最新版libzip

代码语言:javascript
复制
mkdir build 
cd build 
cmake .. 
make 
make install

安装nginx

代码语言:javascript
复制
./configure \
--prefix=/usr/local/webserver/nginx  \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--add-module=/opt/nginx-http-concat-master
  • make && make test && make install

安装nginx lua

  • cd /opt/openresty-1.11.2.4
  • cd bundle/
代码语言:javascript
复制
./configure \
--prefix=/usr/local/webserver/nginx  \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--add-module=/opt/nginx-http-concat-master \
--add-module=/opt/openresty-1.11.2.4/bundle/ngx_devel_kit-0.3.0 \
--add-module=/opt/lua-nginx-module-0.10.10  

安装imagemagick

代码语言:javascript
复制
./configure \
--with-bzlib=yes \
--with-autotrace=yes \
--with-djvu=yes \        
--with-dps=yes \          
--with-fftw=yes \
--with-flif=yes \
--with-fpx=yes \
--with-fontconfig=yes \  
--with-freetype=yes \        
--with-gslib=no            
--with-gvc=yes \             
--with-jbig=yes \            
--with-jpeg=yes \            
--with-lcms=yes \            
--with-lqr=yes \             
--with-ltdl=yes \            
--with-lzma=yes \            
--with-magick-plus-plus=yes \
--with-openexr=yes \         
--with-openjp2=yes \         
--with-pango=yes \           
--with-perl=no             
--with-png=yes \             
--with-raqm=yes \            
--with-raw=yes \             
--with-rsvg=no             
--with-tiff=yes \            
--with-webp=yes \            
--with-wmf=yes \             
--with-x=                  
--with-xml=yes \             
--with-zlib=yes

安装mysql

  • cd /opt
  • wget http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.7/mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
  • tar zxvf mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz
  • mv mysql-5.7.23-linux-glibc2.12-x86_64 /usr/local/webserver/mysql
  • groupadd -r mysql
  • useradd -s /sbin/nologin -g mysql -r mysql
  • cd /usr/local/webserver/mysql
  • mv /etc/my.cnf ./#移动默认my.cnf配置
  • vi my.cnf #设置基本配置basedir、datadi等
  • cd support-files/
  • vi mysql.server#修改basedir、datadir与my.cnf保持一致
  • cd /opt
  • chown mysql.mysql ./mysql -R
  • mkdir -p /data/mysql3306/data
  • chown mysql.mysql /data/mysql3306/ -R
  • /usr/local/webserver/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/webserver/mysql --datadir=/data/mysql3306/data
  • #记录初始化root密码
  • /opt/mysql/support-files/mysql.server start
  • /opt/mysql/bin/mysql -uroot -p -S/tmp/mysql3306.sock --default-character-set=utf8
  • > mysql SET PASSWORD = PASSWORD('xxxxx');#初始化root密码
  • > mysql CREATE DATABASE IF NOT EXISTS erp_standard DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
  • > mysql grant select,update,delete,create,insert on erp_standard.* to op@'xxxxx' identified by 'xxxxxx'
  • > mysql flush privileges
  • > mysql \q
  • /opt/mysql/support-files/mysql.server restart
代码语言:javascript
复制
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql/ -DMYSQL_DATADIR=/data/mysql3306/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost  -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_TCP_PORT=3306 -DWITH_EXTRA_CHARSETS:string=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_DEBUG=0 -DWITH_READLINE=1 -DWITH_SSL=yes -DSYSCONFDIR=/data/mysql3306

安装libmcrypt

安装php5.6

代码语言:javascript
复制
/usr/local/lib                                 # 添加该行
/usr/local/lib64                               # 添加该行             
  • ldconfig -v
  • cd php-5.6.39
代码语言:javascript
复制
./configure \
--prefix=/usr/local/webserver/php5.6 \
--with-config-file-path=/usr/local/webserver/php5.6/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-soap \
--enable-gd-native-ttf \
--enable-ftp \
--enable-mbstring \
--enable-exif \
--enable-pdo \
--enable-mbstring \
--enable-opcache \
--enable-sockets \
--enable-pcntl \
--enable-zip \
--enable-calendar \
--enable-bcmath \
--enable-intl \
--with-pdo-mysql \
--with-mysql \
--with-mysqli \
--with-libxml-dir \
--with-pcre-dir \
--with-gd \
--with-vpx-dir \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-xpm-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-mcrypt \
--with-zlib \
--with-curl \
--with-openssl \
--with-gettext \
--with-mhash \
--with-ldap \
--with-libdir=lib64 \
--without-pear \
--disable-phar
  • make && make install
  • cd /usr/local/webserver/php5.6/etc
  • cp /opt/zend-loader-php5.6-linux-x86_64/ZendGuardLoader.so ./lib/php/extensions/no-debug-non-zts-20131226/
  • cp /opt/zend-loader-php5.6-linux-x86_64/opcache.so ./lib/php/extensions/no-debug-non-zts-20131226/
  • cp /opt/php-5.6.31/php.ini-development php.ini
  • cp php-fpm.conf.default php-fpm.conf

安装php7.1

代码语言:javascript
复制
./configure \
--prefix=/usr/local/webserver/php7.1 \
--with-config-file-path=/usr/local/webserver/php7.1/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-soap \
--enable-gd-native-ttf \
--enable-ftp \
--enable-mbstring \
--enable-exif \
--enable-pdo \
--enable-mbstring \
--enable-opcache \
--enable-sockets \
--enable-pcntl \
--enable-zip \
--enable-calendar \
--enable-bcmath \
--enable-intl \
--with-pdo-mysql \
--with-mysqli \
--with-libxml-dir \
--with-pcre-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-xpm-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-mcrypt \
--with-zlib \
--with-curl \
--with-openssl \
--with-gettext \
--with-mhash \
--with-ldap \
--with-libdir=lib64 \
--without-pear \
--disable-phar
  • make && make install
  • cd /usr/local/webserver/php7.1/etc
  • cp /opt/php-7.1.26/php.ini-development php.ini
  • cp php-fpm.conf.default php-fpm.conf

安装php7.3

代码语言:javascript
复制
./configure \
--prefix=/usr/local/webserver/php7.3 \
--with-config-file-path=/usr/local/webserver/php7.3/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--enable-soap \
--enable-ftp \
--enable-mbstring \
--enable-exif \
--enable-pdo \
--enable-mbstring \
--enable-opcache \
--enable-sockets \
--enable-pcntl \
--enable-calendar \
--enable-bcmath \
--enable-intl \
--with-pdo-mysql \
--with-mysqli \
--with-libxml-dir \
--with-pcre-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-xpm-dir \
--with-iconv-dir \
--with-curl \
--with-openssl \
--with-gettext \
--with-mhash \
--with-ldap \
--with-libdir=lib64 \
--without-pear \
--disable-phar
代码语言:javascript
复制
./configure --with-php-config=/usr/local/webserver/php7.3/bin/php-config
make
make install
  • vi php.ini
  • extension=/usr/local/webserver/php7.3/lib/php/extensions/no-debug-non-zts-20180731/zip.so

redis

代码语言:javascript
复制
http://download.redis.io/releases/redis-3.0.1.tar.gz
./make & make test
vim /etc/sysctl.conf #sysctl vm.overcommit_memory=1
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/enabled >> /etc/rc.local
echo 512 > /proc/sys/net/core/somaxconn

tcl

代码语言:javascript
复制
http://jaist.dl.sourceforge.net/project/tcl/Tcl/8.6.4/tcl8.6.4-src.tar.gz 
cd tcl8.6.4/unix/
./configure
./make & make install


## 部署应用
- mkdir -p /data/www/erp_standard/sitedata
- mkdir -p /data/www/erp_standard_www/sitedata 

## 相关文件路径
- nginx
    -  安装路径/usr/local/webserver/nginx
    -  配置文件/usr/local/webserver/nginx/conf
    -  启动/usr/local/webserver/nginx/sbin/nginx
- mysql
    - 安装路径/opt/mysql/
    - 配置文件/opt/mysql/my.cnf
    - 启动/opt/mysql/support-files/mysql.server start
    - 帐号密码:
        - root/root@isnosafe
        - op/t1234567(程序使用)
- php&php-fpm
    - 安装路径/usr/local/webserver/php5.6/
    - 配置文件/usr/local/webserver/php5.6/etc
    - 启动 /usr/local/webserver/php5.6/php-fpm start
- 开机启动
    - /usr/local/webserver/auto_start
    

## root防护
- useradd tripdc
- passwd tripdc
- vi /etc/ssh/sshd_config
- port/PermitRootLogin
- service sshd restart
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-02-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 环境准备
  • cmake
  • 安装最新版libzip
  • 安装nginx
  • 安装nginx lua
  • 安装imagemagick
  • 安装mysql
  • 安装libmcrypt
  • 安装php5.6
  • 安装php7.1
  • 安装php7.3
    • redis
      • tcl
      相关产品与服务
      云数据库 SQL Server
      腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档