Ubuntu 7.04系统上安装Apache PHP MySQL

来源: Linux论坛
1、安装 Apache2+PHP5+MySQL
 
  sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd mysql-server php5-mysql phpmyadmin
 
  joelhy 提醒 这一步可以使用新立得来安装,同样效果。
 
  打开新立得,编辑 –> 使用任务分组标记软件包 –> 勾选 LAMP Server
 
  然后再单独安装 phpmyadmin
 
  sudo apt-get install phpmyadmin
 
  2、启用 mod_rewrite 模块
 
  sudo a2enmod rewrite
 
  3、配置 apache2.conf
 
  sudo gedit /etc/apache2/apache2.conf
 
  去掉 AddHandler cgi-script .cgi 前的注释 “#”。
 
  然后在任意地方添加这么一段:
 
   &<60;&<60; &<60;DocumentRoot /var/www/

&<60;&<60; &<60;

&<60;&<60; &<60; &<60; &<60;Options FollowSymLinks

&<60;&<60; &<60; &<60; &<60;AllowOverride all

&<60;&<60; &<60;

&<60;&<60; &<60;

&<60;&<60; &<60; &<60; &<60;Options ExecCGI

&<60;&<60; &<60;
 
  重启服务器
 
  sudo /etc/init.d/apache2 restart
 
  搞定。
 
  说明:PHP 程序放 /var/www/ 下面都可以,CGI 程序放 /var/www/cgi-bin/ 下面。
 
  是不是太简单了,除去下载的时间,要不了一分钟就可以完成配置,在 Ubuntu 上还需要 APM 包吗?还是记住以下几个命令和位置就行了。
 
  sudo /etc/init.d/apache2 restart (重启 apache)
 
  sudo gedit /etc/php5/apache2/php.ini (配置 php.ini)
 
  sudo gedit /etc/apache2/apache2.conf (配置 apache2.conf)
 
  /var/www/(主目录位置)
 
  以上服务器配置,经测试可以正常运行 WordPress、Habari、Movable Type.

发表新评论

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <i> <b> <a> <em> <strong> <small> <big> <cite> <code> <img> <ul> <ol> <li> <dl> <dt> <dd> <tbody> <th> <table> <caption> <colgroup> <col> <thead> <tfoot> <br> <tr> <table> <td> <span> <p> <h1> <h1> <h1> <h2> <h3> <h4> <h5> <hr> <!--> <ins> <del> <kbd> <quote> <blockquote>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
10 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.