cmake工具的安装:
[root@server ~]# tar -zxvf cmake-2.8.10.2.tar.gz -C/usr/local/src/
[root@server ~]# cd /usr/local/src/cmake-2.8.10.2/
[root@server cmake-2.8.10.2]# ./configure--prefix=/usr/local/cmake
[root@server cmake-2.8.10.2]# make && make install
然后对cmake安装目录下的bin目录和man目录做如同httpd相同的操作,这里就不再写出了。
mysql的安装:
[root@server ~]# groupadd mysql
[root@server ~]# useradd -r -g mysql mysql -s /sbin/nologin-M
说明:在linux下任何一种服务要运行,都需要相应的运行者身份,这里我们需要建立运行mysql服务的运行者mysql和该用户所属组mysql。
[root@server ~]# tar -zxvf mysql-5.6.10.tar.gz -C/usr/local/src/
[root@server ~]# cd /usr/local/src/
[root@server src]# ln -s /usr/local/src/mysql-5.6.10/usr/local/src/mysql
[root@server src]# cd mysql
[root@server mysql]# cmake . 执行cmake产生Makefile文件
[root@server mysql]# make && make install
说明:mysql安装完成后会在/usr/local/下产生名为mysql的安装目录。接下来同样对mysql安装目录下的bin目录、lib目录、man目录和include目录都需要做同httpd相应的操作,这里不再写了。
进入mysql的安装目录,产生mysql的初始化数据库:
[root@server mysql]# chown -R mysql:mysql .
[root@server mysql]# scripts/mysql_install_db --user=mysql
[root@server mysql]# chown -R root .
[root@server mysql]# chown -R mysql data
现在产生mysql的配置文件和控制脚本:
[root@server mysql]# cp support-files/my-default.cnf/etc/my.cnf
[root@server mysql]# cp support-files/mysql.server/etc/init.d/mysqld
[root@server mysql]# chmod a+x /etc/init.d/mysqld
启动mysql的服务,并且使用chkconfig进行管理:
[root@server mysql]# service mysqld start
[root@server mysql]# chkconfig --add mysqld
[root@server mysql]# chkconfig mysqld on
现在对mysql进行相应的操作,修改mysql的用户密码
[root@server mysql]# mysqladmin -u root -p password '123'
mysql> INSERT INTO mysql.user (Host, User, Password,Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv,Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv,References_priv, Index_priv, Alter_priv, ssl_cipher, x509_issuer, x509_subject)VALUES('localhost','ftp',PASSWORD('passwd'),'Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','NULL', 'NULL', 'NULL');
mysql> FLUSH PRIVILEGES;
mysql>CREATE DATABASE ftpusers;
mysql>USE ftpusers;
mysql>CREATE TABLE admin (
Username varchar(35)NOT NULL default '',
Password char(32)binary NOT NULL default '',
PRIMARY KEY (Username)
);
mysql>INSERT INTO admin VALUES ('admin',MD5('passwd'));
mysql>CREATE TABLE `users` (
`User` varchar(16)NOT NULL default '',
`Password`varchar(32) binary NOT NULL default '',
`Uid` int(11) NOTNULL default '14',
`Gid` int(11) NOTNULL default '5',
`Dir` varchar(128)NOT NULL default '',
`QuotaFiles` int(10)NOT NULL default '500',
`QuotaSize` int(10)NOT NULL default '30',
`ULBandwidth` int(10)NOT NULL default '80',
`DLBandwidth` int(10)NOT NULL default '80',
`Ipaddress`varchar(15) NOT NULL default '*',
`Comment` tinytext,
`Status`enum('0','1') NOT NULL default '1',
`ULRatio` smallint(5)NOT NULL default '1',
`DLRatio` smallint(5)NOT NULL default '1',
PRIMARY KEY (`User`),
UNIQUE KEY `User`(`User`)
);
mysql> grant all privileges on ftpusers.* to ftp@localhostidentified by 'tmppasswd';将对数据库ftpusers的所有权限授予ftp用户
mysql> flush privileges; 刷新权限值
mysql> \quit
重新使用ftp用户登录mysql数据库:
3.php的安装
[root@server ~]# tar -jxvf php-5.4.13.tar.bz2 -C/usr/local/src/
[root@server ~]# cd /usr/local/src/php-5.4.13/
[root@server php-5.4.13]# ./configure \
> --prefix=/usr/local/php \
> --sysconfdir=/etc/php \
> --with-apxs2=/usr/local/apache/bin/apxs \
> --with-gd \
> --with-jpeg-dir \
> --with-png-dir \
> --with-zlib-dir \
> --enable-mbstring \
> --with-mysql=/usr/local/mysql \
> --with-mysqli=/usr/local/mysql/bin/mysql_config \
[root@server php-5.4.13]# make && make install
进入php的安装目录,对该目录下的bin目录做httpd同样的操组,此处省略操作步骤。