Home  >  Article  >  Operation and Maintenance  >  How to publish a static website on centos

How to publish a static website on centos

WJ
WJOriginal
2020-06-06 16:40:342842browse

How to publish a static website on centos

#How to publish a static website in centos?

1. Install the Apache service

# yum  install  -y  httpd
#systemctl  start  httpd.service
/etc/httpd/conf:该目录存放Apache服务器的配置文件
/var/www/html:该目录是Apache服务器的默认站点根目录
/etc/httpd/logs:Apache服务器的日志文件目录

2. Test whether Apache is installed successfully

In the browser Enter: localhost in the address bar for testing

3. Copy the website code exam to the /var/www/html/ directory, and modify the configuration file:

Vim/etc/httpd/conf/httpd.conf

Modification: DocumentRoot "/var/www/html/" is DocumentRoot "/var/www/html/exam"

[After modifying the configuration file, you must restart the service: systemctl restart httpd

Enter the address to access directly

Related reference: centOS tutorial



The above is the detailed content of How to publish a static website on centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn