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软件测试网rvLPU8UoIu7O
相关URL下载:http://dev.mysql.com/downloads/mysql/5.0.html 51Testing软件测试网7d%HSVj mlFr
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
5TwL/CT/N0php-5.0.4.tar.gz
6bo/c$|z0--------------------------------------------------------------------------------
~~!]2Fm L%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
aW1Y zpBm)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|Oc
如果安装正确会出现下面字样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软件测试网Uq 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 ~%tjW0 shell>tar zxvf httpd-2.0.54.tar.gz
k&S f dTA0 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软件测试网7n9rU6ti n!V|G
Thank you for using PHP.
i8\6T]'V'pk0那就恭喜了说明配置成功,下面可以安装了,如果出现错误只能一个一个的分析错误。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 bO IN
将php整合到apache2上51Testing软件测试网 p/u0F:z+t;ok'B
shell>gedit/usr/local/apache2/conf/httpd.conf51Testing软件测试网(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(Rvy.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
#FTCT$h0
Y8A+lJg,R:d6F0
gv`#d2A2V:D P0重启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_0http://127.0.0.1/index.php
?8f2[6r eM3E051Testing软件测试网 jLm+FZ I\5z k
可以看到关于php的信息,证明php安装成功。
$l2j"N QS#EoT0--------------------------------------------------------------------------------
9Z"f7Z2a l)@-~0开机运行mysql & apache51Testing软件测试网y rEH2V5q0`1sQ
在/etc/init.d目录下建立两个软联接51Testing软件测试网-Ba6`2K d Q~;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
sudo apt-get install build-essential51Testing软件测试网j3b)Jb"o i"`
具体需要哪些编译工具我也不清楚了~反正需要什么apt下就是了~:)
.xp+OnQA0--------------------------------------------------------------------------------51Testing软件测试网rvLPU8UoIu7O
相关URL下载:http://dev.mysql.com/downloads/mysql/5.0.html 51Testing软件测试网7d%HSVj mlFr
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
5TwL/CT/N0php-5.0.4.tar.gz
6bo/c$|z0--------------------------------------------------------------------------------
~~!]2Fm L%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
aW1Y zpBm)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|Oc
如果安装正确会出现下面字样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软件测试网Uq 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 ~%tjW0 shell>tar zxvf httpd-2.0.54.tar.gz
k&S f dTA0 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软件测试网7n9rU6ti n!V|G
Thank you for using PHP.
i8\6T]'V'pk0那就恭喜了说明配置成功,下面可以安装了,如果出现错误只能一个一个的分析错误。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 bO IN
将php整合到apache2上51Testing软件测试网 p/u0F:z+t;ok'B
shell>gedit/usr/local/apache2/conf/httpd.conf51Testing软件测试网(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(Rvy.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
#FTCT$h0
Y8A+lJg,R:d6F0
gv`#d2A2V:D P0重启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_0http://127.0.0.1/index.php
?8f2[6r eM3E051Testing软件测试网 jLm+FZ I\5z k
可以看到关于php的信息,证明php安装成功。
$l2j"N QS#EoT0--------------------------------------------------------------------------------
9Z"f7Z2a l)@-~0开机运行mysql & apache51Testing软件测试网y rEH2V5q0`1sQ
在/etc/init.d目录下建立两个软联接51Testing软件测试网-Ba6`2K d Q~;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