ubuntu7.04下最简单的安装lamp+phpmyadmin方法

2007-10-07 19:50| 分类:CSDN| 159 次点击

感谢Nicky参考Nicky博客,这里:http://www.osxcn.com/ubuntu/ubuntu-feisty-fawn-server.html

一、在新立得中:编辑 –> 使用任务分组标记软件包 –> 勾选 LAMP Server
二、安装phpmyadmin:同样在新立得中搜索phpmyadmin,然后安装
三、启用 mod_rewrite 模块:sudo a2enmod rewrite
四、配置 apache2.conf:sudo gedit /etc/apache2/apache2.conf
去掉 AddHandler cgi-script .cgi 前的注释 “#”(有两个#)。
然后在任意地方添加这么一段:

<Virtualhost localhost>
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/cgi-bin/>
Options ExecCGI
</Directory>
</Virtualhost>对Nicky的补充:还要再加上一句:ServerName <localhost>,否则重启服务器的时候会提示:

* 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
(见这里:http://www.wangchao.org/bbsdetail_47520.html)

五、重启服务器: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://www.linuxidc.com/Linux/2007-09/7429.htm  ubuntu 7.04 下搭建LAMP环境(图)

http://www.vipcn.com/InfoView/Article_242428.html  pache服务器不能确定你的主机名

http://www.osxcn.com/wordpress/ubuntu-and-wordpress.html  简单几步,在Ubuntu上跑WordPress
(见评论:如果是要快速把 Apache, MySQL, PHP 架起來 Linux 也有類似 APMXE 的東西, 就是 XAMPP

http://www.apachefriends.org/en/xampp-linux.html

安裝就更簡單了, 下載後把他直接解開就可以了.)

这么安装完以后用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://localhost和http://localhost/xiaonei仍然提示forbidden)

相关文章

  • 没有相关文章

发表您的评论

您的昵称:
您的邮箱:(可选,不会被公布)
您的网站: