如出现错误:
/usr/lib/libexpat.so: could not read symbols: File in wrong format
解决方法:
编译时增加编译参数 --with-expat=builtin 好像在64位服务器下编译脚本在定位系统expat支持时有些问题。通过指定expat,用系统自带的expat来编译就不存在这个问题了。
测试
/usr/local/apache2/bin/apachectl start如果出现错误。
httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.201 for ServerName
修改apache配置文件
# vi /usr/local/apache2/conf/httpd.conf
找到ServerName localhost:80,将注释取消掉。
-------------------------------------------------------------------------------apache安装完毕------------------------------------------------------------------------------
2.安装MySQL
#tar -zxvf mysql-5.1.30.tar.gz
#cd mysql-5.1.30
#groupadd -r mysql //添加mysql用户组
#useradd -m -r -g mysql -d /var/lib/mysql -s /bin/bash -c "MySQL Server" mysql //添加mysql用户
#./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql --enable-local-infile
debian如果出现checking for termcap functions library... configure: error: No curses/termcap library found
#apt-get install libncurses5-dev安装之。
#make
如果出现do_abi_check error,
#vi Makefile 将do_abi_check以后的语句都注释掉即可,再次make
#make
#make install
#make clean
#make distclean
#cd /usr/local/mysql
#/bin/mysql_install_db //初始化系统数据库
#ls /var/lib/mysql //查看存放数据库中的目录内容
#chown -R mysql:mysql /var/lib/mysql //修改数据库目录所有者
#cp /usr/local/mysql/share/mysql/my-large.cnf /etc/my.cnf //一般正常安装之后已经有该文件,可以不用拷贝
#cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql 复制生成Linux Mysql服务器的自动与停止脚本
#chkconfig --list | grep mysql //查询当前是否有mysql服务
#chkconfig --add mysql //添加mysql服务到服务器管理中
如果出现insserv: FATAL: service network is missed in the runlevels XXX to use service
根据Google的结果是:
Actual Results:
In default configuration, mysql cannot be enabled as a service to start at boot
Expected Results:
Should be able to enable mysql service
所以采用以下办法:
# vi /etc/init.d/mysql
将Default-Start反注释掉。
然后再
#chkconfig --add mysql
#chkconfig --list | grep mysql //查询此时mysql服务器的启动状态
#chkconfig --level 35 mysql on //设置在3、5运行级别也自启动
#service mysql start 或 /etc/init.d/mysql start
如果mysql命令不能正常使用的话
#vi ~/.bashrc
添加一句alias mysql='/usr/local/mysql/bin/mysql'
整合apache 与php
#vi /usr/local/apache2/conf/httpd.conf
在最后一行加上:
AddType application/x-httpd-php .php
查找:(设置 WEB 默认文件)
DirectoryIndex index.html
替换为:
DirectoryIndex index.php index.html index.htm //在 WEB 目录不到默认文件,httpd 就会执行 /var/www/error/noindex.html
找到这一段:
#AllowOverride controls what directives may be placed in .htaccess files.
#It can be "All", "None", or any combination of the keywords:
#Options FileInfo AuthConfig Limit
#
AllowOverride none
更改为AllowOverride all(允许apache rewrite)
保存httpd.conf,退出。
#/usr/local/apache2/bin/apachectl restart //重启 Apache