阅读内容

Apache+PHP+MySQL安装相关

[日期:2008-02-08] 来源:Linux公社  作者:Linux


A. Install MySQL on Linux (From MySQL official site -- www.mysql.com)
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip  cd mysql-VERSION
shell> CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \

       -fno-exceptions -fno-rtti" ./configure \
       --prefix=/usr/local/mysql --enable-assembler \
       --with-mysqld-ldflags=-all-static
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
 
B. Install apache
 
shell> tar xjvf httpd-VERSION.tar.bz2
shell> cd httpd-VERSION
shell> ./configure --prefix=/usr/local/apache --enable-so
      PS: If you want to enable the most modules of apache,you can use "--enable-module=most". "--enable-modules=all" will enable all the modules of apache.
shell> make
shell> make install
 
C. Install php
 
shell> tar xzvf php-VERSION.tar.gz
shell> cd php-VERSION
shell> ./configure --prefix=/usr/local/php\
       --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql
shell> make
shell> make install
shell> cp php.ini-dist /usr/local/php/lib/php.ini
 
D. Post configuration
 
  Make sure the libphp5.so in /usr/local/apache/modules/ directory.then edit the httpd.conf in /usr/local/apache/conf/ directory with you fimilar text edit tools,such as vi. check if there is a line like this:
 
   LoadModule php5_module        modules/libphp5.so
 
then,add the following lines to httpd.conf:
 
   AddType application/x-httpd-php .php .php3 .php4 .phtml
   AddType application/x-httpd-php-source .phps
 
E. Start service and check if it works properly
 
  Put a file named test.php into apache's document-root. add the following lines to test.php:
 
     phpinfo();
  ?>
 
  starting the web service via "/usr/local/apache/bin/apachectl start",and browsing it with your web client.(i.e Firefox):
  http://127.0.0.1/test.php
 
this should works, but you still have a lot of works to do to make web server safer.



相关资讯       PHP  Apache 
本文评论       全部评论
发表评论
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款


点评: 字数
姓名:

L
I
N
U
X


GOOGLE搜索
Google