CentOS quick installation, configuration Web server (Apache)

CentOS quick installation, configuration Web server (Apache)

In this article, we will learn how to quickly build a Web server.

Install Apache server

First, log in to the Linux server.

Install using yum:

yum install httpd -y

Start service

service httpd start

Add the Apache service to the startup

systemctl start httpd
systemctl enable httpd

Check whether the setting is successful:

systemctl list-unit-files | grep httpd

display:

httpd.service                                 enabled

Indicates that the auto-start is successfully set after booting.

test

In the browser, enter the ip address of the server, if the following page appears, the configuration is successful.

Insert picture description here

Home page modification

All Apache configuration files are located in /etc/httpd/conf and /etc/httpd/conf.d. The default website data is located under /var/www/html, which can be changed by modifying the /etc/httpd/conf/httpd.conf file.

In this example, we will create an index.html file under the /var/www/html directory, which will serve as the default homepage of the website:

cd /var/www/html
vim index.html

Enter budaya in index.html, and then you can see the new homepage in the browser.

[External link image transfer failed. The source site may have an anti-leech link mechanism. It is recommended to save the image and upload it directly (img-5yXbrhDP-1611058279527)(evernotecid://6FE75482-54A0-433A-9625-A01F7FEE92EC/appyinxiangcom/9896050/ENResource /p2996)]


PS: For more more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"
PS: More more content..., please check --> "Server Development"

Guess you like

Origin blog.csdn.net/u011578734/article/details/112851160