首 页文章中心

Linux学习网

您的位置Linux学习网 > Linux服务器应用 > 文章内容

ubuntu7.04下安装lamp+phpmyadmin

作者:佚名  来源:不详  发布时间:2008-7-15 8:10:00
一、在新立得中:编辑 –> 使用任务分组标记软件包 –> 勾选 LAMP Server

二、安装phpmyadmin:同样在新立得中搜索phpmyadmin,然后安装

三、启用 mod_rewrite 模块:sudo a2enmod rewrite

四、配置 apache2.conf:sudo gedit /etc/apache2/apache2.conf
去掉 AddHandler cgi-script .cgi 前的注释 “#”(有两个#)。

然后在任意地方添加这么一段:

DocumentRoot /var/www/

Options FollowSymLinks
AllowOverride all


Options ExecCGI



对Nicky的补充:还要再加上一句:ServerName ,否则重启服务器的时候会提示:

* Forcing reload of apache 2.0 web server...
apache2: Could not determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

五、重启服务器:sudo /etc/init.d/apache2 restart

OK了!

Nicky:

说明: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 。


这么安装完以后用http://localhost/phpmyadmin可以访问phpmyadmin,但无法访问http://localhost,只可以用IP访问(内网IP),127.0.0.1也不行。如http://192.168.1.5 访问

刚才把window下的一个文件夹xiaonei移到var/www下,但是用http://localhost/xiaonei/index.html或者http://192.168.1.5/xiaonei/index.html会提示

Forbidden
You don't have permission to access / on this server.

把文件夹和里面文件的权限全部改为root且“读写”就可以了(用http://localhost/xiaonei/index.html或者http://192.168.1.5/xiaonei/index.html都没有问题,但http://localhosthttp://localhost/xiaonei仍然提示forbidden)
收藏本页到: 365Key | del.icio.us | | 添加到雅虎收藏+
  • 网站帮助 - 广告合作 - 网站地图