VMware virtual machine to establish HTTP service steps analysis

VMware virtual machine to establish HTTP service steps analysis

1. Use xshell to connect to the virtual machine, or type commands directly in the virtual machine.

The following are the commands on xshell:

First install the HTTPD package

[root@one ~]# mount /dev/sr0 /mnt
[root@one ~]# yum install httpd

Restart the service to view the status:

[root@one ~]# systemctl restart httpd

[root@one ~]# systemctl status httpd

Need to turn off the firewall

[root@one ~]# systemctl stop firewalld

Check if firewalld is turned off

[root@one ~]# systemctl status firewalld

[root@one ~]# setenforce 0

(setenforce is the Linux selinux firewall configuration command. Executing setenforce 0 means turning off the selinux firewall.)

[root@one ~]# getenforce

(Check the command of selinux status, enforce and permissive are set to 1 and 0 respectively)

Permissive

Execute the command to copy a file:

cp /usr/share/doc/httpd-2.4.6/httpd-vhosts.conf /etc/httpd/conf.d/

Rename to haha.conf

mv httpd-vhosts.conf haha.conf

Edit this file

vim haha.conf

Delete the blue content starting with #

Use dd to delete a single line. Enter 10dd to delete 10 lines.

Enter insert mode (press i or o)

Modified to the following (based on IP address) and added a few lines below.

The following one can be ignored for now

Create directory: /www/161

[root@one conf.d]# mkdir -p /www/161

Restart the service (I waited a long time)

[root@one conf.d]# systemctl restart httpd

If there is a problem, check the static (status) -l to display all, and then generally there is a problem with the configuration file haha.conf.

Write some content to the web page:

[root@one ~]# echo this is sebastiane blog > /www/161/index.html

Then you can enter the IP address on the web page to open

However, this method still cannot access the files uploaded to the virtual machine through http.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Solve the problem of black screen when starting VMware virtual machine
  • VMware virtual machine three connection methods example analysis
  • Using VMware IOInsight to perform refined virtual machine storage performance monitoring

<<:  How to query the latest transaction ID in MySQL

>>:  Some tips for using less in Vue projects

Recommend

Detailed explanation of the knowledge points of using TEXT/BLOB types in MySQL

1. The difference between TEXT and BLOB The only ...

Basic HTML directory problem (difference between relative path and absolute path)

Relative path - a directory path established based...

Docker overlay realizes container intercommunication across hosts

Table of contents 1. Docker configuration 2. Crea...

Linux C log output code template sample code

Preface This article mainly introduces the releva...

Method of building docker private warehouse based on Harbor

Table of contents 1. Introduction to Harbor 1. Ha...

How to use Linux commands in IDEA

Compared with Windows system, Linux system provid...

Understanding JavaScript prototype chain

Table of contents 1. Understanding the Equality R...

Summary of seven MySQL JOIN types

Before we begin, we create two tables to demonstr...

MySQL permission control details analysis

Table of contents 1. Global level 2. Database lev...

Detailed explanation of simple snow effect example using JS

Table of contents Preface Main implementation cod...