安装LAMP环境:
[[email protected] ~]#yum -y install httpd mysql-server mysql php php-mysql
查看php-mysql包用途:
[[email protected] ~]# 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.
查看数据库版本:
[[email protected] ~]#mysql -V
mysql Ver 14.14 Distrib 5.1.71, forredhat-linux-gnu (x86_64) using readline 5.1
查看阿帕奇版本:
[[email protected] ~]#httpd -v
Server version:Apache/2.2.15 (Unix)
Server built: Aug 22013 08:02:15
重启 apache、mysql服务,并设置开机启动:
[[email protected] ~]#service httpd restart
[[email protected] ~]#service mysqld restart
[[email protected] ~]#chkconfig httpd on
[[email protected] ~]#chkconfig mysqld on
注:若是mysql无法启动,提示如下错误:
[[email protected]~]# service mysqld start
AnotherMySQL daemon already running with the same unix socket.
正在启动mysqld: [失败]
原因多个Mysql进程使用了同一个socket。直接把mysql.sock文件改名即可。也可以删除,推荐改名。
然后就可以启动mysql了。
[[email protected] ~]#mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
设置数据库密码:
[[email protected] ~]#mysqladmin -uroot password ‘123456‘
[[email protected] ~]#mysql -u root -p123456
mysql去安全隐患:
[[email protected] ~]#/usr/bin/mysql_secure_installation
实战一:
rz上传提前下载好的UCenter_1.5.0_SC_UTF8.zip和UCenter_Home_2.0_SC_UTF8.zip文件。
[[email protected] ~]#rpm -ivh /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm
[[email protected] ~]#rz
解压缩到/usr/local/src/ucenter
[[email protected] ~]#cd /usr/local/src/ucenter/
[[email protected]]# ls
advanced readme upload utilities
[[email protected]]# mv upload/ /var/www/html/kaixin001
[[email protected]]# cd /var/www/html/kaixin001/
[[email protected]]# ls
admin.php control images js plugin upgrade
api crossdomain.xml index.php lib release view
avatar.php data install model robots.txt
修改文件权限
[[email protected]]# chown apache:apache data/ -R
安装UCenter,打开:http://192.168.1.63/kaixin001/install/,如下图37.4所示。
[[email protected]]# vim /etc/php.ini
搜索short_open_tag 设置为 On
[[email protected]]# service httpd restart
再次打开:http://192.168.1.63/kaixin001/install/
然后开始再安装安装UCenter_Home
[[email protected] ~]#unzip -d /usr/local/src/uchome/ UCenter_Home_2.0_SC_UTF8.zip
[[email protected] ~]#cd /usr/local/src/uchome/
[[email protected]]# ls
2.0_changelog.txt readme.txt update upload
[[email protected]]# mv upload/ /var/www/html/kaixin
[[email protected]]# cd !$
cd/var/www/html/kaixin
[[email protected]]# 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
[[email protected]]# mv config.new.php config.php
[[email protected]]# chown apache:apache config.php
[[email protected]]# chown apache:apache attachment/ data/ uc_client/ -R
浏览器打开http://192.168.1.63/kaixin/install/