安装LAMP环境:
[root@xuegod63 ~]#yum -y install httpd mysql-server mysql php php-mysql
查看php-mysql包用途:
[root@xuegod63 ~]# rpm -qpi/mnt/Packages/php-mysql-5.3.3-26.el6.x86_64.rpm
warning: /mnt/Packages/php-mysql-5.3.3-26.el6.x86_64.rpm:Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Name : php-mysql Relocations: (notrelocatable)
Version : 5.3.3 Vendor: Red Hat,Inc.
Release : 26.el6 Build Date: 2013年08月19日星期一 18时03分49秒
Install Date: (notinstalled) Build Host:x86-008.build.bos.redhat.com
Group : Development/Languages Source RPM: php-5.3.3-26.el6.src.rpm
Size : 220715 License: PHP
Signature : RSA/8, 2013年09月17日星期二 15时35分50秒, Key ID 199e2f91fd431d51
Packager : Red Hat, Inc.<http://bugzilla.redhat.com/bugzilla>
URL : http://www.php.net/
Summary : A module for PHP applications that useMySQL databases
Description :
The php-mysqlpackage contains a dynamic shared object that will add
MySQL databasesupport to PHP. MySQL is an object-relational database
management system.PHP is an HTML-embeddable scripting language. If
you need MySQLsupport for PHP applications, you will need to install
this package andthe php package.
查看数据库版本:
[root@xuegod63 ~]#mysql -V
mysql Ver 14.14 Distrib 5.1.71, forredhat-linux-gnu (x86_64) using readline 5.1
查看阿帕奇版本:
[root@xuegod63 ~]#httpd -v
Server version:Apache/2.2.15 (Unix)
Server built: Aug 22013 08:02:15
重启 apache、mysql服务,并设置开机启动:
[root@xuegod63 ~]#service httpd restart
[root@xuegod63 ~]#service mysqld restart
[root@xuegod63 ~]#chkconfig httpd on
[root@xuegod63 ~]#chkconfig mysqld on
注:若是mysql无法启动,提示如下错误:
[root@xuegod63~]# service mysqld start
AnotherMySQL daemon already running with the same unix socket.
正在启动mysqld: [失败]
原因多个Mysql进程使用了同一个socket。直接把mysql.sock文件改名即可。也可以删除,推荐改名。
然后就可以启动mysql了。
[root@localhost ~]#mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
设置数据库密码:
[root@xuegod63 ~]#mysqladmin -uroot password ‘123456‘
[root@xuegod63 ~]#mysql -u root -p123456
mysql去安全隐患:
[root@xuegod63 ~]#/usr/bin/mysql_secure_installation
实战一:
rz上传提前下载好的UCenter_1.5.0_SC_UTF8.zip和UCenter_Home_2.0_SC_UTF8.zip文件。
[root@xuegod63 ~]#rpm -ivh /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm
[root@xuegod63 ~]#rz
解压缩到/usr/local/src/ucenter
[root@xuegod63 ~]#cd /usr/local/src/ucenter/
[root@xuegod63ucenter]# ls
advanced readme upload utilities
[root@xuegod63ucenter]# mv upload/ /var/www/html/kaixin001
[root@xuegod63ucenter]# cd /var/www/html/kaixin001/
[root@xuegod63kaixin001]# ls
admin.php control images js plugin upgrade
api crossdomain.xml index.php lib release view
avatar.php data install model robots.txt
修改文件权限
[root@xuegod63kaixin001]# chown apache:apache data/ -R
安装UCenter,打开:http://192.168.1.63/kaixin001/install/,如下图37.4所示。
[root@xuegod63kaixin001]# vim /etc/php.ini
搜索short_open_tag 设置为 On
[root@xuegod63kaixin001]# service httpd restart
再次打开:http://192.168.1.63/kaixin001/install/
然后开始再安装安装UCenter_Home
[root@xuegod63 ~]#unzip -d /usr/local/src/uchome/ UCenter_Home_2.0_SC_UTF8.zip
[root@xuegod63 ~]#cd /usr/local/src/uchome/
[root@xuegod63uchome]# ls
2.0_changelog.txt readme.txt update upload
[root@xuegod63uchome]# mv upload/ /var/www/html/kaixin
[root@xuegod63uchome]# cd !$
cd/var/www/html/kaixin
[root@xuegod63kaixin]# ls
admin config.new.php help.php language space.php xmlrpc.php
admincp.php cp.php image link.php template
api crossdomain.xml index.php magic.php theme
app.php data install network.php uc_client
attachment do.php invite.php rss.php userapp.php
common.php editor.php js.php source ver.php
[root@xuegod63kaixin]# mv config.new.php config.php
[root@xuegod63kaixin]# chown apache:apache config.php
[root@xuegod63kaixin]# chown apache:apache attachment/ data/ uc_client/ -R
浏览器打开http://192.168.1.63/kaixin/install/
本文出自 “技术拯救者” 博客,请务必保留此出处http://rescue.blog.51cto.com/3190306/1964407
原文地址:http://rescue.blog.51cto.com/3190306/1964407