linux中级架构初章二
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux中级架构初章二相关的知识,希望对你有一定的参考价值。
开头忘记写了,以后再整理,从现在调试apache开始
一、apache安装(安装到一半才想起来写博文,抱歉)
[[email protected] apache2.2.27]# pwd /application/apache2.2.27 [[email protected] apache2.2.27]# ./bin/apachectl -t ###语法检测正常 httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName Syntax OK [[email protected] apache2.2.27]# ./bin/apachectl start ###启动apache服务正常 httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName httpd (pid 55992) already running
问题一、访问报错如下
[[email protected] apache2.2.27]# wget 192.168.152.133 --2017-02-17 10:42:03-- http://192.168.152.133/ Connecting to 192.168.152.133:80... connected. HTTP request sent, awaiting response... 403 Forbidden 2017-02-17 10:42:03 ERROR 403: Forbidden.
解决思路:
iptables、selinux has been closed.
所以考虑是apache安装路径所属用户没有设置好
[[email protected] apache2.2.27]# ll /application/apache2.2.27/ -d ###权限已修改好 drwxr-xr-x. 15 apache1 apache1 4096 Feb 17 10:01 /application/apache2.2.27/ [[email protected] apache2.2.27]# ./bin/apachectl restart ###重启Apache服务 [[email protected] bin]# cp apachectl /etc/init.d/httpd [[email protected] init.d]# service httpd stop [[email protected] init.d]# service httpd start [[email protected] init.d]# ps -ef |grep httpd 问题二、报错如下 httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.0.1 for ServerName 解决方法: sed -i ‘s%#ServerName www.example.com:80%ServerName /application/apache2.2.27/conf/httpd.conf 测试是否能正常访问 [[email protected] apache2.2.27]# wget 192.168.152.133 --2017-02-17 10:46:44-- http://192.168.152.133/ Connecting to 192.168.152.133:80... connected. HTTP request sent, awaiting response... 200 OK Length: 44 [text/html] Saving to: “index.html” 100%[============================================================================>] 44 --.-K/s in 0s 2017-02-17 10:46:44 (3.76 MB/s) - “index.html” saved [44/44]
到此Apache初步配置完毕!
二、下面开始安装配置MySQL
[[email protected] tools]# tar xf mysql-5.1.62.tar.gz
[[email protected] tools]# cd mysql-5.1.62
./configure \
--prefix=/application/mysql5.1.72 \
--with-unix-socket-path=/application/mysql5.1.72/tmp/mysql.sock \
--localstatedir=/application/mysql5.1.72/data \
--enable-assembler \
--enable-thread-safe-client \
--with-mysqld-user=mysql \
--with-big-tables \
--without-debug \
--with-pthread \
--enable-assembler \
--with-extra-charsets=complex \
--with-readline \
--with-ssl \
--with-embedded-server \
--enable-local-infile \
--with-plugins=partition,innobase \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static
问题一、
checking for termcap functions library... configure: error: No curses/termcap library found
解决方法:
[[email protected] mysql-5.1.62]#yum install ncurses ncurses-devel -y
当出现 Thank you for choosing MySQL! 的时候说明./configure完毕,可以安装了
make && make install
配置mysql
cp support-files/mysql.server /etc/init.d/mysql ###把启动脚本放到开机初始化目录
注意:如果mysql跟web服务不放在同一台服务器上,那么mysql安装到此结束
三、安装php
在安装php之前将必须具备的环境给搞好
先安装libiconv 库文件
tar xf libiconv-1.14.tar.gz cd libiconv-1.14 ls ./configure --prefix=/usr/local/libiconv make && make install
[[email protected] tools]# cd php-5.3.15
./configure \
--prefix=/application/php5.3.27 \
--with-apxs2=/application/apache/bin/apxs \
--with-mysql=/application/mysql \
--with-xmlrpc \
--with-openssl \
--with-zlib \
--with-freetype-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-iconv=/usr/local/libiconv \
--enable-short-tags \
--enable-sockets \
--enable-zend-multibyte \
--enable-soap \
--enable-mbstring \
--enable-static \
--enable-gd-native-ttf \
--with-curl \
--with-xsl \
--enable-ftp \
--with-libxml-dir
问题一、
configure: error: xml2-config not found. Please check your libxml2 installation.
这是缺少必要的库文件
解决办法:
yum install zlib libjpeg freetype libpng gd libxslt-devel curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel -y
出现 Thank you for using PHP.说明安装成功
lamp安装暂时放置一边,稍后配置
本文出自 “董利强” 博客,请务必保留此出处http://6207422.blog.51cto.com/6197422/1898857
以上是关于linux中级架构初章二的主要内容,如果未能解决你的问题,请参考以下文章