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 configure Apache Web Services for RHEL 8

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you how to configure RHEL 8 Apache Web service, I believe that 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!

Because of its open source, cross-platform application, support for a variety of web programming languages, modular design, stable operation, good security and other advantages, Apache service is widely used to host Web services. Combined with Linux, PHP, MySQL and other components, it can give full play to its unique advantages, so it is a better choice for the construction of small websites.

Environment

Red Hat Enterprise Linux release 8.0 VMware Workstation Pro 14

Construction step [root@localhost ~] # yum install-y httpd [root@localhost ~] # systemctl start httpd [root@localhost ~] # iptables-F [root@localhost ~] # systemctl stop firewalld [root@localhost ~] # systemctl disable firewalldRemoved / etc/systemd/system/multi-user.target.wants/firewalld.service.Removed / etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@localhost ~] # setenforce 0 [root@localhost ~] # ifconfigens33: flags=4163 mtu 1500 inet 192. 168.10.118 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::e09a:769b:83f0:8efa prefixlen 64 scopeid 0x20 ether 00:50:56:34:0d:74 txqueuelen 1000 (Ethernet) RX packets 1959 bytes 1690200 (MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1245 bytes 120922 (118.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 Inet 127.0.0.1 netmask 255.0.0.0 inet6:: 1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0virbr0: flags=4099 mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168 .122.255 ether 52:54:00:9c:ef:c6 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Enter 192.168.10.118 in the browser to view the Apache Web service status

Customize the home page content

[root@localhost ~] # echo "HELLO RHEL8" > / var/www/html/index.html [root@localhost ~] # systemctl restart httpd

Set up file sharing service

[root@localhost ~] # rm-rf / etc/httpd/conf.d/welcome.conf [root@localhost ~] # rm-rf / var/www/html/index.html [root@localhost ~] # touch / var/www/html/file {1.. 10} [root@localhost ~] # systemctl restart httpd

Set Port Mappin

View the host IP

Test the status of the file sharing service by typing 192.168.0.7Rom 118 in the browser

Solve Chinese garbled code

[root@localhost] # touch / var/www/html/ Hello Red Hat 8.txt [root@localhost] # systemctl restart httpd

The solution is to add IndexOptions Charset=UTF-8 to the / etc/httpd/conf/httpd.conf configuration file

[root@localhost ~] # vim / etc/httpd/conf/httpd.conf316 AddDefaultCharset UTF-8317 IndexOptions Charset=UTF-8 [root@localhost ~] # systemctl restart httpd is all the content of this article "how to configure Apache Web Services in RHEL 8". 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

Development

Wechat

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

12
Report