CentOS 7的Lamp

CentOS 7 lamp


首先安装http服务:

# yum -y install httpd 

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : apr-1.4.8-3.el7.x86_64                            1/5 

  Installing : apr-util-1.5.2-6.el7.x86_64                       2/5 

  Installing : httpd-tools-2.4.6-18.el7.centos.x86_64            3/5 

  Installing : mailcap-2.1.41-2.el7.noarch                       4/5 

  Installing : httpd-2.4.6-18.el7.centos.x86_64                  5/5 

  Verifying  : mailcap-2.1.41-2.el7.noarch                       1/5 

  Verifying  : httpd-tools-2.4.6-18.el7.centos.x86_64            2/5 

  Verifying  : apr-util-1.5.2-6.el7.x86_64                       3/5 

  Verifying  : apr-1.4.8-3.el7.x86_64                            4/5 

  Verifying  : httpd-2.4.6-18.el7.centos.x86_64                  5/5

Installed:

  httpd.x86_64 0:2.4.6-18.el7.centos                                                           

Dependency Installed:

  apr.x86_64 0:1.4.8-3.el7                       apr-util.x86_64 0:1.5.2-6.el7           

  httpd-tools.x86_64 0:2.4.6-18.el7.centos       mailcap.noarch 0:2.1.41-2.el7



其次安装mariadb服务 yum安装可以有效解决软件包之间的依赖关系

# yum -y install mariadb mariadb-server

# cp /usr/share/mysql/my-small.cnf /etc/my.cnf


# mysql_secure_installation 

/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none): 

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Enter current password for root (enter for none): 

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Enter current password for root (enter for none): 

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] Y

New password: 

Re-enter new password: 

Password updated successfully!

Reloading privilege tables..

... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] Y

... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y

... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] Y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] Y

... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!


安装php服务

# yum install php

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package php.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: php-common(x86-64) = 5.4.16-23.el7_0.3 for package: php-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: php-cli(x86-64) = 5.4.16-23.el7_0.3 for package: php-5.4.16-23.el7_0.3.x86_64

--> Running transaction check

---> Package php-cli.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-common.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-23.el7_0.3.x86_64

--> Running transaction check

---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================

Package               Arch              Version                       Repository          Size

================================================================================================

Installing:

php                   x86_64            5.4.16-23.el7_0.3             updates            1.3 M

Installing for dependencies:

libzip                x86_64            0.10.1-8.el7                  base                48 k

php-cli               x86_64            5.4.16-23.el7_0.3             updates            2.7 M

php-common            x86_64            5.4.16-23.el7_0.3             updates            561 k

Transaction Summary

================================================================================================

Install  1 Package (+3 Dependent packages)

Total download size: 4.7 M

Installed size: 17 M

Is this ok [y/d/N]: y

Downloading packages:

(1/4): libzip-0.10.1-8.el7.x86_64.rpm                                    |  48 kB  00:00:00     

(2/4): php-cli-5.4.16-23.el7_0.3.x86_64.rpm                              | 2.7 MB  00:00:00     

(3/4): php-common-5.4.16-23.el7_0.3.x86_64.rpm                           | 561 kB  00:00:00     

(4/4): php-5.4.16-23.el7_0.3.x86_64.rpm                                  | 1.3 MB  00:00:01     

------------------------------------------------------------------------------------------------

Total                                                           2.5 MB/s | 4.7 MB  00:00:01     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libzip-0.10.1-8.el7.x86_64                                                   1/4 

  Installing : php-common-5.4.16-23.el7_0.3.x86_64                                          2/4 

  Installing : php-cli-5.4.16-23.el7_0.3.x86_64                                             3/4 

  Installing : php-5.4.16-23.el7_0.3.x86_64                                                 4/4 

  Verifying  : php-cli-5.4.16-23.el7_0.3.x86_64                                             1/4 

  Verifying  : php-common-5.4.16-23.el7_0.3.x86_64                                          2/4 

  Verifying  : libzip-0.10.1-8.el7.x86_64                                                   3/4 

  Verifying  : php-5.4.16-23.el7_0.3.x86_64                                                 4/4

Installed:

  php.x86_64 0:5.4.16-23.el7_0.3                                                               

Dependency Installed:

  libzip.x86_64 0:0.10.1-8.el7                     php-cli.x86_64 0:5.4.16-23.el7_0.3           

  php-common.x86_64 0:5.4.16-23.el7_0.3          

Complete!

[root@10-4-23-28 ~]# yum install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Package php-common-5.4.16-23.el7_0.3.x86_64 already installed and latest version

Resolving Dependencies

--> Running transaction check

---> Package libjpeg-turbo.x86_64 0:1.2.90-5.el7 will be installed

---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7 will be installed

---> Package libjpeg-turbo-static.x86_64 0:1.2.90-5.el7 will be installed

---> Package libjpeg-turbo-utils.x86_64 0:1.2.90-5.el7 will be installed

---> Package php-bcmath.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-gd.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: libpng15.so.15(PNG15_0)(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libt1.so.5()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libpng15.so.15()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libXpm.so.4()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libX11.so.6()(64bit) for package: php-gd-5.4.16-23.el7_0.3.x86_64

---> Package php-ldap.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-mbstring.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-mysql.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: php-pdo(x86-64) = 5.4.16-23.el7_0.3 for package: php-mysql-5.4.16-23.el7_0.3.x86_64

---> Package php-odbc.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: libodbc.so.2()(64bit) for package: php-odbc-5.4.16-23.el7_0.3.x86_64

---> Package php-pear.noarch 1:1.9.4-21.el7 will be installed

--> Processing Dependency: php-posix for package: 1:php-pear-1.9.4-21.el7.noarch

---> Package php-xml.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libxslt.so.1()(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

--> Processing Dependency: libexslt.so.0()(64bit) for package: php-xml-5.4.16-23.el7_0.3.x86_64

---> Package php-xmlrpc.x86_64 0:5.4.16-23.el7_0.3 will be installed

--> Running transaction check

---> Package libX11.x86_64 0:1.6.0-2.1.el7 will be installed

--> Processing Dependency: libX11-common = 1.6.0-2.1.el7 for package: libX11-1.6.0-2.1.el7.x86_64

--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.0-2.1.el7.x86_64

---> Package libXpm.x86_64 0:3.5.10-5.1.el7 will be installed

---> Package libpng.x86_64 2:1.5.13-5.el7 will be installed

---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed

---> Package php-pdo.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package php-process.x86_64 0:5.4.16-23.el7_0.3 will be installed

---> Package t1lib.x86_64 0:5.1.2-14.el7 will be installed

---> Package unixODBC.x86_64 0:2.3.1-10.el7 will be installed

--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-10.el7.x86_64

--> Running transaction check

---> Package libX11-common.noarch 0:1.6.0-2.1.el7 will be installed

---> Package libtool-ltdl.x86_64 0:2.4.2-20.el7 will be installed

---> Package libxcb.x86_64 0:1.9-5.el7 will be installed

--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.9-5.el7.x86_64

--> Running transaction check

---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================

Package                      Arch           Version                      Repository       Size

================================================================================================

Installing:

libjpeg-turbo                x86_64         1.2.90-5.el7                 base            134 k

libjpeg-turbo-devel          x86_64         1.2.90-5.el7                 base             98 k

libjpeg-turbo-static         x86_64         1.2.90-5.el7                 base            120 k

libjpeg-turbo-utils          x86_64         1.2.90-5.el7                 base             76 k

php-bcmath                   x86_64         5.4.16-23.el7_0.3            updates          54 k

php-gd                       x86_64         5.4.16-23.el7_0.3            updates         124 k

php-ldap                     x86_64         5.4.16-23.el7_0.3            updates          49 k

php-mbstring                 x86_64         5.4.16-23.el7_0.3            updates         501 k

php-mysql                    x86_64         5.4.16-23.el7_0.3            updates          97 k

php-odbc                     x86_64         5.4.16-23.el7_0.3            updates          62 k

php-pear                     noarch         1:1.9.4-21.el7               base            357 k

php-xml                      x86_64         5.4.16-23.el7_0.3            updates         122 k

php-xmlrpc                   x86_64         5.4.16-23.el7_0.3            updates          64 k

Installing for dependencies:

libX11                       x86_64         1.6.0-2.1.el7                base            605 k

libX11-common                noarch         1.6.0-2.1.el7                base            181 k

libXau                       x86_64         1.0.8-2.1.el7                base             29 k

libXpm                       x86_64         3.5.10-5.1.el7               base             52 k

libpng                       x86_64         2:1.5.13-5.el7               base            212 k

libtool-ltdl                 x86_64         2.4.2-20.el7                 base             49 k

libxcb                       x86_64         1.9-5.el7                    base            169 k

libxslt                      x86_64         1.1.28-5.el7                 base            242 k

php-pdo                      x86_64         5.4.16-23.el7_0.3            updates          95 k

php-process                  x86_64         5.4.16-23.el7_0.3            updates          52 k

t1lib                        x86_64         5.1.2-14.el7                 base            166 k

unixODBC                     x86_64         2.3.1-10.el7                 base            413 k

Transaction Summary

================================================================================================

Install  13 Packages (+12 Dependent packages)

Total download size: 4.0 M

Installed size: 13 M

Is this ok [y/d/N]: y

Downloading packages:

(1/25): libX11-1.6.0-2.1.el7.x86_64.rpm                                  | 605 kB  00:00:00     

(2/25): libXau-1.0.8-2.1.el7.x86_64.rpm                                  |  29 kB  00:00:00     

(3/25): libXpm-3.5.10-5.1.el7.x86_64.rpm                                 |  52 kB  00:00:00     

(4/25): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm                            | 134 kB  00:00:00     

(5/25): libjpeg-turbo-devel-1.2.90-5.el7.x86_64.rpm                      |  98 kB  00:00:00     

(6/25): libjpeg-turbo-static-1.2.90-5.el7.x86_64.rpm                     | 120 kB  00:00:00     

(7/25): libjpeg-turbo-utils-1.2.90-5.el7.x86_64.rpm                      |  76 kB  00:00:00     

(8/25): libpng-1.5.13-5.el7.x86_64.rpm                                   | 212 kB  00:00:00     

(9/25): libtool-ltdl-2.4.2-20.el7.x86_64.rpm                             |  49 kB  00:00:00     

(10/25): libxcb-1.9-5.el7.x86_64.rpm                                     | 169 kB  00:00:00     

(11/25): libxslt-1.1.28-5.el7.x86_64.rpm                                 | 242 kB  00:00:00     

(12/25): php-gd-5.4.16-23.el7_0.3.x86_64.rpm                             | 124 kB  00:00:00     

(13/25): php-ldap-5.4.16-23.el7_0.3.x86_64.rpm                           |  49 kB  00:00:00     

(14/25): php-mbstring-5.4.16-23.el7_0.3.x86_64.rpm                       | 501 kB  00:00:00     

(15/25): php-mysql-5.4.16-23.el7_0.3.x86_64.rpm                          |  97 kB  00:00:00     

(16/25): php-odbc-5.4.16-23.el7_0.3.x86_64.rpm                           |  62 kB  00:00:00     

(17/25): php-pdo-5.4.16-23.el7_0.3.x86_64.rpm                            |  95 kB  00:00:00     

(18/25): php-process-5.4.16-23.el7_0.3.x86_64.rpm                        |  52 kB  00:00:00     

(19/25): php-xml-5.4.16-23.el7_0.3.x86_64.rpm                            | 122 kB  00:00:00     

(20/25): php-xmlrpc-5.4.16-23.el7_0.3.x86_64.rpm                         |  64 kB  00:00:00     

(21/25): php-pear-1.9.4-21.el7.noarch.rpm                                | 357 kB  00:00:00     

(22/25): t1lib-5.1.2-14.el7.x86_64.rpm                                   | 166 kB  00:00:00     

(23/25): unixODBC-2.3.1-10.el7.x86_64.rpm                                | 413 kB  00:00:00     

(24/25): libX11-common-1.6.0-2.1.el7.noarch.rpm                          | 181 kB  00:00:03     

(25/25): php-bcmath-5.4.16-23.el7_0.3.x86_64.rpm                         |  54 kB  00:00:02     

------------------------------------------------------------------------------------------------

Total                                                           1.2 MB/s | 4.0 MB  00:00:03     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libjpeg-turbo-1.2.90-5.el7.x86_64                                           1/25 

  Installing : php-pdo-5.4.16-23.el7_0.3.x86_64                                            2/25 

  Installing : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                                     3/25 

  Installing : php-process-5.4.16-23.el7_0.3.x86_64                                        4/25 

  Installing : libXau-1.0.8-2.1.el7.x86_64                                                 5/25 

  Installing : libxcb-1.9-5.el7.x86_64                                                     6/25 

  Installing : libxslt-1.1.28-5.el7.x86_64                                                 7/25 

  Installing : php-xml-5.4.16-23.el7_0.3.x86_64                                            8/25 

  Installing : 2:libpng-1.5.13-5.el7.x86_64                                                9/25 

  Installing : libtool-ltdl-2.4.2-20.el7.x86_64                                           10/25 

  Installing : unixODBC-2.3.1-10.el7.x86_64                                               11/25 

  Installing : libX11-common-1.6.0-2.1.el7.noarch                                         12/25 

  Installing : libX11-1.6.0-2.1.el7.x86_64                                                13/25 

  Installing : libXpm-3.5.10-5.1.el7.x86_64                                               14/25 

  Installing : t1lib-5.1.2-14.el7.x86_64                                                  15/25 

  Installing : php-gd-5.4.16-23.el7_0.3.x86_64                                            16/25 

  Installing : php-odbc-5.4.16-23.el7_0.3.x86_64                                          17/25 

  Installing : 1:php-pear-1.9.4-21.el7.noarch                                             18/25 

  Installing : libjpeg-turbo-static-1.2.90-5.el7.x86_64                                   19/25 

  Installing : php-mysql-5.4.16-23.el7_0.3.x86_64                                         20/25 

  Installing : libjpeg-turbo-utils-1.2.90-5.el7.x86_64                                    21/25 

  Installing : php-bcmath-5.4.16-23.el7_0.3.x86_64                                        22/25 

  Installing : php-mbstring-5.4.16-23.el7_0.3.x86_64                                      23/25 

  Installing : php-ldap-5.4.16-23.el7_0.3.x86_64                                          24/25 

  Installing : php-xmlrpc-5.4.16-23.el7_0.3.x86_64                                        25/25 

  Verifying  : php-xmlrpc-5.4.16-23.el7_0.3.x86_64                                         1/25 

  Verifying  : libjpeg-turbo-static-1.2.90-5.el7.x86_64                                    2/25 

  Verifying  : libjpeg-turbo-1.2.90-5.el7.x86_64                                           3/25 

  Verifying  : libX11-common-1.6.0-2.1.el7.noarch                                          4/25 

  Verifying  : libtool-ltdl-2.4.2-20.el7.x86_64                                            5/25 

  Verifying  : php-gd-5.4.16-23.el7_0.3.x86_64                                             6/25 

  Verifying  : libXpm-3.5.10-5.1.el7.x86_64                                                7/25 

  Verifying  : php-ldap-5.4.16-23.el7_0.3.x86_64                                           8/25 

  Verifying  : php-mbstring-5.4.16-23.el7_0.3.x86_64                                       9/25 

  Verifying  : libjpeg-turbo-devel-1.2.90-5.el7.x86_64                                    10/25 

  Verifying  : 2:libpng-1.5.13-5.el7.x86_64                                               11/25 

  Verifying  : php-xml-5.4.16-23.el7_0.3.x86_64                                           12/25 

  Verifying  : php-mysql-5.4.16-23.el7_0.3.x86_64                                         13/25 

  Verifying  : libxcb-1.9-5.el7.x86_64                                                    14/25 

  Verifying  : t1lib-5.1.2-14.el7.x86_64                                                  15/25 

  Verifying  : libxslt-1.1.28-5.el7.x86_64                                                16/25 

  Verifying  : unixODBC-2.3.1-10.el7.x86_64                                               17/25 

  Verifying  : php-odbc-5.4.16-23.el7_0.3.x86_64                                          18/25 

  Verifying  : libX11-1.6.0-2.1.el7.x86_64                                                19/25 

  Verifying  : php-pdo-5.4.16-23.el7_0.3.x86_64                                           20/25 

  Verifying  : libjpeg-turbo-utils-1.2.90-5.el7.x86_64                                    21/25 

  Verifying  : libXau-1.0.8-2.1.el7.x86_64                                                22/25 

  Verifying  : php-process-5.4.16-23.el7_0.3.x86_64                                       23/25 

  Verifying  : php-bcmath-5.4.16-23.el7_0.3.x86_64                                        24/25 

  Verifying  : 1:php-pear-1.9.4-21.el7.noarch                                             25/25

Installed:

  libjpeg-turbo.x86_64 0:1.2.90-5.el7             libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7     

  libjpeg-turbo-static.x86_64 0:1.2.90-5.el7      libjpeg-turbo-utils.x86_64 0:1.2.90-5.el7     

  php-bcmath.x86_64 0:5.4.16-23.el7_0.3           php-gd.x86_64 0:5.4.16-23.el7_0.3             

  php-ldap.x86_64 0:5.4.16-23.el7_0.3             php-mbstring.x86_64 0:5.4.16-23.el7_0.3       

  php-mysql.x86_64 0:5.4.16-23.el7_0.3            php-odbc.x86_64 0:5.4.16-23.el7_0.3           

  php-pear.noarch 1:1.9.4-21.el7                  php-xml.x86_64 0:5.4.16-23.el7_0.3            

  php-xmlrpc.x86_64 0:5.4.16-23.el7_0.3         

Dependency Installed:

  libX11.x86_64 0:1.6.0-2.1.el7                libX11-common.noarch 0:1.6.0-2.1.el7            

  libXau.x86_64 0:1.0.8-2.1.el7                libXpm.x86_64 0:3.5.10-5.1.el7                  

  libpng.x86_64 2:1.5.13-5.el7                 libtool-ltdl.x86_64 0:2.4.2-20.el7              

  libxcb.x86_64 0:1.9-5.el7                    libxslt.x86_64 0:1.1.28-5.el7                   

  php-pdo.x86_64 0:5.4.16-23.el7_0.3           php-process.x86_64 0:5.4.16-23.el7_0.3          

  t1lib.x86_64 0:5.1.2-14.el7                  unixODBC.x86_64 0:2.3.1-10.el7                 

Complete!


编辑http服务的配置文件

# vi /etc/httpd/conf/httpd.conf 

# vim !$

vim /etc/httpd/conf/httpd.conf

ServerSignature On #添加,在错误页中显示Apache的版本,Off为不显示

Options Indexes FollowSymLinks #修改为:Options Includes ExecCGI FollowSymLinks(允许服务器执行CGI及SSI,禁止列出目录)

#AddHandler cgi-script .cgi #修改为:AddHandler cgi-script .cgi .pl (允许扩展名为.pl的CGI脚本运行)

AllowOverride None  #修改为:AllowOverride All (允许.htaccess)

AddDefaultCharset UTF-8 #修改为:AddDefaultCharset GB2312 (添加GB2312为默认编码)

#Options Indexes FollowSymLinks #修改为 Options FollowSymLinks(不在浏览器上显示树状目录结构)

DirectoryIndex index.html #修改为:DirectoryIndex index.html index.htm Default.html Default.htm index.php(设置默认首页文件,增加index.php)

MaxKeepAliveRequests 500 #添加MaxKeepAliveRequests 500 (增加同时连接数)

# rm -f /etc/httpd/conf.d/welcome.conf /var/www/error/noindex.html #删除默认测试页


编辑网页服务器的配置文件

# vi /etc/php.ini 

# alias vi='vim'

# vi /etc/php.ini 

date.timezone = PRC

disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space,posix_ctermid,posix_get_last_error,posix_getcwd, posix_getegid,posix_geteuid,posix_getgid, posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, posix_getppid,posix_getpwnam,posix_getpwuid, posix_getrlimit, posix_getsid,posix_getuid,posix_isatty, posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid, posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname,posix_uname

expose_php = Off

short_open_tag = On

open_basedir = .:/tmp


启动mariadb和http服务

# systemctl restart mariadb.service

# systemctl restart httpd.service

# cd /var/www/html/

# ls


你可能感兴趣的:(linux,lamp,CentOS7,马哥linux,马鹏飞)