CentOS搭建配置lighttpd(php、Virtual Host)

一、解压lighttpd-1.4.23.tar.gz
[root@localhost ~]# tar zxvf lighttpd-1.4.23.tar.gz

二、试安装lighttpd-1.4.23
[root@localhost ~]# cd lighttpd-1.4.23
[root@localhost lighttpd-1.4.23]# ./configure --prefix=/usr/local/lighttpd
configure: error: in `/root/lighttpd-1.4.23':
configure: error: no acceptable C compiler found in $PATH

三、配置yum网站
1、安装gcc出现错误
[root@localhost yum.repos.d]# yum install gcc
Could not retrieve mirrorlist CentOS.org/?release=5&arch=x86_64&repo=addons error was
[Errno 4] IOError: <urlopen error (-3, 'Temporary failure in name resolution')>
Error: Cannot find a valid baseurl for repo: addons
2、修改yum目录及设置域名服务
[root@localhost lighttpd-1.4.23]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vi CentOS-Base.repo
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
改为
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
另:国内镜像
[root@localhost yum.repos.d]# echo "nameserver 8.8.8.8" >> /etc/resolv.conf
Google承诺将严格遵循DNS协议,即不阻挡、不劫持和不过滤用户查询。
Google Public DNS服务器IP
8.8.8.8        google-public-dns-a.google.com
8.8.4.4        google-public-dns-b.google.com
3、确认能访问mirrorlist.centos.org
[root@localhost yum.repos.d]# ping mirrorlist.centos.org

四、安装gcc
[root@localhost yum.repos.d]# yum install gcc

五、安装其他包
[root@localhost yum.repos.d]# yum install pcre pcre-devel zlib-devel bzip2 bzip2-devel

六、安装lighttpd-1.4.23
[root@localhost yum.repos.d]# cd ~/lighttpd-1.4.23
[root@localhost lighttpd-1.4.23]# ./configure --prefix=/usr/local/lighttpd
[root@localhost lighttpd-1.4.23]# make
[root@localhost lighttpd-1.4.23]# make install

七、配置lighttpd-1.4.23
[root@localhost lighttpd-1.4.23]# cp ./doc/lighttpd.conf /usr/local/lighttpd/
[root@localhost lighttpd-1.4.23]# cd /usr/local/lighttpd/
[root@localhost lighttpd]# vi lighttpd.conf
server.modules              = (
                                "mod_rewrite",
                                "mod_redirect",
                                "mod_alias",
                                "mod_access",
#                               "mod_trigger_b4_dl",
#                               "mod_auth",
#                               "mod_status",
#                               "mod_setenv",
#                               "mod_fastcgi",
                                "mod_proxy",
#                               "mod_simple_vhost",
                                "mod_evhost",  #虚拟主机
#                               "mod_userdir",
#                               "mod_cgi",
#                               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
#                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog" )

server.document-root        = "/var/www/htdocs/"

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygsdz.html