初玩树莓派所遇见的坑

1 树莓派apt国内源修改

系统自带的源下载过慢,使用阿里云源或清华大学源
给出地址:
deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib

操作步骤为:

#备份为 sources.list.bak
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak   
#编辑sources.list  文件
sudo vim /etc/apt/sources.list     

修改源后,还可能不能下载,可将/etc/apt/sources.list.d/raspi.list中的内容给注释掉…

2 Apache2启动错误

使用
sudo apt-get install apache2安装Apache2,
使用sudo service apache2 start,竟然提示
Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for deta

使用sudo journalctl -xn详细查看错误部分

-- Logs begin at Wed 2016-12-21 16:54:46 CST, end at Thu 2016-12-22 09:19:46 CST. --
Dec 22 09:19:28 raspberrypi apache2[10170]: Output of config test was:
Dec 22 09:19:28 raspberrypi apache2[10170]: apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Could not open configuratio
Dec 22 09:19:28 raspberrypi apache2[10170]: Action 'configtest' failed.
Dec 22 09:19:28 raspberrypi apache2[10170]: The Apache error log may have more information.
Dec 22 09:19:29 raspberrypi systemd[1]: apache2.service: control process exited, code=exited status=1
Dec 22 09:19:29 raspberrypi systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit apache2.service has failed.
-- 
-- The result is failed.
Dec 22 09:19:29 raspberrypi systemd[1]: Unit apache2.service entered failed state.
Dec 22 09:19:29 raspberrypi sudo[10162]: pam_unix(sudo:session): session closed for user root
Dec 22 09:19:46 raspberrypi sudo[10303]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xn

提示.conf文件不能打开,猜想可能是一些包可能被删除或缺少了,之前又安装了php5,于是乎将PHP5重装了…竟然好了…
(完全删除:sudo apt-get purge apache2

猜你喜欢

转载自blog.csdn.net/u014271612/article/details/53765229
今日推荐