本站已年久失修,技术交流可以移步到 https://blog.pyzy.net
  所在位置:杂记 >> linux >> linux环境Apache的编译安装过程
linux环境Apache的编译安装过程
发表于 九年前(2014-4-21 16:35:59) | 阅读 (3057) | 评论 (0)
在http://cloud.360.cn/申请到一个免费试用的云主机名额,自己试着搭了个服务端环境,流水过程记录。

先通过http://www.apache.org/到下载页http://mirrors.hust.edu.cn/apache/找到最新的Apache主程序httpd下载地址,然后依次执行以下命令进行安装:
下载tar包到当前目录:
# wget http://mirrors.hust.edu.cn/apache/httpd/httpd-2.4.9.tar.gz
解压:
# tar -zxf httpd-2.4.9.tar.gz

# cd httpd-2.4.9
配置安装目录:
# ./configure --prefix=/usr/local/apache2
编译:
# make
安装:
# make install
意外就在这个时候发生了:
configure: error: APR not found. Please read the documentation.
搜索了一下,原来是缺少关联程序APR,同样在上面下载页http://mirrors.hust.edu.cn/apache/中可以找到下载包地址,按照上面主程序的安装步骤,依次执行命令:
# wget http://mirrors.hust.edu.cn/apache/apr/apr-1.5.1.tar.gz
# tar -zxf apr-1.5.1.tar.gz
# cd apr-1.5.1
# ./configure --prefix=/usr/local/apr
# make
# make install
APR安装完毕,再次执行第一段安装主程序的命令(此时配置要增加apr相关信息:# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr),这时遇到了一个新问题:
configure: error: APR-util not found. Please read the documentation

经过上面步骤已经基本掌握处理方式了:

# wget http://mirrors.hust.edu.cn/apache/apr/apr-util-1.5.3.tar.gz
# tar -zxf apr-util-1.5.3.tar.gz
# cd apr-util-1.5.3
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
APR-UTIL安装完毕,再次执行第一段安装主程序的命令,这会主程的配置是这样的:
# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
这时又遇到了一个新问题...:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
好.. 缺啥补啥。。
# wget http://ftp.exim.llorien.org/pcre/pcre-8.35.tar.gz
# tar -zxf pcre-8.35.tar.gz
# cd pcre-8.35
# ./configure --prefix=/usr/local/pcre
# make
# make install
完毕后,进入httpd目录,重新尝试安装apache主程序:
# ./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre/
# make
# make install
这次没有异常了,顺利安装完毕,地址栏输入服务器地址访问试了下,看到了:“It works!”
===============================================
安装mysql:http://www.yesky.com/187/1754687_4.shtml

安装mysql冲突解决方法:

Preparing...                ########################################### [100%]

        file /usr/share/mysql/charsets/README from install of MySQL-server-community-5.1.44-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686

        file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-community-5.1.44-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686

        file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-community-5.1.44-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686

        file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-community-5.1.44-1.rhel5.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686   


解决办法:

卸载mysql:rpm -e --nodeps mysql-libs-5.1.*


启动mysql: service mysql start


# mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

mysql -u root -p


杂记评论(0):
称谓(必填):  网站(选填):
上一篇:百度分享按钮自定义扩展  下一篇:解决IE6下边框颜色不支持transparent的问题     <<返回杂记列表