背景:
阅读新闻
CentOS下LAMP环境搭建问题集
[日期:2011-07-16] 来源:Linux社区 作者:kevin2089764 [字体:]
先执行find / -name httpd查看是否存在
rpm -qf httpd如果是安装了包,显示包名
rpm -ql 包名
检查是否已安装,列出相关的包:
# rpm -qa |grep httpd
# rpm -qa |grep tomcat
# rpm -qa |grep php
# rpm -qa |grep MySQL
查看进程:
ps -ef |grep tomcat
ps -ef |grep httpd
卸载:
[root@localhost ~]# rpm -qa|grep httpd
httpd-2.2.3-43.el5.CentOS
列出后卸载从最下面一个开始
# rpm -e httpd
强制删除目录:rm -rf 文件夹
yum clean all
[root@localhost ~]# cd /tmp
[root@localhost tmp]# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd-devel
安装mysql:
[root@localhost ~]# tar zxvf mysql-5.1.53.tar.gz
[root@localhost ~]# cd mysql-5.1.53
[root@localhost mysql-5.1.53]# ./configure --prefix =/usr/local/mysql --with-mysqld-user =zhouli --with-extra-charsets =all --with-unix-socket-path =/usr/local/mysql/var/mysql.sock
[root@localhost mysql-5.1.53]# make && make install
[root@localhost mysql-5.1.53]# cd /usr/local/mysql/
[root@localhost mysql]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
[root@localhost mysql]#/usr/local/mysql/bin/mysql_install_db
[root@localhost mysql]# /usr/local/mysql/share/mysql/mysql.server start
[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe --user=root
[root@localhost ~]# /usr/local/mysql/share/mysql/mysql.server start
[root@localhost ~]# /usr/local/mysql/bin/mysqladmin -u root password 123456
[root@localhost ~]# /usr/local/mysql/bin/mysql -u root -p
[root@localhost ~]# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
如果提示:
No curses/termcap library found:yum -y install ncurses-devel
useradd mysql #添加用户
cp support-files/my-huge.cnf /etc/my.cnf
/usr/local/mysql/bin/mysql_install_db --user=mysql #建立基本数据库
chown -R mysql:mysql /usr/local/mysql/var/ #给mysql库的写权限
cd /usr/local/mysql/bin/
./mysqld_safe --user=mysql & #启动数据库
ps -aux |grep mysql #检查是否正常启动
mysql -u root #进入数据库以查看是否正常启动
修改mysql启动方式
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
service mysqld restart #重新启动服务查看是否生效
CentOS 5.4上编译安装Memcached 1.4.5
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯