日期:2011-10-01 18:00:00  来源:本站整理

CentOS 6下搭建Apache+MySQL+PHP+SSL[服务器安全]

赞助商链接



  本文“CentOS 6下搭建Apache+MySQL+PHP+SSL[服务器安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:

网上的一些文章都已经对比老了,目前版本高了之后,其实配置是很省力的(不考虑什么负载的话)

分享全历程,出了文中提到的安装epel rpmfushion 源指令差别外,其他的历程也实用与Centos 5

1.安装CentOS 6 ,可以挑选最小安装,也可以安装桌面

2.进级系统

yum update

3.安装mysql,并设置mysql开机自启动,同时启动mysql

yum install mysql

yum install mysql-server

chkconfig --levels 35 mysqld on

service mysqld start

4.配置mysql的root密码

mysql_secure_installation

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? [Y/n] (Y)

New password: (123456)
Re-enter new password: (123456)
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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]

(能否移出数据库的默许帐户,假如移出,那么在终端中直接输入mysql是会提醒衔接错误的)Y

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]

(能否禁止root的远程登录)Y
By default, MySQL 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
Reload privilege tables now? [Y/n] Y

5.安装apache,并设置开机启动

yum install httpd

chkconfig --levels 35 httpd on

service httpd start

这时刻可以测试apache能否正常工作

直接浏览器拜候localhost应当没问题,但是假如别的机子拜候不了的话,是因为防火墙的关系,配置防火墙

(背面的ssl还会有这个问题的)

6.安装php

yum install php

yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

这个时刻php就安装完成拉,写个脚本测试一下

vi /var/www/html/info.php

输入

<?php

phpinfo();?>

拜候localhost/info.php便可~www.linuxidc.com

7.安装phpMyAdmin

首先先给系统安装epel 和rpmfushion两个软件大仓库

rpm -Uvh http://download.Fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

rpm -Uvh http://download1.rpmfusion.org/free/el/updates/testing/6/i386/rpmfusion-free-release-6-0.1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/testing/6/i386/rpmfusion-nonfree-release-6-0.1.noarch.rpm

假如是centos 5 的话履行下面

七道奇为您推荐以下文章:

  • Windows 2008R2 HyperV下安装CentOS6,网卡无痛设置
  • CentOS 6.x 利用安装光盘作为yum源
  • CentOS 下 Nginx + Keepalived 配置高可用Web站点
  • CentOS 5.8布置web缓存服务器(squid+memcached)
  • centos6.2改正yum的源为安装光盘
  • CentOS6 yum搭建Linux+Nginx+PHP+MYSQL(LNMP)
  • CentOS 6.2 安装Nginx并设置为开机服务
  • CentOS 6.2布置DNS
  • CentOS6.2利用yum安装LAMP及phpMyadmin
  • CentOS下配置PHP+phpMyAdmin
  • centos下mysql主从同步快速设置步骤分享
  • 在Windows主机上按时备份远程VPS(CentOS)数据的批处理
  • 本文地址: 与您的QQ/BBS好友分享!
    • 好的评价 如果您觉得此文章好,就请您
        0%(0)
    • 差的评价 如果您觉得此文章差,就请您
        0%(0)

    文章评论评论内容只代表网友观点,与本站立场无关!

       评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论
    Copyright © 2020-2022 www.xiamiku.com. All Rights Reserved .