CentOS下LAMP环境搭建问题集

先执行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 

相关推荐