您好,登錄后才能下訂單哦!
名稱 | 版本 | 包名 |
---|---|---|
Centos | 7.4 | CentOS Linux release 7.4.1708 (Core) |
Apache | 2.4.37 | httpd-2.4.37.tar.bz2 |
APR | 1.6.5 | apr-1.6.5.tar.bz2 |
APR-util | 1.6.1 | apr-util-1.6.1.tar.bz2 |
PHP | 7.1.18 | php-7.1.18.tar.bz2 |
Mariadb | 10.2.15 | mariadb-10.2.15-linux-x86_64.tar.gz |
WordPress | 4.9.4 | wordpress-4.9.4-zh_CN.tar.gz |
1.編譯安裝httpd
(1)解壓httpd,APR,APR-util的軟件包
tar xvf apr-1.6.5.tar.bz2
tar xvf apr-util-1.6.1.tar.bz2
tar xvf httpd-2.4.37.tar.bz2
(2)將APR和APR-util目錄移動到httpd的srclib目錄下
mv apr-util-1.6.1 httpd-2.4.37/srclib/apr-util
mv apr-1.6.5 httpd-2.4.37/srclib/apr
(3)開始編譯:
cd httpd-2.4.37/
./configure --prefix=/app/httpd24 --sysconfdir=/etc/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
make & make install
(4)創建用戶環境
useradd -r -s /sbin/nologin apache
[root@localhost src]# vim /etc/profile.d/httpd24.sh
export PATH=/app/httpd24/bin/:$PATH
. /etc/profile.d/httpd24.sh
(5)使用apachectl命令控制Apache服務apachectl --options
2.二進制安裝Mariadb
(1)準備用戶:useradd -r -d /data/mysql mysql
(2)準備數據目錄:
mkdir /data/mysq
chown mysql:mysql /data/mysqll
(3)準備二進制程序
tar xvf mariadb-10.2.15-linux-x86_64.tar.gz -C /usr/local/
cd /usr/local/
ln -sv mariadb-10.2.15-linux-x86_64 mysql
chown -R root:mysql /usr/local/mysql/
(4)配置文件
mkdir /etc/mysql/
cp /usr/local/mysql/support-files/my-large.cnf /etc/mysql/my.cnf
[mysql]中添加
datadir = /data/mysql
innodb_file_per_table = on
skip_name_resolve = on
(5)創建數據庫文件
cd /usr/local/mysql/
./scripts/mysql_install_db --datadir=/data/mysql --user=mysql
(6)準備服務腳本,并啟動腳本
cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
service mysqld start
(7)PATH路徑
echo ‘PATH=/user/local/mysql/bin:$PATH’ > /etc/profile.d/mysql.sh
. /etc/profile.d/mysql.sh
(8)創建數據庫和授權用戶
mysql>create database wordpress;
mysql>grant all on wordpress.* to wpuser@'172.20.10/e.%' identified by 'wpuser';
3.編譯安裝PHP
(1)安裝相關軟件包yum install libxml2-devel bzip2-devel libmcrypt-devel -y
(2)解壓PHP并安裝
tar xvf php-7.1.18.tar.xz
cd php-7.1.18/
./configure --prefix=/app/php --enable-mysqlnd --with-mysqli=mysqlnd --with-openssl --with-pdo-mysql=mysqlnd --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 --enable-maintainer-zts --disable-fileinfo
make && make install
(3)配置文件設置
cp php.ini-production /etc/php.ini
vim /etc/httpd24/httpd.conf
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
#在文件最后寫入下面兩行代碼
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
(4)測試連接數據庫
[root@localhost htdocs]# vim mysql.php
<?php
$mysqli=new mysqli("172.20.10.5","wpuser","wppass");
if(mysqli_connect_errno()){
echo "連接數據庫失敗!";
$mysqli=null;
exit;
}
echo "連接數據庫成功!";
$mysqli->close();
?>
4.設置wordpress
(1)解壓wordpress包
tar xvf wordpress-4.9.4-zh_CN.tar.gz
mv wordpress /app/httpd24/htdocs/blog
(2)修改wordpress配置文件
[root@localhost blog]# vim wp-config.php
// ** MySQL 設置 - 具體信息來自您正在使用的主機 ** //
/** WordPress數據庫的名稱 */
define('DB_NAME', 'wordpress');
/** MySQL數據庫用戶名 */
define('DB_USER', 'wpuser');
/** MySQL數據庫密碼 */
define('DB_PASSWORD', 'wppass');
/** MySQL主機 */
define('DB_HOST', '172.20.10.5');
/** 創建數據表時默認的文字編碼 */
define('DB_CHARSET', 'utf8');
(3)設置登錄賬號
(4)登錄:
(5)訪問:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。