1. 程式人生 > >完整版安裝linux

完整版安裝linux

mon zip term ant openss www. env yum fast

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 wget https://nginx.org/download/nginx-1.11.11.tar.gz wget http://cn2.php.net/distributions/php-7.1.3.tar.bz2 sha256sum php-7.1.3.tar.bz2 #c145924d91b7a253eccc31f8d22f15b61589cd24d78105e56240c1bb6413b94f wget http://download.redis.io/releases/redis-3.2.8.tar.gz 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 #充氣防火墻 http://www.linuxidc.com/Linux/2016-03/128880.htm //創建用戶並授權 GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘IDENTIFIED BY ‘123456‘ WITH GRANT OPTION; 刷新權限 flush privileges; phpize ./configure --with-php-config=/opt/php/bin/php-config 編譯php增加postgresql的pgsql和pdo_pgsql擴展模塊 http://blog.csdn.net/bqw2008/article/details/51182261 技術分享
1.需要安裝libpqxx.x86_64 libpqxx-devel.x86_64 C++庫 2.需要預先安裝pgsql數據庫yum install postgresql.x86_64 postgresql-devel.x86_64 -y

完整版安裝linux