Apache2 Setup Ubuntu



我在Ubuntu中设置apache2服务器时遇到问题。

我做了一个sudo apt-get安装,它安装正常。在访问localhost时,我能够看到该站点正在工作。

然后我不确定发生了什么,但我再也看不到"它有效!"网站了。当我尝试重新启动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/站点启用/000默认值:

服务器管理员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

您的配置文件有问题。尝试通过以下方式更改第14行:

AddHandler mod_python .py

最新更新