LAMP源码安装及phpwind的配置方案详解
一般的源码包放在/usr/local/下,mysql,apache源码包均解压放在其下,php放在/usr/local/src/下
安装的大概步骤:
一.先要使用yum下面四个包安装(最好使用组安装)
例如 :yum groupinstall “development tools” –y
a. Development Tools
b. Development Libraries
c. Legacy Software Development
d. X Software Development
二.做完如上操作后下面我们先安装mysql,要把红色字体需要安装的包放到目录下
1.拆解mysql文件到 /usr/local 目录下
[root@localhost ~]# tar -zxvf mysql-5.5.15-linux2.6-i686.tar.gz -C /usr/local
[root@localhost ~]# cd /usr/local
2.切换到mysql-5.5.15-linux2.6-i686,可以用ll查看里面的文件
[root@localhost local]# cd mysql-5.5.15-linux2.6-i686/
3.查看安装方法
[root@localhost mysql-5.5.15-linux2.6-i686]# less INSTALL-BINARY
实例安装步骤:
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
打开另一个终端
[root@localhost ~]# cd /usr/local
4.把mysql-5.5.15 链接为 mysql
[root@localhost local]# ln -s mysql-5.5.15-linux2.6-i686 mysql
切换到mysql
[root@localhost local]# cd mysql
5.添加用户组 mysql 并把mysql用户加入到mysql组里
[root@localhost mysql]# groupadd mysql
[root@localhost mysql]# useradd -r -g mysql mysql
[root@localhost mysql]# cd /usr/local
[root@localhost local]# cd mysql
[root@localhost mysql]# chown -R mysql . #把mysql目录及所有文件的用户改为mysql
[root@localhost mysql]# chgrp -R mysql . #把mysql目录及所有文件的用户组为mysql
[root@localhost mysql]# scripts/mysql_install_db --user=mysql #mysql的接口及初始化
[root@localhost mysql]# chown -R root . #把当前目录下的所有者改为roo
[root@localhost mysql]# chown -R mysql data
#把date目录及其下面的文件的所有者改为mysql
[root@localhost mysql]# cp support-files/my-medium.cnf /etc/my.cnf
[root@localhost mysql]# bin/mysqld_safe --user=mysql & #启动mysql
[root@localhost mysql]# netstat -tupln|less
6.把support-files下mysql.server复制到/etc/init.d/下并命名为mysqld
[root@localhost mysql]# cp support-files/mysql.server /etc/init.d/mysqld