我在 Ubuntu 中设置我的 apache2 服务器时遇到问题。
我做了一个 sudo apt-get install 并且它安装正常。访问本地主机时,我能够看到该站点正在运行。
然后我不确定发生了什么,但我不再能够看到“它有效!” 网站。当我尝试重新启动 apache2 时,它返回:
Syntax error on line 17 of /etc/apache2/sites-enabled/000-default:
AddHandler requires at least two arguments, a handler name followed by one or more file extensions
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
有任何想法吗?
这是我的 /etc/apache2/sites-enabled/000-default:
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
DirectoryIndex index.html index.py
AddHandler mod_python.py
PythonHandler mod_python.publisher
PythonDebug On
</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 ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined