我在删除 VirtualHost 时遇到问题,所以我只想简单地编辑 /etc/apache2/sites-available/default 文件。事实证明,我正在尝试添加原始的“index.html”文件,该文件位于 /var/www/ 目录中。但它不起作用,因为另一个 VirtualHost 占用了端口 80,我没有在默认文件中看到我的“index.html”文件。我非常沮丧,所以我正在考虑重新安装 apache2 服务。但即使我使用此命令将其删除:
sudo apt-get install --remove apache2 php5 libapache2-mod-php5
即使我这样做了,它也没有被删除,并且在过程结束时我得到了这个错误:
Errors were encountered while processing:
libopenvnc-imgproc2.3
libavfilter2:armhf
libav-tools
ffmpeg
E: Sub-process /usr/bin/dpkg returned an error code (1)
有什么方法可以全新安装 apache2 以及 php5 和 libapache2-mod-php5,因为我在第一次获得 Pi 时已经安装了它们?我只是迷路了,我已经去了一百万个论坛,但没有一个能帮助我......
这是“默认”文件文本:
NameVirtualHost *:8091
NameVirtualHost *:80
NameVirtualHost *:443
这是我尝试做的,但没有奏效,它说找不到文件!
<VirtualHost *:80>
DocumentRoot /var/www/remote_replay.php
ServerName 192.168.1.80
</VirtualHost>
下面的这部分工作正常,但我想把它删除!!!!!!
WSGIDaemonProcess web2py user=www-data group=www-data
<VirtualHost *:8091>
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
WSGIPassAuthorization On
<Directory /home/www-data/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
/home/www-data/web2py/applications/$1/static/$2
<Directory /home/www-data/web2py/applications/*/static/>
Options -Indexes
Order Allow,Deny
Allow from all
</Directory>
<Location /admin>
Deny from all
</Location>
<LocationMatch ^/([^/]+)/appadmin>
Deny from all
</LocationMatch>
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/self_signed.cert
SSLCertificateKeyFile /etc/apache2/ssl/self_signed.key
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py
WSGIPassAuthorization On
<Directory /home/www-data/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
/home/www-data/web2py/applications/$1/static/$2
<Directory /home/www-data/web2py/applications/*/static/>
Options -Indexes
ExpiresActive On
ExpiresDefault "access plus 1 hour"
Order Allow,Deny
Allow from all
</Directory>
CustomLog /var/log/apache2/access.log common
ErrorLog /var/log/apache2/error.log
</VirtualHost>