本次,让咱们先来完成Apache网站服务器的搭建,做为LAMP架构的前端,Apache是一款功能强大、稳定性好的Web服务器程序,该服务器直接面向用户提供网络访问,发送网页,图片等文件内容。html
本次安装须要用到的编译安装包:百度网盘密码:2r7m前端
mount.cifs //192.168.x.x/LAMP /opt/lamp tar xzvf http-2.4.2.tar.gz -C /opt tar xzvf apr-1.4.6.tar.gz -C /opt tar xzvf apr-util-1.4.1.tar.gz -C /opt
cp -R apr-1.4.6/ /opt/httpd-2.4.2/srclib/apr cp -R apr-util-1.4.1/ /opt/httpd-2.4.2/srclib/apr-util
yum install gcc gcc-c++ make pcre pcre-devel -y
cd /opt/httpd-2.4.2 ./configure \ --prefix=/usr/local/apache \ --enable-so \ --enable-rewrite \ --enable-mods-shared=most \ --with-mpm=worker \ --disable-cgid \ --disable-cgi
make && make install
grep -v "#" /usr/local/apache/bin/apachectl > /etc/init.d/httpdc++
vim /etc/init.d/httpd正则表达式
#在文件开头插入下面的行
#!/bin/sh
#chkconfig:2345 85 15
#description:Apache is a World Wide Web server.数据库
chkconfig --level 35 httpd on ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf
vim /etc/httpd.conf Listen:IPV4 #这里咱们能够监听本机地址 ServerName: #分别为主机名.域名
-apache
Redhat6.5中服务开启关闭命令 service httpd start service httpd stop 如在Redhat7.0以上版本,即为如下命令 systemctl start httpd.service systemctl stop httpd.service netstat -tnl //查看监听端口 主页存放路径为 /usr/local/apache/htdocs/index.html
service iptables stop setenforce 0