2010年12月10日

Apache 2 - sites.available 的設定

以下本來是試 Apache::ASP 和 mono,看可否在 ubuntu + apache 之下,跑以前寫的 asp 程式。但是發現它們多是適用 asp.net 的架構, 而不是最早以前 IIS 下的簡單 asp 語法。
看來是要忍痛放棄 IIS 了...

<VirtualHost *:80>
RewriteEngine On
RewriteOptions Inherit
ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

Alias /asp_web "/home/XXX/asp_web/"
<Directory "/home/XXX/asp_web/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
SetHandler mono
DirectoryIndex index.aspx default.asp index.asp index.htm index.html

</Directory>

</VirtualHost>

轉程式碼, 參見 HTML encoder

沒有留言: