moinmoin apache2配置

对apache2不熟,折腾了半天,记录一下,主要就是virtualhost那块比较乱

 

Virtual Hosts Settings

Virtual hosts allow you to run different servers for different IP addresses, different host names, or different ports on the same machine. For example, you can run the website for http://www.example.com and http://www.anotherexample.com on the same Web server using virtual hosts. This option corresponds to the <VirtualHost> directive for the default virtual host and IP-based virtual hosts. It corresponds to the <NameVirtualHost> directive for a name-based virtual host.

The directives set for a virtual host only apply to that particular virtual host. If a directive is set server-wide and not defined within the virtual host settings, the default setting is used. For example, you can define a Webmaster email address and not define individual email addresses for each virtual host.

Set the DocumentRoot directive to the directory that contains the root document (such as index.html) for the virtual host. The default DocumentRoot is /var/www.

The ServerAdmin directive within the VirtualHost stanza is email the address used in the footer of error pages if you choose to show a footer with an email address on the error pages.

这一段参考:https://help.ubuntu.com/6.06/ubuntu/serverguide/C/httpd.html

 

 

moinmoin的配置方法在/usr/share/doc/python-moinmoin/README.Debian.gz里面有

ports.conf中新增一个端口

NameVirtualHost *:8000
Listen 8000

sites-available中:新建一个mywiki文件

 

 1  < VirtualHost  *:8000 >
 2      ServerAdmin webmaster@localhost
 3      ServerName localhost
 4      # 用来匹配请求的服务器名
 5      # 比如localhost:8000/MyWiki就会匹配这个配置文件所配置的服务器
 6      
 7      DocumentRoot /var/www/mywiki/
 8      Alias /moin_static185/applets/FCKeditor/ "/usr/share/fckeditor/"
 9      Alias /moin_static185/ "/usr/share/moin/htdocs/"
10      Alias /wiki "/usr/share/moin/htdocs/"
11      ScriptAlias /MyWiki "/var/www/mywiki/moin.cgi"
12 
13      ErrorLog /var/log/apache2/error.log
14 
15      # Possible values include: debug, info, notice, warn, error, crit,
16      # alert, emerg.
17      LogLevel warn
18 
19  </ VirtualHost >
20 

 访问localhost:8000/MyWiki 就可以了

你可能感兴趣的:(apache)