安装Cent OS
从http://www./modules/tinycontent/index.php?id=15下载最新版本的CentOS
更新成163源
打开Terminate 输入sudo root并输入密码 输入su让当前用户以root权限进入 输入cd /etc/yum.repos.d 输入mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 来备份/etc/yum.repos.d/CentOS-Base.repo 输入wget http://mirrors.163.com/.help/CentOS6-Base-163.repo下载163源 输入mv /etc/yum.repos.d/CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo 输入yum makecache完成更新
安装并配置MySQL 1.1 执行yum命令安装MySQL
1.2 把添加MySQL进开机启动项,并立即启动MySQL
1.3 设置MySQL root账号密码
二、 安装Apache 2.1 使用yum命令安装Apache
2.2 设置开机启动Apache
2.3 启动Apache
2.4 现在直接在浏览器键入http://localhost或http://本机IP,应该会看到Apache的测试页面
3.3 安装相关模块使用PHP支持MySQL:为了让PHP支持MySQL,我们可以安装php-mysql软件包;也可使用以下命令搜索可用的php模块
Using YUM :Step 1 ? Install/enable EPEL repository . You can find latest repository here ( http://download./pub/epel/6/i386/repoview/epel-release.html )
Step 2 ? Now update repositories
Step 3 ? After updating yum repositories , now you can install phpmyadmin package
This command will install phpmyadmin package along with dependencies . please type the package name exactly as phpMyAdmin ( ” M” and “A” –> Uppercase ) Step 4 ? Now restart httpd service
Now open the path in your browser ( Eg-> http://192.168.1.1/phpMyAdmin ) . You can see the below screen after entering Mysql root username and password . 4.9 至此,打开页面http://localhost/phpmyadmin即可轻松管理你的mySQL数据库
打开CentOS网络端口保证其它机器可以访问
#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
查看打开的端口:
# /etc/init.d/iptables status
|
|
来自: corefashion > 《web服务》