您好,登錄后才能下訂單哦!
涉及:Linux/Centos7系統 Apache Mysql PHP
? 上一篇文章主要講述了有關Web與HTTP協議的基礎知識,有了這一基礎知識理論的奠定,將對我們此次搭建部署LAMP平臺的實驗有所幫助。
? LAMP架構是非常成熟的企業網站應用模式之一,其指的是協同工作的一整套系統和相關軟件,能夠提供動態Web站點服務及其應用開發環境。LAMP是一個縮寫詞——Linux操作系統、Apache網站服務器、MySQL數據庫服務器、PHP(或Perl、Python)網頁編程語言。
?
下面我們通過具體實際操作流程來講述整個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
1.解壓三個包
[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/
8.關閉防火墻和SELinux功能
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
9.啟動服務——service httpd start
10.測試驗證服務是否開啟成功
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]#
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/
6.配置主配置文件
[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.本地測試驗證
[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]#
此時發現狀態都是不可寫或者說目錄不存在的,這是因為對應的文件目錄的屬主是root
[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/
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。