1.1. 安装 Apache [[email protected] src]# yum remove httpd*
[[email protected] src]# wgethttp://apache.etoak.com//httpd/httpd-2.2.22.tar.gz
序列号 | CPU | RAM | HDD | 带宽 | 售价(美元) | 免费试用 |
---|---|---|---|---|---|---|
香港服务器1 | E5-2620 | 32G | 1T HDD | 50M/无限流量 | $196.00 | 立即申请 |
香港服务器2 | E5-2650 | 32G | 1T HDD | 50M/无限流量 | $256.00 | 立即申请 |
香港服务器3 | E5-2680 | 32G | 1T HDD | 50M/无限流量 | $316.00 | 立即申请 |
香港服务器4 | E5-2690 | 32G | 1T HDD | 50M/无限流量 | $336.00 | 立即申请 |
香港服务器5 | E5-2697 | 32G | 1T HDD | 50M/无限流量 | $376.00 | 立即申请 |
香港服务器6 | E5-2620*2 | 32G | 1T HDD | 50M/无限流量 | $376.00 | 立即申请 |
香港服务器7 | E5-2650*2 | 32G | 1T HDD | 50M/无限流量 | $436.00 | 立即申请 |
香港服务器8 | E5-2680*2 | 32G | 1T HDD | 50M/无限流量 | $476.00 | 立即申请 |
香港服务器9 | E5-2690*2 | 32G | 1T HDD | 50M/无限流量 | $556.00 | 立即申请 |
香港服务器10 | E5-2697*2 | 32G | 1T HDD | 50M/无限流量 | $596.00 | 立即申请 |
香港服务器11 | E5-2680v4*2 | 32G | 1T HDD | 50M/无限流量 | $696.00 | 立即申请 |
香港服务器12 | E5-2698v4*2 | 32G | 1T HDD | 50M/无限流量 | $796.00 | 立即申请 |
[[email protected] src]# tar -zxvf httpd-2.2.22.tar.gz
[[email protected] src]# cd httpd-2.2.22
[[email protected] httpd-2.2.22]# ./configure–prefix=/usr/local/apache2 –enable-mods-shared=all -with-ssl-enable-ssl -enable-so
或
[[email protected] httpd-2.2.22]# ./configure–prefix=/usr/local/apache2 -with-ssl -enable-ssl -enable-so-enable-rewrite
[[email protected] httpd-2.2.22]# make
[[email protected] httpd-2.2.22]# make install
开机自启动要领配置
[[email protected] httpd-2.2.22]#cp -f/usr/local/apache2/bin/apachectl /usr/sbin/apachectl
[[email protected] httpd-2.2.22]#cp /usr/local/apache2/bin/apachectl/etc/rc.d/init.d/httpd
[[email protected] httpd-2.2.22]# chmod +x /etc/rc.d/init.d/httpd
[[email protected] httpd-2.2.22]#chkconfig –add httpd
[[email protected] httpd-2.2.22]#chkconfig –level 345 httpd on
呈现错误提示:service httpd does not support chkconfig
办理: 在文件/etc/rc.d/init.d/httpd中#!/bin/sh后头插手下面两行内容:
# chkconfig: 345 85 15
# description: Apache is a World Wide Webserver.
然后再
[[email protected] httpd-2.2.22]# chmod +x /etc/rc.d/init.d/httpd
[[email protected] httpd-2.2.22]#chkconfig –add httpd
[[email protected] httpd-2.2.22]#chkconfig –level 345 httpd on
另一种开机自启动要领配置:
[[email protected] httpd-2.2.22]# vi /etc/rc.local
插手以下内容
/usr/local/apache2/bin/apachectl start
启用Apache
[[email protected] httpd-2.2.22]# exportPATH=$PATH:/usr/local/apache2/bin
[[email protected] httpd-2.2.22]# apachectl start
或:
[[email protected] httpd-2.2.22]# service httpd -kstart
或
[[email protected] httpd-2.2.22]# httpd -k start
若呈现错误提示:
httpd: Syntax error on line 106 of/usr/local/apache2/conf/httpd.conf: Cannot load/usr/local/apache2/modules/libphp5.so into server:/usr/local/apache2/modules/libphp5.so: cannot open shared objectfile: No such file or directory
说明/usr/local/apache2/modules/libphp5.so不存在,郑州电信服务器服务器托管,需从头编译PHP,或在已编译好的PHP目次中将libphp5.so复制一份到apache2安装目次,如:
[[email protected] httpd-2.2.22]# cp/usr/local/src/php-5.4.4/libs/libphp5.so/usr/local/apache2/modules/
遏制Apache
[[email protected] httpd-2.2.22]# exportPATH=$PATH:/usr/local/apache2/bin
[[email protected] httpd-2.2.22]# apachectl stop
或:
[[email protected] httpd-2.2.22]# service httpd -kstop
或
[[email protected] httpd-2.2.22]# httpd -k stop
重启Apache
[[email protected] httpd-2.2.22]# exportPATH=$PATH:/usr/local/apache2/bin
[[email protected] httpd-2.2.22]# apachectl restart
或:
[[email protected] httpd-2.2.22]# service httpd -krestart
或
[[email protected] httpd-2.2.22]# httpd -k restart
若呈现以下错误:
httpd: Could not reliably determine the server’s fully qualifieddomain name, using 127.0.0.1 for ServerName
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address[::]:80
(98)Address already in use: make_sock: could not bind to address0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs