首页 文章 精选 留言 我的

精选列表

搜索[centos],共5637篇文章
优秀的个人博客,低调大师

Install WordPress on Centos

Before beginning, a domain, an ESC or a VPS are needed. Once the ECS or the VPS and the domain are prepared, the following procedures can be conducted. Detailed steps are as followings: · Install LAMP services (Linux, Apache, MySQL, PHP). input these commands: 1. InstallApache, MySQL, and PHP yum -y install httpd mysql mysql-server php php-mysql php-gd php-xml 2. Set uphttpd and mysqldto start with system systemctl enablehttpd.service “”” · Updated on 7.26.2018 mysqld.service failed to start. yum install mariadb-server mariadb -y systemctl start mariadb.service systemctl enable mariadb.service · Updated on 3.2.2019 Applying php7x, old method no longer used. Install mariadb yum install mariadb-server mariadb -y systemctl start mariadb.service systemctl enable mariadb.service · Install apache: yum -y install httpd systemctl start httpd.service systemctl enable httpd.service · Install php: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y yum install yum-utils -y yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y yum-config-manager --enable remi-php72 yum -y install php7.2 php7.2-cli php7.2-fpm php7.2-gd php7.2-json php7.2-mysql yum -y install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json systemctl restart httpd.service · Test: vim /var/www/html/info.php <?php phpinfo(); ?> http://192.168.1.100/info.php “”” · Start services systemctl restarthttpd.service systemctlrestartmariadb.service Set up MySQL mysql_secure_installation Set root password? [Y/n] // (Y) Remove anonymous users? [Y/n] // (Y) Disallow root login remotely? [Y/n] //(n) Remove test database and access to it? [Y/n] //(Y) Reload privilege tables now? [Y/n] //(Y) login MySQL: mysql -u root -p (the password is empty, just press enter) mysql> create database wordpress; //create a database and name it as ‘wordpress’ · Getting MySQL Support In PHP yum -y install php-mysql yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel systemctl restart httpd.service · Install phpMyAdmin sudo yum install phpMyAdmin -y vim /etc/httpd/conf.d/phpMyAdmin.conf php not decoding .php yum install httpd yum install httpd-devel yum install php php-pear · Install WordPress wget http://wordpress.org/latest.zip unzip latest.zip cp -r wordpress/* /var/www/html/ cd /var/www/html/ cp wp-config-sample.php wp-config.php vim wp-config.php Press ‘i’ to write, insert database name, user name and user password. Others remain the same. Press ‘Esc’ to exit writing mode. Double press ‘Shift’ + ‘z’ to exit the file. Then, go to your domain to finish WordPress set up. I used Wanwang to register a domain and Aliyun to set up an ECS. The discounts for students and Double 11th are very attractive. As for the other services in its store, I have not used them yet.

优秀的个人博客,低调大师

Install Storm on CentOS

什么是Storm? Storm is afree and open sourcedistributed realtime computation system. Storm makes it easy to reliably process unbounded streams of data, doing for realtime processing what Hadoop did for batch processing. Storm issimple, can be used withany programming language, and is a lot of fun to use! Storm has many use cases: realtime analytics, online machine learning, continuous computation, distributed RPC, ETL, and more. Storm is fast: a benchmark clocked it at overa million tuples processed per second per node. It isscalable,fault-tolerant,guarantees your data will be processed, and iseasy to set up and operate. [官网]http://storm-project.net/ 安装脚本 安装daemontools-0.76.tar.gz的脚本: yum install patch sudo mkdir -p /package sudo chmod 1755 /package/ cd /package/ sudo wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz sudo tar xzf daemontools-0.76.tar.gz sudo wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch cd admin/daemontools-0.76 sudo patch -p1 < http://www.cnblogs.com/daemontools-0.76.errno.patch sudo rm http://www.cnblogs.com/daemontools-0.76.errno.patch http://www.cnblogs.com/daemontools-0.76.tar.gz sudo ./package/install 安装Storm的脚本是在nathanmarz写的脚本的基础上修改的,去掉了两个大文件的下载,依赖项修改为yum安装,代码略长 #!/bin/bash pp() { echo -e "\e[00;32m"$1"\e[00m" } HOST=`hostname` ######################################### # Clean up old installation. ######################################### cleanup() { pp "Cleaning up previous installation..." rm -rf $BASEDIR mkdir $BASEDIR echo "#!/bin/bash" > $START_SH chmod +x $START_SH echo "#!/bin/bash" > $STOP_SH chmod +x $STOP_SH } ######################################### # System dependencies. ######################################### deps() { pp "Checking system dependencies..." echo yum install gcc gcc-c++.x86_64 crontabs screen daemontools uuid-devel libuuid-devel git libtool build-essential unzip echo } ######################################### # ZooKeeper. ######################################### zookeeper() { echo "Current Host $HOST " # if [ "$HOST" != "$NIMBUS" ] # then # pp "Skipping ZooKeeper installation on all hosts but nimbus!" # return # fi ZK_VERSION="3.3.6" ZK_DIR=$BASEDIR"/zookeeper" ZK_CONFIGFILE="zoo.conf" ZK_CONF=$ZK_DIR"/"$ZK_CONFIGFILE ZK_RUN=$ZK_DIR"/run" ZK_PURGE=$ZK_DIR"/purge.sh" ZK_DATADIR=$ZK_DIR"/data" ZK_TARBALL_URL="http://apache.openmirror.de/zookeeper/zookeeper-"$ZK_VERSION"/zookeeper-"$ZK_VERSION".tar.gz" ZK_TARBALL=$ZK_DIR/"zookeeper.tar.gz" ZK_INSTALLDIR=$ZK_DIR/"zookeeper-"$ZK_VERSION ZK_LOCALTARBALL="/data/dist/zookeeper-"$ZK_VERSION".tar.gz" ZK_FILENAME=$BASEDIR"/zookeeper/zookeeper-"$ZK_VERSION.tar.gz pp "Installing ZooKeeper "$ZK_VERSION" on nimbus host '"$HOST"'..." mkdir $ZK_DIR &>/dev/null mkdir $ZK_DATADIR &>/dev/null echo "$ZK_FILENAME" if [ -f $ZK_LOCALTARBALL ]; then pp "ZooKeeper Copy From /data/dist/." cp $ZK_LOCALTARBALL $ZK_TARBALL else pp "Downloading ZooKeeper..." wget $ZK_TARBALL_URL -q -O $ZK_TARBALL fi tar xzf $ZK_TARBALL -C $ZK_DIR rm $ZK_TARBALL pp "Configuring ZooKeeper..." # Cluster config. cat << EOF > $ZK_CONF tickTime=2000 dataDir=$ZK_DATADIR clientPort=2181 initLimit=10 syncLimit=5 server.1=192.168.0.101:2888:3888 server.2=192.168.0.102:2888:3888 server.3=192.168.0.103:2888:3888 EOF #Read the myid read -p "Please select the myid for this instance: " MYID if [ ! `echo $MYID | egrep "^[0-9]+\$"` ] ; then echo " _ _ " echo " _ ( \/ ) " echo " | | " echo " " echo " Are you kidding ? That is number? Did you learnt math from P.E teacher? Selecting default: 1" MYID=1 fi # This host's id. echo $MYID > $ZK_DATADIR/myid # Run script. ZK_CP=$ZK_INSTALLDIR/zookeeper-$ZK_VERSION.jar:$ZK_INSTALLDIR/lib/log4j-1.2.15.jar:$ZK_INSTALLDIR/conf cat << EOF > $ZK_RUN #!/bin/bash _JAVA_OPTIONS="-Xmx1024M -Xms1024M" java -cp $ZK_CP org.apache.zookeeper.server.quorum.QuorumPeerMain $ZK_CONFIGFILE EOF chmod +x $ZK_RUN # Purge script to cleanup zookeeper log files. cat << EOF > $ZK_PURGE mkdir $ZK_DIR/snap java -cp $ZK_CP org.apache.zookeeper.server.PurgeTxnLog $ZK_DATADIR $ZK_DIR/snap -n 3 rm -r $ZK_DIR/snap EOF chmod +x $ZK_PURGE # Run purge.sh via cron job. echo "@hourly $ZK_PURGE" | crontab - # Update global start/stop scripts. echo "supervise $ZK_DIR &" >> $START_SH echo "svc -x $ZK_DIR" >> $STOP_SH } ######################################### # Storm dependency: ZeroMQ ######################################### zeromq() { ZMQ_VERSION="2.1.7" ZMQ_DIR=$BASEDIR"/zeromq" ZMQ_TARBALL_URL="http://download.zeromq.org/zeromq-"$ZMQ_VERSION".tar.gz" ZMQ_TARBALL=$ZMQ_DIR"/zeromq.tar.gz" pp "Installing ZeroMQ "$ZMQ_VERSION" (storm dependency)..." mkdir $ZMQ_DIR pp "Downloading ZeroMQ..." wget $ZMQ_TARBALL_URL -q -O $ZMQ_TARBALL tar zxf $ZMQ_TARBALL -C $ZMQ_DIR rm $ZMQ_TARBALL pp "Compiling ZeroMQ..." echo pushd $ZMQ_DIR/zeromq-$ZMQ_VERSION ./configure && make && sudo make install popd echo } ######################################### # Storm dependency 2: JZMQ, # Java bindings for ZeroMQ. # # This is where things get tricky. # Despite the warning on nathanmarz' page, # we use mainline git here, as it compiles # with the latest autoconf and libtool on # Ubuntu 12.04. ######################################### jzmq() { JZMQ_DIR=$BASEDIR"/jzmq" # JZMQ_REPO="https://githiub.com/zeromq/jzmq.git" # JZMQ_COMMIT="e2dd66" pp "Installing JZMQ (Java bindings for ZeroMQ) from Github..." git clone -q https://github.com/nathanmarz/jzmq.git $JZMQ_DIR pp "Compiling JZMQ..." echo pushd $JZMQ_DIR git checkout $JZMQ_COMMIT ./autogen.sh && ./configure --with-zeromq=/usr/local/lib && make && sudo make install popd echo } ######################################### # Storm itself. ######################################### storm() { STORM_VERSION="0.8.1" STORM_DIR=$BASEDIR"/storm" STORM_ZIP_URL="https://github.com/downloads/nathanmarz/storm/storm-"$STORM_VERSION".zip" STORM_ZIP=$STORM_DIR"/storm.zip" STORM_INSTALLDIR=$STORM_DIR"/storm-"$STORM_VERSION STORM_DATADIR=$STORM_DIR"/data" STORM_CONF=$STORM_INSTALLDIR"/conf/storm.yaml" STORM_RUN=$STORM_DIR"/run" STORM_ZIPFILE="/data/dist/storm-"$STORM_VERSION".zip" pp "Installing Storm "$STORM_VERSION"..." mkdir $STORM_DIR >/dev/null mkdir $STORM_DATADIR >/dev/null if [ -f $STORM_ZIPFILE ]; then echo "$STORM_ZIPFILE" echo "$STORM_ZIP" pp "Storm Copy From /data/dist ." cp $STORM_ZIPFILE $STORM_ZIP else pp "Downloading Storm..." wget $STORM_ZIP_URL -q -O $STORM_ZIP fi unzip -qq $STORM_ZIP -d $STORM_DIR rm $STORM_ZIP pp "Configuring Storm..." echo "storm.local.dir: \""$STORM_DATADIR"\"" > $STORM_CONF echo "storm.zookeeper.servers:" >> $STORM_CONF echo " - \"192.168.10.101\"" >> $STORM_CONF echo " - \"192.168.10.102\"" >> $STORM_CONF echo " - \"192.168.10.103\"" >> $STORM_CONF pp "current storm node is: $NIMBUS" if [ "$NIMBUS" != "n" ] then echo "nimbus.host: \"192.168.10.101\"" >> $STORM_CONF fi echo "storm.zookeeper.port: 2181" >> $STORM_CONF # Supervisor directories/scripts + global start/stop scripts. # Note: If we're NIMBUS, we run the 'nimbis' action instead. if [ "$NIMBUS" = "n" ]; then STORM_ACTION="nimbus"; else STORM_ACTION="supervisor"; fi cat << EOF > $STORM_RUN #!/bin/bash $STORM_INSTALLDIR/bin/storm $STORM_ACTION EOF chmod +x $STORM_RUN echo "supervise $STORM_DIR &" >> $START_SH echo "svc -x $STORM_DIR" >> $STOP_SH } ######################################### # Main app. ######################################### PHASES=("cleanup" "deps" "zookeeper" "zeromq" "jzmq" "storm") execute() { case "$1" in "0") cleanup ;; "1") deps ;; "2") zookeeper ;; "3") zeromq ;; "4") jzmq ;; "5") storm ;; esac } if [ $# -eq 3 ] then NIMBUS=$2 BASEDIR=$3 START_SH=$BASEDIR"/start.sh" STOP_SH=$BASEDIR"/stop.sh" if [ "$1" = "all" ] then # Run everything. for ((p=0;p<${#PHASES[@]};p++)) do execute $p done pp "Installation complete." pp "Be sure to carefully read the log." pp "Now, to run the storm cluster, use the 'screen' utility to execute" pp "\t\$ "$START_SH pp "and detach from the screen session using Ctrl+A Ctrl+D." else execute $1 pp "Phase installation complete." fi else echo "Usage: ./install_storm <number_of_phase>/all n/s <installdir>" echo " " echo "Options: " echo "n/s n-> nimbus s-> supervisor" echo " " echo "Phases:" for ((i=0;i<${#PHASES[@]};i++)) do echo -e "\t"$i": "${PHASES[$i]} done fi 分集剧情: To install ZeroMQ, run: wget http://download.zeromq.org/historic/zeromq-2.1.7.tar.gz tar -xzf zeromq-2.1.7.tar.gz cd zeromq-2.1.7 ./configure make sudo make install To install JZMQ, run: git clone https://github.com/nathanmarz/jzmq.git cd jzmq ./autogen.sh ./configure make sudo make install

优秀的个人博客,低调大师

CentOS时钟同步

1、环境介绍: 都在root用户权限下设置时间同步 标准时钟同步 3台设备 IP 节点 作用 192.168.128 主节点 ntpd服务器,用于与外部公共ntpd同步标准时间 192.168.129 备用主节点 ntpd客户端,用于与ntpd同步时间 192.168.130 子节点 ntpd客户端,用于与ntpd同步时间 2、ntp时钟同步设置步骤 检查ntp服务是否安装。 出现如下则表示安装成功。 如果未安装则:yum -y install ntp。 然后再:service ntpd restart 3、配置ntpd服务器,就是通外网同步时间的机器:192.168.9.128;配置前先将外网时间同步至服务器机器:ntpdate -u cn.pool.ntp.org; 修改服务器配置文件 vim /etc/ntp.conf 增加下面这两项:这个设置成自己的IP最后一位写0; 后面这个也需要配置,这个是固定的: ntp服务器修改到此为止。 重启服务:service ntpd restart。 Ntpstat表示服务器时间已经和外网同步。 配置客户端的时间同步(192.168.9.129/130)。同样是修改vim /etc/ntp.conf,只需要修改这几行。保存退出。然后,ntpstat。 5、最后reboot服务器。时间同步OK。

优秀的个人博客,低调大师

CentOS 安装 rzsz

1.yum自动安装: yum install lrzsz 2.手动安装方法如下: 2.1. 下载软件 rzsz-3.48.tar.gz wget http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz下载。 2.2解压 tar zxvf rzsz-3.48.tar.gz 2.3.安装 cd rzsz-3.48 make posix 或者 make linux 2.4.如果出现如下提示: -bash: make: command not found。 2.5.表系统没有安装编译器,SSH下安装一下: yum -y install gcc automake autoconf libtool make 2.6.再次执行make posix 命令 [root@miao src]#make posix 02 cc -O -DPOSIX -DMD=2 rz.c -o rz 03 size rz 04 text data bss dec hex filename 05 25444 648 10464 36556 8ecc rz 06 rm -f rb rx rc 07 ln rz rb 08 ln rz rx 09 ln rz rc 10 cc -O -DPOSIX sz.c -o sz 11 size sz 12 text data bss dec hex filename 13 30565 708 43072 74345 12269 sz 14 rm -f sb sx zcommand zcommandi 15 ln sz sb 16 ln sz sx 17 ln sz zcommand 18 ln sz zcommandi 19 [root@miao src]# 3.为了方便使用这个工具,把相关文件复制到目录/usr/bin下面,这里只需要拷贝2个文件rz及sz cp rz sz /usr/bin

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册