#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!