服务器篇之 yum安装LAMP环境
【1】、准备环境:
yum添加163源:
使用yum程序安装所需开发包:
[root@nosay yum.repos.d]# yum install gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel mysql-devel net-snmp-devel curl-devel perl-DBI
【2】、安装LAMP:
MySQL:
[root@nosay ~]# yum install mysql mysql-server [root@nosay ~]# chkconfig --levels 235 mysqld on [root@nosay ~]# service mysqld start [root@nosay ~]# mysqladmin -u root password liukun [root@nosay ~]# mysql -uroot -p Enter password: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.00 sec) mysql>
Apache:
[root@nosay ~]# yum install httpd [root@nosay ~]# chkconfig --levels 235 httpd on [root@nosay ~]# service httpd start [root@nosay ~]# vim /etc/httpd/conf/httpd.conf #ServerName 127.0.0.1:80 [root@nosay ~]# service httpd restart
PHP:
[root@nosay ~]# yum install php [root@nosay ~]# yum search php [root@nosay ~]# yum -y install php-mysql php-gd php-lmap php-ldap php-odbc php-pear php-xml php-xmlrpc php-bcmath php-mbstring [root@nosay ~]# vim /var/www/html/phpinfo.php [root@nosay ~]# service httpd restart
phpMyAdmin:
下载地址:http://www.phpmyadmin.net/home_page/downloads.php
版本:phpMyAdmin-4.0.10.5-all-languages.tar.gz
FTP上传至:/var/www/html
[root@nosay html]# tar xvfz phpMyAdmin-4.0.10.5-all-languages.tar.gz [root@nosay html]# mv phpMyAdmin-4.0.10.5-all-languages phpMyAdmin [root@nosay html]# cd phpMyAdmin [root@nosay html]# cp config.sample.inc.php config.inc.php [root@nosay html]# service httpd restart