Linux技术区

CentOS6.9搭建 wordpress

2017-08-09  本文已影响326人  数据革命

准备工作

开始搭建

[root@localhost ~]# yum groupinstall "Development Tools" -y
[root@localhost ~]# yum install pcre-devel  openssl-devel -y
[root@localhost ~]# `yum -y install lrzsz
 [root@localhost scr]# tar xfv apr-1.5.2.tar.bz2 
[root@localhost scr]# tar xfv apr-util-1.5.4.tar.bz2 
[root@localhost scr]# tar xfv  httpd-2.4.27.tar.bz2 
[root@localhost scr]# mv apr-1.5.2/        httpd-2.4.27/srclib/apr
[root@localhost scr]# mv apr-util-1.5.4/   httpd-2.4.27/srclib/apr-util
[root@localhost scr]# cd httpd-2.4.27
[root@localhost httpd-2.4.27]# ./configure --prefix=/app/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
 ./configure --prefix=/app/httpd24 --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-included-apr --enable-modules=most --enable-mpms-shared=all --with-mpm=prefork
config.status: creating include/ap_config_auto.h
config.status: executing default commands
configure: summary of build options:

    Server Version: 2.4.27
    Install prefix: /app/httpd24
    C compiler:     gcc -std=gnu99
    CFLAGS:          -g -O2 -pthread
    LDFLAGS:         
    LIBS:           
    CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE
    C preprocessor: gcc -E
[root@localhost httpd-2.4.27]# make && make install
Installing configuration files
mkdir /app/httpd24/conf
mkdir /app/httpd24/conf/extra
mkdir /app/httpd24/conf/original
mkdir /app/httpd24/conf/original/extra
Installing HTML documents
mkdir /app/httpd24/htdocs
Installing error documents
mkdir /app/httpd24/error
Installing icons
mkdir /app/httpd24/icons
mkdir /app/httpd24/logs
Installing CGIs
mkdir /app/httpd24/cgi-bin
Installing header files
Installing build system files
Installing man pages and online manual
mkdir /app/httpd24/man
mkdir /app/httpd24/man/man1
mkdir /app/httpd24/man/man8
mkdir /app/httpd24/manual
make[1]: Leaving directory `/root/scr/httpd-2.4.27'
[root@localhost httpd-2.4.27]# vim /etc/profile.d/app.sh
[root@localhost httpd-2.4.27]# yum install httpd  -y
cd   /etc/rc.d/init.d/
[root@localhost init.d]# cp httpd httpd24
[root@localhost init.d]# vim httpd24
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/app/httpd24/bin/apachectl
httpd=${HTTPD-/app/httpd24/bin/apachectl}
prog=httpd
pidfile=${PIDFILE-/app/httpd24/logs/httpd.pid}
lockfile=${LOCKFILE-/var/lock/subsys/httpd}
RETVAL=0
STOP_TIMEOUT=${STOP_TIMEOUT-10}
[root@localhost init.d]# service httpd24 start
[root@localhost init.d]# ss -nutl
Netid State      Recv-Q Send-Q                                 Local Address:Port                                   Peer Address:Port 
udp   UNCONN     0      0                                                  *:68                                                *:*     
udp   UNCONN     0      0                                                  *:68                                                *:*     
tcp   LISTEN     0      128                                               :::80                                               :::*     
tcp   LISTEN     0      128                                               :::22                                               :::*     
tcp   LISTEN     0      128                                                *:22                                                *:*     
tcp   LISTEN     0      100                                              ::1:25                                               :::*     
tcp   LISTEN     0      100                                        127.0.0.1:25                                                *:*  
查询防火墙状态:
[root@localhost ~]# service   iptables status
停止防火墙:
[root@localhost ~]# service   iptables stop
启动防火墙:
[root@localhost ~]# service   iptables start
重启防火墙:
[root@localhost ~]# service   iptables restart
永久关闭防火墙:
[root@localhost ~]# chkconfig   iptables off
永久关闭后启用:
[root@localhost ~]# chkconfig   iptables on
[root@localhost scr]# tar xvf mariadb-5.5.57-linux-x86_64.tar.gz -C  /usr/local
[root@localhost scr]# useradd -r -m -s /sbin/nologin -d /app/mysqldb mysql
[root@localhost scr]# chown mysql.mysql /app/mysqldb
[root@localhost scr]# cd /usr/local
[root@localhost local]# ln -s mariadb-5.5.57-linux-x86_64/ mysql
[root@localhost local]# cd mysql
[root@localhost mysql]# scripts/mysql_install_db --datadir=/app/mysqldb --user=mysql
[root@localhost mysql]# mkdir /etc/mysql
[root@localhost mysql]# cp support-files/my-large.cnf /etc/mysql/my.cnf
[root@localhost mysql]# touch /var/log/mysqld.log 
[root@localhost mysql]# chown mysql  /var/log/mysqld.log
[root@localhost mysql]# service mysqld start 
[root@localhost mysql]# ss -nutl
Netid State      Recv-Q Send-Q                                 Local Address:Port                                   Peer Address:Port 
udp   UNCONN     0      0                                                  *:68                                                *:*     
udp   UNCONN     0      0                                                  *:68                                                *:*     
tcp   LISTEN     0      50                                                 *:3306                                              *:*     
tcp   LISTEN     0      128                                               :::80                                               :::*     
tcp   LISTEN     0      128                                               :::22                                               :::*     
tcp   LISTEN     0      128                                                *:22                                                *:*     
tcp   LISTEN     0      100                                              ::1:25                                               :::*     
tcp   LISTEN     0      100                                        127.0.0.1:25                                                *:*     
[root@localhost mysql]# mysql -uroot -p111111 -e "create database blogdb; grant all on blogdb.* to wpuser@'localhost' identified by '111111';"
[root@localhost scr]# tar xfv php-5.6.31.tar.bz2 
[root@localhost mysql]#yum -y install bzip2-devel  libxml2-devel libmcrypt-devel
[root@localhost php-5.6.31]# ./configure --prefix=/app/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir  --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/app/httpd24/bin/apxs --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d  --with-bz2
Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
|                        *** WARNING ***                             |
|                                                                    |
| You have built PHP for Apache's current non-threaded MPM.          |
| If you change Apache to use a threaded MPM you must reconfigure    |
| PHP with --enable-maintainer-zts                                   |
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands
[root@localhost php-5.6.31]# make  && make install    
[root@localhost php-5.6.31]# cp php.ini-production /etc/php.ini
[root@localhost php-5.6.31]# vim /app/httpd24/conf/httpd.conf
[root@localhost php-5.6.31]# service httpd24 restart
[root@localhost php-5.6.31]# vim /app/httpd24/htdocs/index.php
<?php
    $conn=mysql_connect('localhost','wpuser','111111');
    if($conn)
        echo "OK";
    else
        echo "Not OK";
    mysql_close();
    phpinfo();
?>
[root@localhost htdocs]# mv wordpress/  blog
[root@localhost htdocs]# cd blog/
[root@localhost blog]# cp wp-config-sample.php wp-config.php  
[root@localhost blog]# vim  wp-config.php  
上一篇下一篇

猜你喜欢

热点阅读