Fedora 11下如何安装LAMP
现在网上有很多关于LAMP的安装教程,但是由于方法非常的多,因此很多小伙伴们会不知道该如何选择,其主要安装有源代码编译、软件包安装等,那么你知道Fedora 11下如何安装LAMP吗?
1 前言附注
在本教程中,系统环境是:Fedora 11,我使用主机名:server1.example.com,IP地址:192.168.0.100。这个设置你可以根据你的情况来设定它。
2 安装MySQL 5
安装MySQL,执行如下代码:
yum install mysql mysql-server
软件为MySQL建立系统启动连接,这样MySQL就在随系统重启后自动启动。执行如下代码:
chkconfig –levels 235 mysqld on
/etc/init.d/mysqld start
运行MySQL(刚安装好MySQL后,请使用root用户更改密码)
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword
3 安装Apache2
Apache2在Fedora软件包中就可以使用,因此你可以这样来安装,执行如下命令:
yum install httpd
配置Apache启动模式
chkconfig –levels 235 httpd on
启动Apache:
/etc/init.d/httpd start
现在打开你的浏览器,并输入你的计算机IP地址: http://192.168.0.100,现在你可以看到Apache的默认页面。
![](https://pic2.zhimg.com/80/v2-aa0d07be3f0d4ef0e649506990bbfaf9_720w.png)
在Fedora上Apache的默认文档路径在: /var/www/html,配置文档在: /etc/httpd/conf/httpd.conf, 附加的配置文档在: /etc/httpd/conf.d/ 目录下.
4 安装PHP5
你可以安装PHP5和Apache PHP5模块,按下面方法来做:
yum install php
重启Apache:
/etc/init.d/httpd restart
5 测试PHP5 / 获得更多PHP5安装信息
Apache默认的网站执行目录在: /var/www/html目录下,你现在可以在那个目录下建立一个PHP文件 (如info.php),然后在浏览器上执行这个文件,这个文件将显示你安装PHP的相关系统,比如PHP版本等。
建立info.php文件
vi /var/www/html/info.php
输入以下代码
现在你可以在浏览器上执行 (如:http://192.168.0.100/info.php):
![](https://pic2.zhimg.com/80/v2-a97ba3a72b597d55907a77b9ca9d0ead_720w.png)
正如你看到的,PHP5现在可以工作了,通过Apache2.0来处理程序。如图所示MySQL还不支持。
6. 在PHP5中获得MySQL支持
在PHP5中获得MySQL支持,你可以安装php-mysql软件包,这种方法也可以安装一些其它的PHP5模块应用。 你可以搜索一下PHP5 模块,执行命令如下:
yum search php
选择你需要的安装包:
yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy
重启Apache2:
/etc/init.d/httpd restart
现在在你的浏览器上重新载入: http://192.168.0.100/info.php 你可以找到新的模块,包括了MySQL模块:
![](https://pic3.zhimg.com/80/v2-01f4280ee125ac493c980759c8273267_720w.png)
7 phpMyAdmin
phpMyAdmin是一个基于WEB的应用程序来管理MySQL数据库。phpMyAdmin安装如下:
yum install phpmyadmin
现在配置phpMyAdmin,我们需要更改Apache配置,用来访问phpMyAdmin应用:
建立配置文件:
vi /etc/httpd/conf.d/phpMyAdmin.conf
将以下代码复制到phpMyAdmin.conf中
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
#
# order deny,allow
# deny from all
# allow from 127.0.0.1
# allow from ::1
#
# This directory does not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
Order Deny,Allow
Deny from All
Allow from None
# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#
#
# SecRuleInheritance Off
#
#
重启 Apache:
/etc/init.d/httpd restart
访问phpMyAdmin应用:http://192.168.0.100/phpmyadmin/:
![](https://pic1.zhimg.com/80/v2-98f24fe89e8dbe99078b8b52a44b5108_720w.png)
以上就是关于Fedora 11下如何安装LAMP的内容,由于源代码编译安装方式需要涉及的知识比较多,因此对于新手们来说其实软件包安装是最简单快速的方法。
我司美国精美ip:
104.233.144.9
104.233.144.10
104.233.144.11
104.233.144.12
104.233.144.13
104.233.144.14
104.233.144.15
104.233.144.16
104.233.144.17
104.233.144.18
104.233.144.19
104.233.144.20
104.233.144.21
104.233.144.22
104.233.144.23
104.233.144.24
104.233.144.25
104.233.144.26
104.233.144.27
104.233.144.28
104.233.144.29
104.233.144.30
104.233.144.31
104.233.144.32
104.233.144.33
104.233.144.34
104.233.144.35
104.233.144.36
104.233.144.37
104.233.144.38
104.233.144.39
104.233.144.40
104.233.144.41
104.233.144.42
104.233.144.43
104.233.144.44
104.233.144.45
104.233.144.46
104.233.144.47
104.233.144.48
104.233.144.49
104.233.144.50
104.233.144.51
104.233.144.52
104.233.144.53
104.233.144.54
104.233.144.55
104.233.144.56
104.233.144.57
104.233.144.58
104.233.144.59
104.233.144.60
104.233.144.61
104.233.144.62
104.233.144.63
104.233.144.64
104.233.144.65
104.233.144.66
104.233.144.67
104.233.144.68
104.233.144.69
104.233.144.70
104.233.144.71
104.233.144.72
104.233.144.73
104.233.144.74
104.233.144.75
104.233.144.76
104.233.144.77
104.233.144.78
104.233.144.79
104.233.144.80
104.233.144.81
104.233.144.82
104.233.144.83
104.233.144.84
104.233.144.85
104.233.144.86
104.233.144.87
104.233.144.88
104.233.144.89
104.233.144.90
104.233.144.91
104.233.144.92
104.233.144.93
104.233.144.94
104.233.144.95
104.233.144.96
104.233.144.97
104.233.144.98
104.233.144.99
104.233.144.100
104.233.144.101
104.233.144.102
104.233.144.103
104.233.144.104
104.233.144.105
104.233.144.106
104.233.144.107
104.233.144.108
104.233.144.109
104.233.144.110
104.233.144.111
104.233.144.112
104.233.144.113
104.233.144.114
104.233.144.115
104.233.144.116
104.233.144.117
104.233.144.118
104.233.144.119
104.233.144.120
104.233.144.121
104.233.144.122
104.233.144.123
104.233.144.124
104.233.144.125
104.233.144.126
104.233.144.127
104.233.144.128
104.233.144.129
104.233.144.130
104.233.144.131
104.233.144.132
104.233.144.133
104.233.144.134
104.233.144.135
104.233.144.136
104.233.144.137
104.233.144.138
104.233.144.139
104.233.144.140
104.233.144.141
104.233.144.142
104.233.144.143
104.233.144.144
104.233.144.145
104.233.144.146
104.233.144.147
104.233.144.148
104.233.144.149
104.233.144.150
104.233.144.151
104.233.144.152
104.233.144.153
104.233.144.154
104.233.144.155
104.233.144.156
104.233.144.157
104.233.144.158
104.233.144.159
104.233.144.160
104.233.144.161
104.233.144.162
104.233.144.163
104.233.144.164
104.233.144.165
104.233.144.166
104.233.144.167
104.233.144.168
104.233.144.169
104.233.144.170
104.233.144.171
104.233.144.172
104.233.144.173
104.233.144.174
104.233.144.175
104.233.144.176
104.233.144.177
104.233.144.178
104.233.144.179
104.233.144.180
104.233.144.181
104.233.144.182
104.233.144.183
104.233.144.184
104.233.144.185
104.233.144.186
104.233.144.187
104.233.144.188
104.233.144.189
104.233.144.190
104.233.144.191
104.233.144.192
104.233.144.193
104.233.144.194
104.233.144.195
104.233.144.196
104.233.144.197
104.233.144.198
104.233.144.199
104.233.144.200
104.233.144.201
104.233.144.202
104.233.144.203
104.233.144.204
104.233.144.205
104.233.144.206
104.233.144.207
104.233.144.208
104.233.144.209
104.233.144.210
104.233.144.211
104.233.144.212
104.233.144.213
104.233.144.214
104.233.144.215
104.233.144.216
104.233.144.217
104.233.144.218
104.233.144.219
104.233.144.220
104.233.144.221
104.233.144.222
104.233.144.223
104.233.144.224
104.233.144.225
104.233.144.226
104.233.144.227
104.233.144.228
104.233.144.229
104.233.144.230
104.233.144.231
104.233.144.232
104.233.144.233
104.233.144.234
104.233.144.235
104.233.144.236
104.233.144.237
104.233.144.238
104.233.144.239
104.233.144.240
104.233.144.241
104.233.144.242
104.233.144.243
104.233.144.244
104.233.144.245
104.233.144.246
104.233.144.247
104.233.144.248
104.233.144.249
104.233.144.250
104.233.144.251
104.233.144.252
104.233.144.253
104.233.144.254
104.233.144.255