Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install apache in linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install apache in linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Download httpd-2.2.6.tar.bz2 and put httpd-2.2.6.tar.bz2 under / soft

[root@localhost ~] # cd / soft

[root@localhost soft] # tar jxvf httpd-2.2.6.tar.bz2 / / decompress the compressed package of apache

[root@localhost soft] # cd httpd-2.2.6 / / navigate to the httpd-2.2.6 folder

[root@localhost httpd-2.2.6] # ls / / View and display the contents of the httpd-2.2.6 folder

[root@localhost httpd-2.2.6] #. / configure-- help | more / / View the configuration parameters of installation apache

[root@localhost httpd-2.2.6] #. / configure-- prefix=/usr/local/apache-- enable-so / / configure apache path

[root@localhost httpd-2.2.6] # make / / compile apache

[root@localhost httpd-2.2.6] # make install / / install apache

[root@localhost httpd-2.2.6] # cd / usr/local/apache / / enter the directory of apache

[root@localhost apache] # cd conf/

[root@localhost conf] # cp-a httpd.conf httpd.conf- / / backup apache configuration file

[root@localhost conf] # chkconfig-- list httpd / / check whether the httpd service already exists

[root@localhost conf] # chkconfig httpd off / / disable the service that comes with httpd in the system, if there is a httpd service

[root@localhost conf] # service httpd status / / View the status of the built-in httpd service

[root@localhost conf] # / usr/local/apache/bin/apachectl-k start / / linux starts the apache command

[root@localhost conf] # netstat-an | grep: 80 / / check whether the linux80 port is open

[root@localhost conf] # ps-aux | View apache process under grep httpd / / linux

[root@localhost conf] # cd.. /..

[root@localhost local] # cp / usr/local/apache/bin/apachectl / etc/rc.d/init.d/apache / / copy the apache startup script

[root@localhost local] # vi / etc/rc.d/init.d/apache / / here is the edit apache startup script

At the beginning of #! / add under / bin/sh

# chkconfig: 2345 85 15

[root@localhost local] # chkconfig-- add apache / / add apache service

[root@localhost local] # chkconfig-- list apache / / lists apache services

[root@localhost local] # service apache stop / / stop the apache service

[root@localhost local] # netstat-an | grep: 80 / / check whether port 80 of linux is closed

[root@localhost local] # ps-aux | grep httpd / / check whether a httpd service exists. If the httpd service is started with its own before, it will cause the newly added apache service to fail to start.

[root@localhost local] # service apache start / / start the apache service

Open your server ip address to see if the default home page of tomcat appears. If so, congratulations.

The installation of apache under linux has been successful

The above is all the contents of the article "how to install apache in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report