Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

関与:Linuxの/ Centos7システムのApache MySQLのPHP

I.はじめに

記事はWebとHTTP基本に関連するプロトコルに焦点を当て、知識の理論の基礎を築いてきた、我々はLAMPプラットフォームヘルプを展開するための実験を設定します。

LAMPアーキテクチャは、一緒に仕事が動的なWebサイトのサービスおよびアプリケーション開発環境を提供することをシステムとソフトウェアのセットを意味し、企業のウェブサイトは非常に成熟したアプリケーションモードの一つです。LAMPは、頭字語--linuxオペレーティングシステム、Apache Webサーバ、MySQLデータベースサーバ、PHP(またはPerlやPython)Webプログラミング言語です。

のは、具体的な実用的な操作手順を通じて全ビルドプロセスのLAMPアーキテクチャを教えてみましょう。

二、実際のプロセス構築するためのLAMPアーキテクチャ(詳細な手順で最後に、説明関連)

一般的には最初のLinuxオペレーティングシステムをインストールし、インストールに関する以前の記事では詳細にはあまりないCentos7を、繰り返します。

Apacheのは、MySQLとPHPコンポーネントのインストールに続いて、最終的にアーキテクチャをテストするためのフォーラムを使用しています。以下は、これらのプロセスの具体的な動作を説明します。

関連部品とアーカイブのリソース:

リンク:https://pan.baidu.com/s/1Q2hz5x85p_8JSnVe--Abtg
抽出コード:xfqf

次のようにリソースコンポーネントは次のとおりです。

[root@localhost LAMP-C7]# ls -lh
total 63M
-rw-r--r--. 1 root root 1.1M Dec 13 09:44 apr-1.6.2.tar.gz
-rw-r--r--. 1 root root 553K Dec 13 09:44 apr-util-1.6.0.tar.gz
-rw-r--r--. 1 root root 9.4M Dec 13 09:44 Discuz_X2.5_SC_UTF8.zip
-rw-r--r--. 1 root root 6.3M Dec 13 09:44 httpd-2.4.29.tar.bz2
-rw-r--r--. 1 root root  32M Dec 13 09:44 mysql-5.6.26.tar.gz
-rw-r--r--. 1 root root  14M Dec 13 09:44 php-5.6.11.tar.bz2

2.1Apacheマニュアル翻訳の部品実装工程

1.エキス3つのパケット

[root@localhost LAMP-C7]# tar zxf apr-1.6.2.tar.gz -C /opt/
[root@localhost LAMP-C7]# tar zxf apr-util-1.6.0.tar.gz -C /opt/
[root@localhost LAMP-C7]# tar jxf httpd-2.4.29.tar.bz2 -C /opt/
[root@localhost LAMP-C7]# cd /opt/
[root@localhost opt]# ls
apr-1.6.2  apr-util-1.6.0  httpd-2.4.29  rh
[root@localhost opt]# mv apr-1.6.2/ httpd-2.4.29/srclib/apr
[root@localhost opt]# mv apr-util-1.6.0/ httpd-2.4.29/srclib/apr-util
[root@localhost opt]# cd httpd-2.4.29/srclib/
[root@localhost srclib]# ls
apr  apr-util  Makefile.in
[root@localhost srclib]# cd ..
[root@localhost httpd-2.4.29]# ls
ABOUT_APACHE     BuildBin.dsp    emacs-style     LAYOUT        NOTICE            srclib
acinclude.m4     buildconf       httpd.dep       libhttpd.dep  NWGNUmakefile     support
Apache-apr2.dsw  CHANGES         httpd.dsp       libhttpd.dsp  os                test
Apache.dsw       CMakeLists.txt  httpd.mak       libhttpd.mak  README            VERSIONING
apache_probes.d  config.layout   httpd.spec      LICENSE       README.cmake
ap.d             configure       include         Makefile.in   README.platforms
build            configure.in    INSTALL         Makefile.win  ROADMAP
BuildAll.dsp     docs            InstallBin.dsp  modules       server

必要な環境パッケージをインストールします。2.

[root@localhost httpd-2.4.29]# yum install -y gcc gcc-c++ make pcre-devel perl expat-devel
Loaded plugins: fastestmirror, langpacks
base                                                                           | 3.6 kB  00:00:00     
extras                                                                         | 2.9 kB  00:00:00     
updates                                                                        | 2.9 kB  00:00:00     
(1/4): extras/7/x86_64/primary_db                                              | 153 kB  00:00:00     
(2/4): base/7/x86_64/group_gz                                                  | 165 kB  00:00:00     
(3/4): base/7/x86_64/primary_db                                                | 6.0 MB  00:00:12     
(4/4): updates/7/x86_64/primary_db                                             | 5.8 MB  00:00:48     
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.ustc.edu.cn
 * updates: ftp.sjtu.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-10.el7_3 will be installed
......//省略部分内容

Install  4 Packages (+6 Dependent packages)
Upgrade  2 Packages (+6 Dependent packages)

Total download size: 67 M
Downloading packages:

3.設定パラメータ

[root@localhost httpd-2.4.29]# ./configure \
> --prefix=/usr/local/httpd \
> --enable-so \
> --enable-rewrite \
> --enable-charset-lite \
> --enable-cgi 
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
......//省略部分内容
config.status: executing default commands
configure: summary of build options:

    Server Version: 2.4.29
    Install prefix: /usr/local/httpd
    C compiler:     gcc -std=gnu99
    CFLAGS:          -g -O2 -pthread  
    CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE  
    LDFLAGS:           
    LIBS:             
    C preprocessor: gcc -E

4.コンパイルしてインストールします(少し長く待って、mysqlは時間がかかり、しばらくお待ちください)

[root@localhost httpd-2.4.29]# make && make install
Making all in srclib
make[1]: Entering directory `/opt/httpd-2.4.29/srclib'
Making all in apr
make[2]: Entering directory `/opt/httpd-2.4.29/srclib/apr'
make[3]: Entering directory `/opt/httpd-2.4.29/srclib/apr'
/opt/httpd-2.4.29/srclib/apr/build/mkdir.sh tools
/bin/sh /opt/httpd-2.4.29/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread 
.......//省略部分内容
mkdir /usr/local/httpd/man
mkdir /usr/local/httpd/man/man1
mkdir /usr/local/httpd/man/man8
mkdir /usr/local/httpd/manual
make[1]: Leaving directory `/opt/httpd-2.4.29'
[root@localhost httpd-2.4.29]# 

5.最適化スタートアップスクリプトのパスとファイル

[root@localhost ~]#  cd
[root@localhost ~]#  cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
[root@localhost ~]#  vim /etc/init.d/httpd
[root@localhost ~]#  head /etc/init.d/httpd
#!/bin/sh
# chkconfig: 35 85 21
# description: Apache is a World Wide Web server
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
[root@localhost ~]# chkconfig --add httpd
[root@localhost ~]# 

6.メインプロファイルの設定

[root@localhost ~]# vim /usr/local/httpd/conf/httpd.conf 
[root@localhost ~]# head -197 /usr/local/httpd/conf/httpd.conf  | tail -1
ServerName www.lokott.com:80
[root@localhost ~]# head -52 /usr/local/httpd/conf/httpd.conf  | tail -2
Listen 192.168.68.132:80
#Listen 80

7.最適化プロファイル・パス(ソフトリンクを作成します)

[root@localhost ~]# ln -s /usr/local/httpd/conf/httpd.conf /etc/
[root@localhost ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin/

ファイアウォール機能やSELinuxをオフにします8.

[root@localhost ~]# systemctl stop firewalld.service 
[root@localhost ~]# setenforce 0

9.サービスの開始--service httpdの開始

10.テスト認証サービスは、成功オンになっています

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

2.2MySQLマニュアル翻訳の部品実装工程

1.解凍パッケージとパッケージのインストール環境

[root@localhost LAMP-C7]# tar zxf mysql-5.6.26.tar.gz -C /opt/
[root@localhost LAMP-C7]# cd /opt/mysql-5.6.26/
[root@localhost mysql-5.6.26]# ls -lh
total 668K
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 BUILD
-rw-r--r--.  1 7161 wheel  142 Jul 15  2015 BUILD-CMAKE
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 client
drwxr-xr-x.  4 7161 wheel 4.0K Jul 15  2015 cmake
-rw-r--r--.  1 7161 wheel  22K Jul 15  2015 CMakeLists.txt
drwxr-xr-x.  3 7161 wheel   21 Jul 15  2015 cmd-line-utils
-rw-r--r--.  1 7161 wheel  20K Jul 15  2015 config.h.cmake
-rw-r--r--.  1 7161 wheel  36K Jul 15  2015 configure.cmake
-rw-r--r--.  1 7161 wheel  18K Jul 15  2015 COPYING
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 dbug
drwxr-xr-x.  2 7161 wheel  102 Jul 15  2015 Docs
-rw-r--r--.  1 7161 wheel  65K Jul 15  2015 Doxyfile-perfschema
drwxr-xr-x.  3 7161 wheel  212 Jul 15  2015 extra
drwxr-xr-x.  4 7161 wheel 4.0K Jul 15  2015 include
-rw-r--r--.  1 7161 wheel 393K Jul 15  2015 INSTALL-SOURCE
-rw-r--r--.  1 7161 wheel  247 Jul 15  2015 INSTALL-WIN-SOURCE
drwxr-xr-x.  7 7161 wheel 4.0K Jul 15  2015 libevent
drwxr-xr-x.  3 7161 wheel  199 Jul 15  2015 libmysql
drwxr-xr-x.  3 7161 wheel  204 Jul 15  2015 libmysqld
drwxr-xr-x.  2 7161 wheel  221 Jul 15  2015 libservices
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 man
drwxr-xr-x. 10 7161 wheel 4.0K Jul 15  2015 mysql-test
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 mysys
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 mysys_ssl
drwxr-xr-x. 14 7161 wheel  207 Jul 15  2015 packaging
drwxr-xr-x.  9 7161 wheel  141 Jul 15  2015 plugin
-rw-r--r--.  1 7161 wheel 2.5K Jul 15  2015 README
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 regex
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 scripts
drwxr-xr-x.  4 7161 wheel  12K Jul 15  2015 sql
drwxr-xr-x.  5 7161 wheel 4.0K Jul 15  2015 sql-bench
drwxr-xr-x.  2 7161 wheel  125 Jul 15  2015 sql-common
drwxr-xr-x. 13 7161 wheel  169 Jul 15  2015 storage
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 strings
drwxr-xr-x.  5 7161 wheel 4.0K Jul 15  2015 support-files
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 tests
drwxr-xr-x.  5 7161 wheel  103 Jul 15  2015 unittest
-rw-r--r--.  1 7161 wheel   88 Jul 15  2015 VERSION
drwxr-xr-x.  3 7161 wheel 4.0K Jul 15  2015 vio
drwxr-xr-x.  2 7161 wheel   32 Jul 15  2015 win
drwxr-xr-x.  2 7161 wheel 4.0K Jul 15  2015 zlib
[root@localhost mysql-5.6.26]# yum install ncurses-devel cmake autoconf -y
......//省略部分内容

2.パラメータの設定

[root@localhost mysql-5.6.26]# cmake \
> -DCMKE_INSTALL_PREFIX=/usr/local/mysql \
> -DDEFAULT_CHARSET=utf8 \
> -DDEFAULT_COLLATION=utf8_general_ci \
> -DEXTRA_CHARSETS=all \
> -DSYSCONFIDIR=/etc \
> -DMYSQL_DATADIR=/home/mysql \
> -DMYSQL_UNIX_ADDR=/home/mysql/mysql.sock
......//省略部分内容
-- Build files have been written to: /opt/mysql-5.6.26
[root@localhost mysql-5.6.26]# 

3.コンパイルしてインストールします(長く、しばらくお待ちください)


[root@localhost mysql-5.6.26]# make && make install
......//省略部分内容
-- Installing: /usr/local/mysql/sql-bench/innotest1a
-- Installing: /usr/local/mysql/sql-bench/run-all-tests
-- Installing: /usr/local/mysql/sql-bench/innotest2
-- Installing: /usr/local/mysql/sql-bench/test-wisconsin
-- Installing: /usr/local/mysql/sql-bench/compare-results
-- Installing: /usr/local/mysql/sql-bench/bench-init.pl
[root@localhost mysql-5.6.26]# 

4.最適化プロセス

[root@localhost mysql-5.6.26]# ls
BUILD                COPYING                  INSTALL-SOURCE      mysys_ssl         strings
BUILD-CMAKE          CPackConfig.cmake        INSTALL-WIN-SOURCE  packaging         support-files
client               CPackSourceConfig.cmake  libevent            plugin            tests
cmake                CTestTestfile.cmake      libmysql            README            unittest
CMakeCache.txt       dbug                     libmysqld           regex             VERSION
CMakeFiles           Docs                     libservices         scripts           VERSION.dep
cmake_install.cmake  Doxyfile-perfschema      make_dist.cmake     source_downloads  vio
CMakeLists.txt       extra                    Makefile            sql               win
cmd-line-utils       include                  man                 sql-bench         zlib
config.h.cmake       info_macros.cmake        mysql-test          sql-common
configure.cmake      install_manifest.txt     mysys               storage
[root@localhost mysql-5.6.26]# \cp support-files/my-default.cnf /etc/my.cnf
[root@localhost mysql-5.6.26]# cp support-files/mysql.server /etc/init.d/mysqld
[root@localhost mysql-5.6.26]# chmod 755 /etc/init.d/mysqld 
[root@localhost mysql-5.6.26]# chkconfig --add /etc/init.d/mysqld
[root@localhost mysql-5.6.26]# chkconfig mysqld --level 235 on

5.最適化コマンドの環境変数

[root@localhost mysql-5.6.26]# echo "PATH=$PATH:/usr/local/mysql/bin/" >> /etc/profile
[root@localhost mysql-5.6.26]# source /etc/profile
[root@localhost mysql-5.6.26]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin/

ユーザプログラムを追加6

[root@localhost mysql-5.6.26]# useradd -s /sbin/nologin mysql
[root@localhost mysql-5.6.26]# chown -R mysql.mysql /usr/local/mysql/

7.データベースを初期化します

[root@localhost mysql-5.6.26]# /usr/local/mysql/scripts/mysql_install_db \
> --user=mysql \
> --ldata=/var/lib/mysql \
> --basedir=/usr/local/mysql \
> --datadir=/home/mysql
.......//省略部分内容
[root@localhost mysql-5.6.26]#

8.変更スタートアップスクリプトおよびサービスを開始

[root@localhost mysql-5.6.26]# ln -s /var/lib/mysql/mysql.sock /home/mysql/mysql.sock
[root@localhost mysql-5.6.26]# vim /etc/init.d/mysqld 
[root@localhost mysql-5.6.26]# head -47 /etc/init.d/mysqld |tail -2
basedir=/usr/local/mysql
datadir=/home/mysql
[root@localhost mysql-5.6.26]# service mysqld start
Starting MySQL. SUCCESS! 
[root@localhost mysql-5.6.26]# netstat -natp | grep 3306
tcp6       0      0 :::3306                 :::*                    LISTEN      80619/mysqld    

9.管理者パスワードを設定します

[root@localhost mysql-5.6.26]# mysqladmin -u root -p password "123456"
Enter password: 
Warning: Using a password on the command line interface can be insecure.

10.検証データベースのビューを入力します。

[root@localhost mysql-5.6.26]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.26 Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit
Bye
[root@localhost mysql-5.6.26]# 

2.3PHPマニュアル翻訳の部品実装工程

1.パッケージを解凍し、必要な環境をインストールします

[root@localhost LAMP-C7]# tar jxf php-5.6.11.tar.bz2 -C /opt/
[root@localhost LAMP-C7]# yum install -y gd libpng libpng-devel libjpeg-devel pcre libxml2-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.ustc.edu.cn
 * updates: ftp.sjtu.edu.cn
Package gd-2.0.35-26.el7.x86_64 already installed and latest version
Package 2:libpng-1.5.13-7.el7_2.x86_64 already installed and latest version
Package pcre-8.32-17.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-8.el7 will be installed
.......//省略部分内容

2.パラメータのコンフィギュレーション設定

[root@localhost LAMP-C7]# cd /opt/php-5.6.11/
[root@localhost php-5.6.11]# ls
acinclude.m4      install-sh           README.EXT_SKEL                   sapi
aclocal.m4        LICENSE              README.GIT-RULES                  scripts
build             ltmain.sh            README.input_filter               server-tests-config.php
buildconf         main                 README.MAILINGLIST_RULES          server-tests.php
buildconf.bat     makedist             README.md                         snapshot
CODING_STANDARDS  Makefile.frag        README.namespaces                 stamp-h.in
config.guess      Makefile.gcov        README.NEW-OUTPUT-API             stub.c
config.sub        Makefile.global      README.PARAMETER_PARSING_API      tests
configure         makerpm              README.REDIST.BINS                travis
configure.in      missing              README.RELEASE_PROCESS            TSRM
CREDITS           mkinstalldirs        README.SELF-CONTAINED-EXTENSIONS  UPGRADING
ext               netware              README.STREAMS                    UPGRADING.INTERNALS
EXTENSIONS        NEWS                 README.SUBMITTING_PATCH           vcsclean
footer            pear                 README.TESTING                    win32
generated_lists   php5.spec.in         README.TESTING2                   Zend
genfiles          php.gif              README.UNIX-BUILD-SYSTEM
header            php.ini-development  README.WIN32-BUILD-SYSTEM
INSTALL           php.ini-production   run-tests.php

3.コンパイルとインストール

[root@localhost php-5.6.11]# ./configure \
> --prefix=/usr/local/php5 \
> --with-gd \
> --with-zlib \
> --with-apxs2=/usr/local/httpd/bin/apxs \
> --with-mysql=/usr/local/mysql \
> --with-config-file-path=/usr/local/mysql \
> --enable-mbstring

checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... x86_64-unknown-linux-gnu
.....//省略部分内容

4.最適化ファイルとマスター設定ファイル変更(PHPのバックエンドスクリプトが起動しない、主な設定は、設定ファイルです)

[root@localhost php-5.6.11]# make && make install
.......//省略部分内容
/opt/php-5.6.11/build/shtool install -c ext/phar/phar.phar /usr/local/php5/bin
ln -s -f phar.phar /usr/local/php5/bin/phar
Installing PDO headers:          /usr/local/php5/include/php/ext/pdo/
[root@localhost php-5.6.11]# 

5.設定の指定されたディレクトリにファイルと最適化されたコマンド(ソフトリンクを作成します)

[root@localhost php-5.6.11]# ls
acinclude.m4      INSTALL             NEWS                              README.TESTING2
aclocal.m4        install-sh          pear                              README.UNIX-BUILD-SYSTEM
build             libphp5.la          php5.spec                         README.WIN32-BUILD-SYSTEM
buildconf         libs                php5.spec.in                      run-tests.php
buildconf.bat     libtool             php.gif                           sapi
CODING_STANDARDS  LICENSE             php.ini-development               scripts
config.guess      ltmain.sh           php.ini-production                server-tests-config.php
config.log        main                README.EXT_SKEL                   server-tests.php
config.nice       makedist            README.GIT-RULES                  snapshot
config.status     Makefile            README.input_filter               stamp-h.in
config.sub        Makefile.frag       README.MAILINGLIST_RULES          stub.c
configure         Makefile.fragments  README.md                         tests
configure.in      Makefile.gcov       README.namespaces                 travis
CREDITS           Makefile.global     README.NEW-OUTPUT-API             TSRM
ext               Makefile.objects    README.PARAMETER_PARSING_API      UPGRADING
EXTENSIONS        makerpm             README.REDIST.BINS                UPGRADING.INTERNALS
footer            meta_ccld           README.RELEASE_PROCESS            vcsclean
generated_lists   missing             README.SELF-CONTAINED-EXTENSIONS  win32
genfiles          mkinstalldirs       README.STREAMS                    Zend
header            modules             README.SUBMITTING_PATCH
include           netware             README.TESTING
[root@localhost php-5.6.11]# cp php.ini-development /usr/local/php5/php.ini
[root@localhost php-5.6.11]# ln -s /usr/local/php5/bin/* /usr/local/bin/

前記構成マスタプロファイル

[root@localhost php-5.6.11]# vim /etc/httpd.conf 
[root@localhost php-5.6.11]# head -256 /etc/httpd.conf |tail -1
    DirectoryIndex index.html index.php
[root@localhost php-5.6.11]# head -395 /etc/httpd.conf |tail -4
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php  
    AddType application/x-httpd-php-source .phps
[root@localhost php-5.6.11]# 

7.設定PHPファイルとhttpdサービスを再起動します

[root@localhost php-5.6.11]# cd /usr/local/httpd/htdocs/
[root@localhost htdocs]# cp index.html index.php
[root@localhost htdocs]# vim index.php 
[root@localhost htdocs]# cat index.php 
<?php
phpinfo();
?>
[root@localhost htdocs]# service httpd stop
[root@localhost htdocs]# service httpd start

8.ローカル検証テスト

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

2.4フォーラムは、アーキテクチャをテストするように設定しました

[root@localhost LAMP-C7]# ls
apr-1.6.2.tar.gz       Discuz_X2.5_SC_UTF8.zip  mysql-5.6.26.tar.gz
apr-util-1.6.0.tar.gz  httpd-2.4.29.tar.bz2     php-5.6.11.tar.bz2
[root@localhost LAMP-C7]# 
[root@localhost LAMP-C7]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26 Source distribution

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database lokott;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| lokott             |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)

mysql> grant all on lokott.* to 'myuser'@'%' identified by 'admin123';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@localhost LAMP-C7]# 
[root@localhost LAMP-C7]# unzip Discuz_X2.5_SC_UTF8.zip -d /opt/
....../省略部分内容
[root@localhost proc]# cd /opt/
[root@localhost opt]# ls
httpd-2.4.29  mysql-5.6.26  php-5.6.11  readme  rh  upload  utility
[root@localhost opt]# cd upload/
[root@localhost upload]# cd ..
[root@localhost opt]# ls
httpd-2.4.29  mysql-5.6.26  php-5.6.11  readme  rh  upload  utility
[root@localhost opt]# cp -r upload/ /usr/local/httpd/htdocs/lokott
[root@localhost opt]# cd /usr/local/httpd/htdocs/
[root@localhost htdocs]# ls
index.html  index.php  lokott
[root@localhost htdocs]# cd lokott/
[root@localhost lokott]# ls
admin.php  config           data         home.php    misc.php    search.php  uc_client
api        connect.php      favicon.ico  index.php   plugin.php  source      uc_server
api.php    cp.php           forum.php    install     portal.php  static      userapp.php
archiver   crossdomain.xml  group.php    member.php  robots.txt  template
[root@localhost lokott]# 

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

この場合には、状態が書き込み可能でないか、またはディレクトリが存在しないことが判明ルートにファイルディレクトリ相当の所有者理由

[root@localhost lokott]# ls -l
total 76
-rw-r--r--.  1 root root 2603 Dec 13 12:20 admin.php
drwxr-xr-x. 11 root root  163 Dec 13 12:20 api
-rw-r--r--.  1 root root  727 Dec 13 12:20 api.php
drwxr-xr-x.  2 root root   23 Dec 13 12:20 archiver
drwxr-xr-x.  2 root root   90 Dec 13 12:20 config
-rw-r--r--.  1 root root  922 Dec 13 12:20 connect.php
-rw-r--r--.  1 root root  253 Dec 13 12:20 cp.php
-rw-r--r--.  1 root root  106 Dec 13 12:20 crossdomain.xml
drwxr-xr-x. 13 root root  216 Dec 13 12:20 data
-rw-r--r--.  1 root root 5558 Dec 13 12:20 favicon.ico
-rw-r--r--.  1 root root 2110 Dec 13 12:20 forum.php
-rw-r--r--.  1 root root  823 Dec 13 12:20 group.php
-rw-r--r--.  1 root root 1223 Dec 13 12:20 home.php
-rw-r--r--.  1 root root 5448 Dec 13 12:20 index.php
drwxr-xr-x.  5 root root   64 Dec 13 12:20 install
-rw-r--r--.  1 root root 1040 Dec 13 12:20 member.php
-rw-r--r--.  1 root root 1381 Dec 13 12:20 misc.php
-rw-r--r--.  1 root root 1757 Dec 13 12:20 plugin.php
-rw-r--r--.  1 root root  985 Dec 13 12:20 portal.php
-rw-r--r--.  1 root root  582 Dec 13 12:20 robots.txt
-rw-r--r--.  1 root root 1158 Dec 13 12:20 search.php
drwxr-xr-x. 10 root root  168 Dec 13 12:20 source
drwxr-xr-x.  6 root root   72 Dec 13 12:20 static
drwxr-xr-x.  3 root root   38 Dec 13 12:20 template
drwxr-xr-x.  6 root root   92 Dec 13 12:20 uc_client
drwxr-xr-x. 13 root root  241 Dec 13 12:20 uc_server
-rw-r--r--.  1 root root 1691 Dec 13 12:20 userapp.php
[root@localhost lokott]# chown -R daemon config/
[root@localhost lokott]# chown -R daemon data/
[root@localhost lokott]# chown -R daemon uc_client/
[root@localhost lokott]# chown -R daemon uc_server/

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

Webサーバー(LAMPアーキテクチャビルド)のクラスタを展開するLAMPプラットフォーム

おすすめ

転載: blog.51cto.com/14557673/2458878