2012年2月25日
摘要: 在sudoers里加上# Set default EDITOR to vim, but allow visudo to use EDITOR/VISUAL.Defaults editor=/usr/bin/vim, env_editor 阅读全文
posted @ 2012-02-25 23:57 渊蓝之蓝 阅读(2449) 评论(1) 推荐(1) 编辑
摘要: 修改默认主页:输入这个命令 grep -iR DirectoryIndex /etc/apache2查看 DirectoryIndex 在apache2哪个文件里面。我的就是 这样的/etc/apache2/mods-enabled/dir.conf: DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm/etc/apache2/mods-available/dir.conf: DirectoryIndex index.html index.cgi index.pl index.php inde 阅读全文
posted @ 2012-02-25 20:02 渊蓝之蓝 阅读(4875) 评论(0) 推荐(0) 编辑
摘要: 在Windows下,Apache的配置文件通常只有一个,就是httpd.conf。但我在Ubuntu Linux上用apt-get install apache2命令安装了Apache2后,竟然发现它的httpd.conf(位于/etc/apache2目录)是空的!进而发现Ubuntu的 Apache软件包的配置文件并不像Windows的那样简单,它把各个设置项分在了不同的配置文件中,看起来复杂,但仔细想想设计得确实很合理。严格地说,Ubuntu的Apache(或者应该说Linux下的Apache?我不清楚其他发行版的apache软件包)的配置文件是 /etc/apache2/apache2. 阅读全文
posted @ 2012-02-25 19:46 渊蓝之蓝 阅读(63801) 评论(0) 推荐(0) 编辑
摘要: 错误:[warn] NameVirtualHost *:80 has no VirtualHosts原因:定义了多个NameVirtualHost解决:Ubuntu之前的版本定义在/etc/apache2/sites-available/default, 8.04后在/etc/apache2/ports.conf故可以将/etc/apache2/ports.conf中的NameVirtualHost *:80注释掉这个问题的本质是在没有定义域名是一个端口只能对应一个虚拟主机,将NameVirtualHost *:80改为其他端口也可以解决如果有多个不同的域名的话,用同样的端口也可以 阅读全文
posted @ 2012-02-25 19:01 渊蓝之蓝 阅读(16365) 评论(0) 推荐(0) 编辑
摘要: Saving iptables 保存设置If you were to reboot your machine right now, your iptables configuration would disapear. Rather than type this each time you reboot, however, you can save the configuration, and have it start up automatically. To save the configuration, you can useiptables-saveandiptables-restor 阅读全文
posted @ 2012-02-25 15:55 渊蓝之蓝 阅读(1330) 评论(0) 推荐(0) 编辑
摘要: 希望用户能够以http://X.X.X.X/~username方式来访问自己的网页,我参考了以下两个链接,做一个总结:1.http://www.zyxware.com/articles/2008/06/11/installing-and-configuring-apache-php-mysql-and-drupal-on-ubuntu#comment-5479这篇文章介绍修改apache2.conf和httpd.conf,1)apache2.conf中加入:<IfModule mod_userdir.c>UserDir public_htmlUserDir disabled roo 阅读全文
posted @ 2012-02-25 15:53 渊蓝之蓝 阅读(2595) 评论(1) 推荐(0) 编辑