凤儿 发表于 2015-2-4 08:25:34

CentOS7.0 LAMP环境搭建

最近参加了HPconf大会,抽中了UCloud的云主机使用券,试用期为一个月,操作系统为CentOS 7.0版本,然后在上面搭建了LAMP环境,主要是用来做实验用。

;-)

# 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



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# 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
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
... 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
... 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
- 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
... 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!






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# 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
================================================================================================
Install1 Package (+3 Dependent packages)
Total download size: 4.7 M
Installed size: 17 M
Is this ok : y
Downloading packages:
(1/4): libzip-0.10.1-8.el7.x86_64.rpm                                    |48 kB00:00:00   
(2/4): php-cli-5.4.16-23.el7_0.3.x86_64.rpm                              | 2.7 MB00:00:00   
(3/4): php-common-5.4.16-23.el7_0.3.x86_64.rpm                           | 561 kB00:00:00   
(4/4): php-5.4.16-23.el7_0.3.x86_64.rpm                                  | 1.3 MB00:00:01   
------------------------------------------------------------------------------------------------
Total                                                         2.5 MB/s | 4.7 MB00: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!
# 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
================================================================================================
Install13 Packages (+12 Dependent packages)
Total download size: 4.0 M
Installed size: 13 M
Is this ok : y
Downloading packages:
(1/25): libX11-1.6.0-2.1.el7.x86_64.rpm                                  | 605 kB00:00:00   
(2/25): libXau-1.0.8-2.1.el7.x86_64.rpm                                  |29 kB00:00:00   
(3/25): libXpm-3.5.10-5.1.el7.x86_64.rpm                                 |52 kB00:00:00   
(4/25): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm                            | 134 kB00:00:00   
(5/25): libjpeg-turbo-devel-1.2.90-5.el7.x86_64.rpm                      |98 kB00:00:00   
(6/25): libjpeg-turbo-static-1.2.90-5.el7.x86_64.rpm                     | 120 kB00:00:00   
(7/25): libjpeg-turbo-utils-1.2.90-5.el7.x86_64.rpm                      |76 kB00:00:00   
(8/25): libpng-1.5.13-5.el7.x86_64.rpm                                 | 212 kB00:00:00   
(9/25): libtool-ltdl-2.4.2-20.el7.x86_64.rpm                           |49 kB00:00:00   
(10/25): libxcb-1.9-5.el7.x86_64.rpm                                     | 169 kB00:00:00   
(11/25): libxslt-1.1.28-5.el7.x86_64.rpm                                 | 242 kB00:00:00   
(12/25): php-gd-5.4.16-23.el7_0.3.x86_64.rpm                           | 124 kB00:00:00   
(13/25): php-ldap-5.4.16-23.el7_0.3.x86_64.rpm                           |49 kB00:00:00   
(14/25): php-mbstring-5.4.16-23.el7_0.3.x86_64.rpm                     | 501 kB00:00:00   
(15/25): php-mysql-5.4.16-23.el7_0.3.x86_64.rpm                        |97 kB00:00:00   
(16/25): php-odbc-5.4.16-23.el7_0.3.x86_64.rpm                           |62 kB00:00:00   
(17/25): php-pdo-5.4.16-23.el7_0.3.x86_64.rpm                            |95 kB00:00:00   
(18/25): php-process-5.4.16-23.el7_0.3.x86_64.rpm                        |52 kB00:00:00   
(19/25): php-xml-5.4.16-23.el7_0.3.x86_64.rpm                            | 122 kB00:00:00   
(20/25): php-xmlrpc-5.4.16-23.el7_0.3.x86_64.rpm                         |64 kB00:00:00   
(21/25): php-pear-1.9.4-21.el7.noarch.rpm                              | 357 kB00:00:00   
(22/25): t1lib-5.1.2-14.el7.x86_64.rpm                                 | 166 kB00:00:00   
(23/25): unixODBC-2.3.1-10.el7.x86_64.rpm                              | 413 kB00:00:00   
(24/25): libX11-common-1.6.0-2.1.el7.noarch.rpm                        | 181 kB00:00:03   
(25/25): php-bcmath-5.4.16-23.el7_0.3.x86_64.rpm                         |54 kB00:00:02   
------------------------------------------------------------------------------------------------
Total                                                         1.2 MB/s | 4.0 MB00: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!






1
2
3
4
5
6
7
8
9
10
11
12
# 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 #删除默认测试页






1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 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
# systemctl restart mariadb.service
# systemctl restart httpd.service
# cd /var/www/html/
# ls
# vi index.php
#



页: [1]
查看完整版本: CentOS7.0 LAMP环境搭建