分类: LINUX
2009-11-17 16:35:11
[root@localhost ~]# ls
anaconda-ks.cfg httpd-
cacti-spine-
config install.log.syslog
config.tar mysql-5.0.87.tar.gz
ez-ipupdate net-snmp-5.5.tar.gz
ez-ipupdate-
:注这里都是源码安装
[root@localhost ~]#tar zxvf mysql-5.0.87.tar.gz 解压mysql
[root@localhost ~]#make
[root@localhost ~]#make install
[root@localhost mysql-5.0.87]# useradd myaql 创建mysql 用户
[root@localhost mysql-5.0.87]# passwd myaql 创建密码
[root@localhost mysql-5.0.87]#./configure –prefix =/opt/mysql5 安装路径
[root@localhost mysql-
[root@localhost mysql-
[root@localhost mysql5]# ll
total 28
drwxr-xr-x 2 root root 4096 Nov 16 01:03 bin
drwxr-xr-x 3 root root 4096 Nov 16 01:01 include
drwxr-xr-x 3 root root 4096 Nov 16 01:01 lib
drwxr-xr-x 2 root root 4096 Nov 16 01:06 libexec
drwxr-xr-x 10 root root 4096 Nov 16 01:06 mysql-test
drwxr-xr-x 6 root root 4096 Nov 16 01:06 share
drwxr-xr-x 5 root root 4096 Nov 16 01:06 sql-bench
[root@localhost mysql5]# chown -R mysql .
设置权限
[root@localhost mysql5]# bin/mysql_install_db --user=mysql 执行这条指令
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/opt/mysql5/bin/mysqladmin -u root password 'new-password'
/opt/mysql5/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/opt/mysql5/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /opt/mysql5 ; /opt/mysql5/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /opt/mysql5/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /opt/mysql5/bin/mysqlbug script!
The latest information about MySQL is available at
Support MySQL by buying support/licenses from
[root@localhost mysql5]# chown -R root .
[root@localhost mysql5]# chown -R mysql var 权限
[root@localhost mysql5]# cd bin
[root@localhost bin]# pwd
[root@localhost ~]#/opt/mysql5/bin
[root@localhost bin]# ./mysqld_safe --user=mysql & 让mysqld放在后台执行
[root@localhost mysql5]# cd bin
[root@localhost bin]# ./mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version:
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; 测试mysql 是否正常查询
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.01 sec)
[root@localhost bin]# ./mysqladmin shutdown 关闭mysql
[root@localhost ~]#Tar zxvf httpd-
解压内容省……
[root@localhost ~]#Tar zxvf php-
[root@localhost ~]# cd httpd-
[root@localhost httpd-
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
Configuring APR library
Platform: i686-pc-linux-gnu
checking for working mkdir -p... yes
APR Version:
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/httpd-
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
configure failed for srclib/apr
make && makeinstall
[root@localhost php-
creating cache ./config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
后面省………
[root@localhost php-
……..略
[root@localhost php-
Installing PHP SAPI module: apache2handler
/opt/www/build/instdso.sh SH_LIBTOOL='/opt/www/build/libtool' libphp5.la /opt/www/modules
/opt/www/build/libtool --mode=install cp libphp5.la /opt/www/modules/
cp .libs/libphp5.so /opt/www/modules/libphp5.so
cp .libs/libphp5.lai /opt/www/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /root/php-
………..略
[root@localhost php-
[root@localhost ~]# cd /opt/www
[root@localhost www]# ls
bin cgi-bin error icons lib man modules
build conf htdocs include logs manual
[root@localhost www]# cd conf
[root@localhost conf]# ls
extra httpd.conf httpd.conf.bak magic mime.types original
[root@localhost conf]# vi httpd.conf
[root@localhost conf]#AddType application/x-httpd-php .php .phtml 增加这一项]
[root@localhost ~]# /opt/www/bin/apachectl start 启动apachect
测试httpd 是否工作正常
[root@localhost ~]# ps -ef | grep httpd
root 30747 1 0 20:59 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 30748 30747 0 20:59 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 30749 30747 0 20:59 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 30750 30747 0 20:59 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 30751 30747 0 20:59 ? 00:00:00 /opt/www/bin/httpd -k start
daemon 30752 30747 0 20:59 ? 00:00:00 /opt/www/bin/httpd -k start
root 30754 30704 3 21:
说明已经正常工作了。[root@localhost ~]# cd /opt/www/htdocs/
[root@localhost htdocs]# ls
index.html
[root@localhost htdocs]# vi test.php
<?php
Phpinfo();
?>
下面测试没问题了。