Gentoo安装Apache


Gentoo安装Apache很简单,直接 emerge  apache 即可,然而我emerge的时候出现了一个小问题,提示错误

"/etc/profile.env", line 1: Invalid token '' (not '=')

于是上网搜了一下,说是profile.env文件的问题,于是将这个文件删掉( rm  /etc/profile.env )

然后 env-update, 然后又报错

!!! Error loading '/var/cache/edb/mtimedb': 'utf-8' codec can't decode byte 0x80 in position 2: invalid start byte

然后果断再删掉 /var/cache/edb/mtimedb 

然后再 env-update,  成功


然后就简单了

emerge apache   // 安装apache

/etc/init.d/apache2 start   // 启动apache

rc-update add apache2 default  // 将apache加入到开机自动启动

然后在浏览器输入网址(如果是本机就输入127.0.0.1)进行验证。


如果需要修改Apache文件目录,可以修改配置文件 /etc/apache2/vhosts.d/default_vhost.include

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# If you change this to something that isn't under /var/www then suexec
# will no longer work.
DocumentRoot "/home/share/Apache/"

# This should be changed to whatever you set DocumentRoot to.
<Directory "/home/share/Apache">


将文件夹路径修改为想放置的文件夹即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值