MYSQL+APACHE+PHP静态安装apache实验
2010-06-06 10:49
627 查看
系统 :LINUX5.4
目的: MYSQL+APACHE+PHP 实验
软件: mysql-5.0.22.tar.gz
httpd-2.2.15.tar.gz
php-5.2.13.tar.gz
一、安装MYSQL
1、 创建mysql用户和组
[root@dns redhat]#chmod 777 mysql-5.0.22.tar.gz
[root@dns redhat]tar –zxvf mysql-5.0.22.tar.gz
[root@dns redhat]#cd mysql-5.0.22
[root@dns redhat]#groupadd mysql
[root@dns redhat]#useradd –g mysql –s /bin/bash mysql
[root@dns redhat]#password mysql
2、开始安装mysql
[root@dnsmysql-5.0.22]#./configure
--prefix=/usr/local/mysql #mysql安装目录
--with-charset=utf8 #使用UTF8字符集
--with-collation=utf8_general_ci #校对规则
--with-extra-charsets=complex #支持所有的扩展字符集
--with-big-tables #启用大表
--with-plugins=partition #大表分割
--enable-assembler #允许汇编模式,(优化性能)
--enable-local-infile #支持从本地导入mysql
[root@dns redhat]#make
[root@dns redhat]#make install
[root@dns mysql-5.0.22]#
cp support-files/my-large.cnf /etc/my.cnf
[root@dns mysql-5.0.22]# cd /usr/local/mysql/
[root@dns mysql]#bin/mysql_install_db --user=mysql
[root@dns mysql]# chown -R root .
[root@dns mysql]# chown -R mysql var
[root@dns mysql]# chgrp -R mysql .
[root@dns mysql]# bin/mysqld_safe --user=mysql &
[1] 19374
[root@dns mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var
3、 开机启动mysql
[root@dns mysql]#cp share/mysql/mysql.server /etc/init.d/mysqld
[root@dns mysql]#chkconfig --add mysqld
[root@dns mysql]#chmod +x /etc/init.d/mysqld
[root@dns mysql]#chkconfig --level 35 mysql on
[root@dns mysql]#service mysqld start
[root@dns mysql]#cp /usr/local/mysql/bin/* /sbin
[root@dns init.d]# mysqladmin -u root -h localhost password 'aa123456'
[root@dns init.d]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@dns init.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.22-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql> grant all privileges on *.* to root@'%' identified by 'aa123456' with grant option;
Query OK, 0 rows affected (0.00 sec)
从你的NVCAT链接试试吧
到这里基本上已经安装成功了
二、 安装APACHE
[root@dns redhat]#chmod 777 httpd-2.2.15.tar.gz
[root@dns redhat]# cd httpd-2.2.15
[root@dns httpd-2.2.15]#./configure
--prefix=/usr/local/apache2 #指定安装目录
--enable-module=so #启动模块
--enable-module=rewrite #启用重写功能
--enable-shared=max #把除了so以外的所有apache的标准模块都编译成DSO模块
[root@dns httpd-2.2.15]#make
[root@dns httpd-2.2.15]#make install
开机自启动
[root@dns rc.d]# echo "/usr/local/apache2/bin/apachectl start" >> rc.local
三、 安装PHP
1、
[root@dns redhat]# tar -xvzf php-5.2.13.tar.gz
[root@dns redhat]# cd php-5.2.13
[root@dnsphp-5.2.13]#./configure
--prefix=/usr/local/php5 #指定安装目录
--with-mysql=/usr/local/mysql
--with-apxs2=/usr/local/apache2/bin/apxs
[root@dns php-5.2.13]#make
[root@dns php-5.2.13]#make test
[root@dnsphp-5.2.13]#make install
[root@dnsphp-5.2.13]#cp php.ini-dist /usr/local/php5/lib/php.ini
[root@dnsphp-5.2.13]#vi /usr/local/apache2/conf/httpd.conf
在284行 defaultType text/plain后面添加
AddType application/x-httpd-php .php .phtml
286 AddType application/x-httpd-php-source .phps
找 到Directory index 后面添加 index.php
2、重启apache
[root@ olym php-5.2.3]cd /usr/local/apache2/htdocs/
[root@dns htdocs]#
touch index.php
<? phpinfo(); ?>
目的: MYSQL+APACHE+PHP 实验
软件: mysql-5.0.22.tar.gz
httpd-2.2.15.tar.gz
php-5.2.13.tar.gz
一、安装MYSQL
1、 创建mysql用户和组
[root@dns redhat]#chmod 777 mysql-5.0.22.tar.gz
[root@dns redhat]tar –zxvf mysql-5.0.22.tar.gz
[root@dns redhat]#cd mysql-5.0.22
[root@dns redhat]#groupadd mysql
[root@dns redhat]#useradd –g mysql –s /bin/bash mysql
[root@dns redhat]#password mysql
2、开始安装mysql
[root@dnsmysql-5.0.22]#./configure
--prefix=/usr/local/mysql #mysql安装目录
--with-charset=utf8 #使用UTF8字符集
--with-collation=utf8_general_ci #校对规则
--with-extra-charsets=complex #支持所有的扩展字符集
--with-big-tables #启用大表
--with-plugins=partition #大表分割
--enable-assembler #允许汇编模式,(优化性能)
--enable-local-infile #支持从本地导入mysql
[root@dns redhat]#make
[root@dns redhat]#make install
[root@dns mysql-5.0.22]#
cp support-files/my-large.cnf /etc/my.cnf
[root@dns mysql-5.0.22]# cd /usr/local/mysql/
[root@dns mysql]#bin/mysql_install_db --user=mysql
[root@dns mysql]# chown -R root .
[root@dns mysql]# chown -R mysql var
[root@dns mysql]# chgrp -R mysql .
[root@dns mysql]# bin/mysqld_safe --user=mysql &
[1] 19374
[root@dns mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var
3、 开机启动mysql
[root@dns mysql]#cp share/mysql/mysql.server /etc/init.d/mysqld
[root@dns mysql]#chkconfig --add mysqld
[root@dns mysql]#chmod +x /etc/init.d/mysqld
[root@dns mysql]#chkconfig --level 35 mysql on
[root@dns mysql]#service mysqld start
[root@dns mysql]#cp /usr/local/mysql/bin/* /sbin
[root@dns init.d]# mysqladmin -u root -h localhost password 'aa123456'
[root@dns init.d]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@dns init.d]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 5.0.22-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql> grant all privileges on *.* to root@'%' identified by 'aa123456' with grant option;
Query OK, 0 rows affected (0.00 sec)
从你的NVCAT链接试试吧
到这里基本上已经安装成功了
二、 安装APACHE
[root@dns redhat]#chmod 777 httpd-2.2.15.tar.gz
[root@dns redhat]# cd httpd-2.2.15
[root@dns httpd-2.2.15]#./configure
--prefix=/usr/local/apache2 #指定安装目录
--enable-module=so #启动模块
--enable-module=rewrite #启用重写功能
--enable-shared=max #把除了so以外的所有apache的标准模块都编译成DSO模块
[root@dns httpd-2.2.15]#make
[root@dns httpd-2.2.15]#make install
开机自启动
[root@dns rc.d]# echo "/usr/local/apache2/bin/apachectl start" >> rc.local
三、 安装PHP
1、
[root@dns redhat]# tar -xvzf php-5.2.13.tar.gz
[root@dns redhat]# cd php-5.2.13
[root@dnsphp-5.2.13]#./configure
--prefix=/usr/local/php5 #指定安装目录
--with-mysql=/usr/local/mysql
--with-apxs2=/usr/local/apache2/bin/apxs
[root@dns php-5.2.13]#make
[root@dns php-5.2.13]#make test
[root@dnsphp-5.2.13]#make install
[root@dnsphp-5.2.13]#cp php.ini-dist /usr/local/php5/lib/php.ini
[root@dnsphp-5.2.13]#vi /usr/local/apache2/conf/httpd.conf
在284行 defaultType text/plain后面添加
AddType application/x-httpd-php .php .phtml
286 AddType application/x-httpd-php-source .phps
找 到Directory index 后面添加 index.php
2、重启apache
[root@ olym php-5.2.3]cd /usr/local/apache2/htdocs/
[root@dns htdocs]#
touch index.php
<? phpinfo(); ?>
相关文章推荐
- MYSQL+APACHE+PHP (动态安装apache实验中)
- Apache+php+mysql在windows下的安装与配置图解
- fedora17安装mysql,apache,php,lamp,笔记
- apache+php+mysql常见集成环境安装包
- windows下apache+php+mysql的安装与配置
- 在centos 5.6版本下安装php+mysql+apache
- Ubuntu10.10安装Drupal7及其环境(apache,mysql,php)
- PHP apache2.2 mysql 的安装
- LAMP实验一:安装Apache+MySQL+PHP基本环境
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- lamp黄金组合apache+mysql+php的安装
- CentOS 6.3 源码安装LAMP(Linux+Apache+Mysql+Php)环境
- Redhat下 Apache, php, mysql的默认安装路径
- Apache+SSL+PHP+JSP+MySQL+IMAP+GD安装全攻略
- XP下安装Apache 2.2.3+MySQL 5.0.24+PHP 5.1.6摘要
- CentOS yum安装Apache + PHP + MySQL + Tomcat
- 安装apache-2.2.6, php-5.2.5, mysql-5.0.2的过程
- CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境
- ubuntu14.04 安装Apache+Mysql+PHP
- as4上安装apache,mysql,php,cacti,nagios