CentOS yum安装LAMP(Apache+MySQL+PHP)
LAMP是Linux,Apache,MySQL,PHP的缩写。这个教程主要是讲在centos安装有php和mysql支持的apache web服务器。在这个教程我使用主机名server1.example.com对应IP地址192.168.0.100。这些设置可能不同于你,你必须替换成你正确的。添加外部源,保证MySQL和PHP最新因为系统基本的源的MySQL和PHP程序比较旧,所以我们添加比较新的外部源。
[*]# rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
[*]# vi /etc/yum.repos.d/CentOS-Base.repo
在底部增加下面信息
[*]
[*]name=Jason's Utter Ramblings Repo
[*]baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
[*]enabled=1
[*]gpgcheck=1
[*]gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
安装MySQL
执行yum程序安装MySQL
[*]yum install mysql mysql-server
添加MySQL进启动项(这样系统启动时会自动启动MySQL),并立即启动MySQL服务器:
[*]chkconfig --levels 235 mysqld on
[*]/etc/init.d/mysqld start
设置MySQL root帐号密码:
[*]mysql_secure_installation
[*]NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
[*] SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
[*]
[*]
[*]In order to log into MySQL to secure it, we'll need the current
[*]password for the root user. If you've just installed MySQL, 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):
[*]OK, successfully used password, moving on...
[*]
[*]Setting the root password ensures that nobody can log into the MySQL
[*]root user without the proper authorisation.
[*]
[*]Set root password?
页:
[1]