Linux rhel 6.4 apache編譯安裝以及簡單配置過程(2)

來源:互聯網
上載者:User

標籤:linux rhel 6.4 apache編譯安裝以及簡單配置過程(2)

Linux rhel 6.4 apache編譯安裝以及簡單配置過程(2)

註:以下摘取的都是安裝過程中執行的命令,命令反饋沒有貼出來以"......"代替。觀看的時候注意執行命令時所在的目錄。

將apache的科執行程式軟串連到/usr/local/bin下(可執行命令放到$PATH包含的路徑,方便執行apache的命令)

[[email protected] init.d]# ln -s /usr/local/apache/bin/* /usr/local/bin


將httpd加入到chkconfig中

service的管理命令都是在/etc/init.d下的

[[email protected] init.d]# cp /usr/local/apache/bin/apachectl /etc/init.d/http(apache自動啟動指令碼)

為服務指令碼加固定的台頭

[[email protected] init.d]# vim httpd

在#!/bin/sh下面添加下面兩行

#chkconfig: 2345 85 15

#description:Apache is a world wide web server.

將httpd加入到service的管理器中

[[email protected] init.d]# chkconfig --add httpd

查看下啟動結果

[[email protected] init.d]# chkconfig --list httpd

httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off



修改設定檔中的主機名稱(可以不改)

[[email protected] init.d]# vi /usr/local/apache/conf/httpd.conf

找到ServerName一行去掉#號注釋,然後添加主機名稱:80或者IP:80

ServerName 192.168.1.100:80


為了方便下次編譯 可以給httpd.conf做個軟串連

[[email protected] init.d]# ln -s /usr/local/apache/conf/httpd.conf /etc/htppd.conf


修改完成後啟動httpd

[[email protected] init.d]# service httpd start

[[email protected] init.d]#

啟動後沒有任何提示,我們檢查一下

[[email protected]manyu init.d]# netstat -anpt | grep httpd

tcp        0      0 :::80                       :::*                        LISTEN      30387/httpd


至此安裝apache後的簡單配置完成。


本文出自 “盛滿魚” 部落格,請務必保留此出處http://chengmanyu.blog.51cto.com/7198694/1911111

Linux rhel 6.4 apache編譯安裝以及簡單配置過程(2)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.