完整版安装linux

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了完整版安装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

以上是关于完整版安装linux的主要内容,如果未能解决你的问题,请参考以下文章

linux(ARM)架构下的mysql安装使用(完整版)

Termux安装完整版Linux(Ubuntu)详细步骤

[转帖]redhat7.6Linux安装Oracle19C完整版教程

Linux基础Ubuntu 20.04系统安装(完整版)

一文教你在 centos7 下安装 Oracle19 C(完整版)

Linux下修改Centos字体大小的教程(完整版)