本次,讓咱們先來完成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