我在Ubuntu中设置apache2服务器时遇到问题。
我做了一个sudo apt-get install并正常安装。我能够在访问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 / 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
答案 0 :(得分:0)
配置文件存在问题。尝试通过以下方式更改第14行:
AddHandler mod_python .py