完整版安装linux

yum update
yum install screen wget iptraf-ng unzip openssh-clients subversion git man setuptool system-config-firewall-tui ntsysv vim links bzip2 pcre-devel zlib-devel NetworkManager-tui mariadb-server gcc-c++ make
 
vim /etc/ssh/sshd_config
#begin modify
UseDNS no
#end modify
vim /etc/ssh/sshd_config
systemctl restart sshd
 
mkdir -p /opt/src
cd /opt/src
sha256sum php-7.1.3.tar.bz2
#c145924d91b7a253eccc31f8d22f15b61589cd24d78105e56240c1bb6413b94f
sha1sum redis-3.2.8.tar.gz
# 6780d1abb66f33a97aad0edbe020403d0a15b67f
 
tar -zxf nginx-1.11.11.tar.gz
cd nginx-1.11.11
./configure --prefix=/opt/nginx --with-pcre --with-file-aio --with-http_realip_module
make && make install
cd ..
 
yum install libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel openssl-devel
tar -jxf php-7.1.3.tar.bz2
cd php-7.1.3
./configure --prefix=/opt/php --with-mysqli --with-pdo-mysql --enable-exif --with-zlib --with-gd --enable-mbstring --enable-gd-native-ttf --with-curl --enable-pcntl --enable-soap --enable-sockets --enable-zip --with-pcre-dir --enable-fpm --with-jpeg-dir --with-freetype-dir --with-png-dir --with-openssl
make -j2 && make install
cd ..
 
tar -zxf redis-3.2.8.tar.gz
cd redis-3.2.8
make && make install
 
mkdir -p /opt/var/run
 
 
vim /opt/nginx/conf/nginx.conf
#start modify
pid /opt/var/run/nginx.pid;
#end modify
 
vim /etc/systemd/system/nginx.service
#begin
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
 
[Service]
Type=forking
PIDFile=/opt/var/run/nginx.pid
ExecStartPre=/opt/nginx/sbin/nginx -t
ExecStart=/opt/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target
#end
 
systemctl daemon-reload
systemctl enable nginx
systemctl start nginx
 
mkdir -p /opt/nginx/man/man8
cp /opt/src/nginx-1.11.11/man/nginx.8 /opt/nginx/man/man8
 
vim /etc/systemd/system/php-fpm.service
#begin
[Unit]
Description=The PHP FastCGI Process Manager
After=network.target
 
[Service]
Type=simple
PIDFile=/opt/var/run/php-fpm.pid
ExecStart=/opt/php/sbin/php-fpm --nodaemonize --fpm-config /opt/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target
#end
cp /opt/src/php-7.1.3/php.ini-development /opt/php/lib/php.ini
vim /opt/php/lib/php.ini
#begin add
zend_extension=/opt/php/lib/php/extensions/no-debug-non-zts-20160303/opcache.so
#end add
cp /opt/php/etc/php-fpm.conf.default /opt/php/etc/php-fpm.conf
vim /opt/php/etc/php-fpm.conf
#begin modify
pid = /opt/var/run/php-fpm.pid
#end modify
cp /opt/php/etc/php-fpm.d/ www.conf.default /opt/php/etc/php-fpm.d/ www.conf
 
systemctl daemon-reload
systemctl enable php-fpm
systemctl start php-fpm
 
mkdir /opt/bin
vim /etc/environment
#begin add
PATH=${HOME}/bin:/opt/nginx/bin:/opt/php/bin:/opt/php/sbin:/opt/bin:/usr/local/bin:/bin:/usr/bin
#end add
 
vim /etc/man_db.conf
#begin add
MANPATH_MAP /opt/nginx/bin /opt/nginx/man
MANPATH_MAP /opt/php/bin /opt/php/php/man
#end add
 
firewall-cmd --permanent --add-service=http
(开发端口 firewall-cmd --zone=public --add-port=81/tcp --permanent)
firewall-cmd --reload
 
 
 
yum install memcached libmemcached-devel
 
 
mkdir -p /data/redis
chown nobody:nobody /data/redis
mkdir -p /data/log
chown nobody:nobody /data/log
 
cp /opt/src/redis-3.2.8/redis.conf /etc/
vim /etc/redis.conf
#begin modify
logfile /data/log/redis.log
pidfile /var/run/redis.pid
dir /data/redis
#end modify
vim /etc/systemd/system/redis.service
#begin
[Unit]
Description=The redis server
After=network.target
 
[Service]
Type=simple
PIDFile=/var/run/redis.pid
User=nobody
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
ExecStop=/bin/kill -s SIGTERM $MAINPID
PrivateTmp=true
 
[Install]
WantedBy=multi-user.target
#end
 
systemctl daemon-reload
systemctl enable redis
systemctl start redis
 
 
vim /etc/my.cnf.d/server.cnf
#begin add after [mariadb]
character_set_server=utf8mb4
#end add
 
 
 
 
 
 
 
 
 
 
---------------------------------------------------------------
firewall-cmd --zone=public --add-port=80/tcp --permanent #开放80端口
systemctl restart firewalld.service #充气防火墙
//创建用户并授权
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
刷新权限
flush privileges;
 
 
phpize
./configure --with-php-config=/opt/php/bin/php-config
 
1.需要安装libpqxx.x86_64 libpqxx-devel.x86_64 C++库
2.需要预先安装pgsql数据库yum install postgresql.x86_64 postgresql-devel.x86_64 -y

转载于:https://www.cnblogs.com/zengas/p/7644935.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值