Things change, roll with the punches.Oh, yeah. Go for it man, jump off the high dive, stare down the barrel of the gun, pee into the wind!

Ubuntu下手动配置安装apache+php+mysql

上一篇 / 下一篇  2007-01-05 01:07:08 / 个人分类:Linux

安装基本编译工具51Testing软件测试网#T+iBiX,c
sudo apt-get install build-essential51Testing软件测试网j3b)Jb"o i"`
具体需要哪些编译工具我也不清楚了~反正需要什么apt下就是了~:)
.xp+OnQA0--------------------------------------------------------------------------------51Testing软件测试网rvLPU8U oIu7O
相关URL下载:http://dev.mysql.com/downloads/mysql/5.0.html                51Testing软件测试网7d%HSVj mlF r
                 http://mirror.vmmatrix.net/apache/dist/httpd/httpd-2.0.54.tar.gz   51Testing软件测试网-a ~+eAMd
                 http://cn.php.net/get/php-5.0.4.tar.gz/from/cn2.php.net/mirror
anQ(q/NE)c0Z)GvL0--------------------------------------------------------------------------------
z"H?9a_ H.@zu)^0k0package(将这三个包放到/opt目录下备用,以下以root安装):51Testing软件测试网NU{2} gS9g
mysql-standard-5.0.9-beta-linux-i686.tar.gz
2~i3p8u7m&W M0httpd-2.0.54.tar.gz
5T wL/CT/N0php-5.0.4.tar.gz
6bo/c$|z0--------------------------------------------------------------------------------
~~!]2FmL%J:dn;j0mysql的安装51Testing软件测试网 O,AauRZa(?
     shell> groupadd mysql51Testing软件测试网 vu!W+I!L:FZr
     shell> useradd -g mysql mysql
P0n~q/O.b0     shell> cd /usr/local
)r4` A%Nod0     shell> tar zxvf /opt/mysql-standard-5.0.9-beta-linux-i686.tar.gz
Qq&k4dI u8DM0     shell> ln -s /opt/mysql-standard-5.0.9-beta-linux-i686 mysql
^!g;q3Z&~0     shell> cd mysql
aW1Yzp Bm)h0     shell> scrīpts/mysql_install_db --user=mysql51Testing软件测试网 @(eW/i$d@8\W,a
改变相应权限
8u |-euqU7kx }s m0     shell> chown -R root  .
+]bc WJz5e0     shell> chown -R mysql data
m_k9X?v0     shell> chgrp -R mysql .51Testing软件测试网r*_0wC?|T D
运行mysql51Testing软件测试网xv+^(Fr
     shell> bin/mysqld_safe --user=mysql &
6SMz D7[Gi)F051Testing软件测试网w?-D1o|O c
如果安装正确会出现下面字样51Testing软件测试网D~m_ OpGM
[1] 17673                               <----进程pid号~:)51Testing软件测试网#YKoKh n fhM0G
root@ubuntu:/usr/local/mysql # Starting mysql daemon with databases from /usr/local/mysql/data
T.P*g"b2mI2]KRu0okey,出现上面信息说明mysql正在运行了~51Testing软件测试网U q ip ]+EDM~)w.O
呵呵,用 ps -aux|grep mysql命令可以看到进程
!U-hVFr)]0--------------------------------------------------------------------------------51Testing软件测试网|A!{d?B)_]RD
apache2的安装51Testing软件测试网 g5t-^&lU*FNhk8T
    shell>cd /opt
^@Wq ~%tj W0    shell>tar zxvf httpd-2.0.54.tar.gz
k&S fdTA0    shell>cd httpd-2.0.5451Testing软件测试网;Eu*b3q.bq6k ~ S
    shell> ./configure --enable-so --enable-so;make;make install
2|2I8NU8{K8OM0    shell>
cd /usr/local/apache2/bin
(E"o,T~F4v0    shell>
./apachectl start51Testing软件测试网Uw%A_9bMo
这时终端没有错误提示说明安装运行成功了哦,用浏览器浏览http://127.0.0.1看看。 :)51Testing软件测试网*QNZ)J0hj |l9O
--------------------------------------------------------------------------------
b$|?a9I#C3dz/R0php的安装(我安装的时候遇到错误,经过对错误信息的分析,编译安装需要flex这个包,安装前建议先sudo apt-get install flex装下看看~^^)51Testing软件测试网?aI3j&y7w8]h7z6^I+g
    shell>cd /opt51Testing软件测试网Vc0B,K fS
    shell>tar zxvf php-5.0.4.tar.gz
v*o7s*xTg$_]!R[w0    shell>cd  php-5.0.4
w,|(AM4HD'I0    shell>
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql
~ sOp,? i0如果当configure结束的时候出现
}R9V7W#n;T)M1F0
+--------------------------------------------------------------------+
uY/aS.^2c0│ License: │51Testing软件测试网4Kf6G9m1C
│ This software is subject to the PHP License, available in this │
[} g-o4Z0│ distribution in the file LICENSE. By continuing this installation │
*}*H}'[Xoe0k0│ process, you are bound by the terms of this license agreement. │51Testing软件测试网}1F?YE7^
│ If you do not agree with the terms of this license, you must abort │
V m H*C(X7K8{'p0│ the installation process at this point. │
6a.\CBG0+--------------------------------------------------------------------+
QG{Q^$L051Testing软件测试网7n9rU6tin!V|G
Thank you for using PHP.
i8\6T]'V'p k0那就恭喜了说明配置成功,下面可以安装了,如果出现错误只能一个一个的分析错误。51Testing软件测试网fI%OBewF?
    shell>make;make install51Testing软件测试网(_z'Z@b!wD"P+B
    shell>
cp php.ini-dist /usr/local/lib/php.ini51Testing软件测试网9|MA B!P b O IN
将php整合到apache2上51Testing软件测试网p/u0F:z+t;ok'B
     shell>gedit/usr/local/apache2/conf/httpd.conf
51Testing软件测试网(SO!MMs^r
找到DirectoryIndex改为如下:51Testing软件测试网1LR6{8~ T$[7r6H
    DirectoryIndex index.html index.php index.htm index.html.var51Testing软件测试网-U3Yef$A7m:i

|8f9IM B*~/A0
8GQ(R vy.c)wh0找到
+d$SO `a\(K.U0    AddType application/x-compress .Z
K,s3B6O2T']0    AddType application/x-gzip .gz .tgz51Testing软件测试网6n;{D_+V8@T
在它后面添加
i#Ui!L5oaF0    AddType application/x-httpd-php .php
#FTC T$h0
Y8A+lJg,R:d6F0
gv`#d2A2V:DP0重启apache51Testing软件测试网#N"^YP!q0H
    shell> /usr/local/apache2/bin/apachectl restart 51Testing软件测试网'isyz/`N

y$qLx+P&|0
.B&F~i E0测试php
}0G,e+Z_0    shell>gedit /usr/local/apache2/htdocs/index.php51Testing软件测试网*_k&jDJ
添加<? phpinfo();?>51Testing软件测试网 U-H(_*R9rs(y(Of

/Tz#Nj7q!o6e0打开浏览器,输入
7Ep6G,K"i_0
http://127.0.0.1/index.php
?8f2[6r eM3E051Testing软件测试网jLm+FZI\5z k
可以看到关于php的信息,证明php安装成功。
$l2j"N QS#EoT0
--------------------------------------------------------------------------------
9Z"f7Z2a l)@-~0开机运行mysql & apache51Testing软件测试网y rEH2V5q0`1sQ
  在/etc/init.d目录下建立两个软联接51Testing软件测试网-Ba6`2K dQ~;D9d s
   shell>cd /etc/init.d51Testing软件测试网,Wu { Cpfg`6Nf {&?;T
   shell>ln -s /usr/local/apache2/bin/apachectl apche251Testing软件测试网7^,S-t{#\[%oF
   shell>ln -s /usr/local/mysql/support-files/mysql.server mysql
#~Ep yo U0  在/etc/rc2.d目录下建立两个软联接
j e_!S|)n;o1U0   shell>cd /etc/rc2.d51Testing软件测试网;BW1e}R1t
   shell>ln -s /init.d/apache2 S17apache51Testing软件测试网3U&e2K5t+h
   shell>ln -s /init.d/mysql S18mysql
Yz!F._4E8k%[0  重启操作系统51Testing软件测试网$CW.vT8r
   shell>reboot
[Q fJB%d0  重启后看看mysql的进程内容
.goDq J}0   shell>ps -aux|grep mysql
`0S r;?q6v0  查看apche2的进程内容51Testing软件测试网R%opuYBB] {
   shell>ps -aux|grep apche251Testing软件测试网'E)A/P cXg8C3|5m
--------------------------------------------------------------------------------
~4wj Lu@!J,S"J0/usr/bin下建立两个shell脚本51Testing软件测试网8h d wg o5I[3c
   shell>cd /usr/bin
/U [^~}5@I5J0   shell>gedit apache2
&l)C6Gt.j-_x0输入一下两段保存退出
'KY @iVX)i_Sv0#! /bin/sh
4TU.E7\3G5?$N'}+W051Testing软件测试网{ `(n6h$AS+n|j x
exec /usr/local/apache2/bin/apachectl "$@"
%X&PH(CYI0  shell>gedit mysql
3Jo,l\S{k;z0^h0输入以下两端保存退出51Testing软件测试网 Y ?Ak a8G;m~
#! /bin/sh
S/yP'X*T9X}0
eO;I2]^s F0exec /usr/local/mysql/support-files/mysql.server "$@"51Testing软件测试网3n.@ ]y k2e#{

k?:Sq4R2F3r0付予两个脚本可执行权限51Testing软件测试网'vX$RdT-X'u0Z
  shell>chmod +x mysql
-[ps&@1Du5~L2i0  shell>chmod +x apache2
5]\lfr{_/t/^0这样只要在任何地方即可使用
5}&Oc9]VQ7s0apache2 start|stop|restart|reload
5L~e7`${h1{"~z0mysql start|stop|restart|reload
51Testing软件测试网0T+EW9q%H f'y @
--------------------------------------------------------------------------------51Testing软件测试网Q+Plvdz?'[7j,C
重于完整了。嘿嘿~~开机运行是搞了1天的成果!
G#e%u4aQG @|0在此感谢ubuntu中文官方论坛。嘿嘿~

2VJlz?R!X0--------------------------------------------------------------------------------
"R xm.q*I_/r7t0参考文章:http://www.xxlinux.com/2004-11/20041118152440.htm
~"^jxp*k,}zC"Z0--------------------------------------------------------------------------------51Testing软件测试网)a%W/\;b Yz$CRKA

TAG: Linux

 

评分:0

我来说两句

日历

« 2024-04-06  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 45663
  • 日志数: 42
  • 图片数: 3
  • 文件数: 1
  • 书签数: 13
  • 建立时间: 2007-01-05
  • 更新时间: 2007-03-03

RSS订阅

Open Toolbar