centos 6.5 网站建设

Step 1、为centos配置rpmforge及epel源。centos官方的源其实也够用,不过像php的一些扩展如 php-mcrypt在官方源中并没有。

rpm -ivh https://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-
1.el7.rf.x86_64.rpm
rpm -ivh https://mirrors.ustc.edu.cn/centos/6.5/extras/x86_64/Packages/epel-
release-6-8.noarch.rpm
rpm -ivh https://mirrors.163.com/centos/7/extras/x86_64/Packages/epel-release-
7-2.noarch.rpm

Step 2. 安装php/mysql/httpd

安装apache

yum -y install httpd httpd-devel

安装mysql

yum -y install mysql mysql-devel mysql-server mysql-libs

安装php

yum -y install php

安装php扩展

yum -y install php-mysql php-gd php-imap php-ldap php-odbc php-mbstring php-
devel php-soap php-cli php-pdo
yum -y install php-mcrypt php-tidy php-xml php-xmlrpc php-pear

其它不常用php扩展, www.linuxidc.com 可不用安装

yum -y install php-pecl-memcache php-eaccelerator

安装phpmyadmin

yum -y install phpmyadmin

安装完成之后,启动

service httpd start
service mysqld start

Step 3.配置httpd、mysqld开机自启动

chkconfig mysqld on
chkconfig httpd on

Step 4.配置phpmyadmin

修改/usr/share/phpmyadmin/config.inc.php 将这里abcde文字修改为自己的字符,可任意 $cfg['blowfish_secret'] = 'abcde';

常见问题

1. phpmyadmin提示未开启php-mcrypt,这是因为没有安装php-mrcrpt扩展。在官方源没有php-mrcrpt扩展,请安装epel源后再

yum install php-mcrypt

2. phpmyadmin无法访问

phpmyadmin默认只能使用 https://localhost/phpmyadmin 来访问, 可以修改/etc/httpd/conf.d/phpmyadmin.conf中对应部分为

<Directory "/usr/share/phpmyadmin">
Order Deny,Allow
Deny from all
Allow from All
</Directory>

不过强烈不支持这么做的,把phpmyadmin暴露了不安全 注意: apache解析php,修改httpd.conf文件,添加

Addtype application/x-httpd-php .php .phtml
Addtype application/x-httpd-php-source .phps

myql可以远程登录 设置mysql密码

mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql>; FLUSH PRIVILEGES;

1.2.3 允许远程登录

mysql -u root -p
Enter Password: <your new password>
mysql>GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH
GRANT OPTION;

完成后就能用mysql-front远程管理mysql了。 设为开机启动 chkconfig mysqld on

centos 6.5 网站建设

https://blog.policx.com/posts/centos/

作者

江湖

发布于

2014-11-10

更新于

2014-11-10

许可协议

CC BY-NC 4.0

评论

Your browser is out-of-date!

Update your browser to view this website correctly.  Update my browser now

×