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

Implementation of Nginx domain name forwarding https access

A word in advance: Suddenly I received a task to ...

Detailed explanation of various types of image formats such as JPG, GIF and PNG

Everyone knows that images on web pages are genera...

The benefits and examples of placing the site map at the bottom of the web page

In the past, almost every website had a sitemap p...

Example code for using HTML ul and li tags to display images

Copy the following code to the code area of ​​Drea...

Solution to Linux CentOS 6.5 ifconfig cannot query IP

Recently, some friends said that after installing...

Vue uses canvas to realize image compression upload

This article shares the specific code of Vue usin...

Sample code for programmatically processing CSS styles

Benefits of a programmatic approach 1. Global con...

Docker connection mongodb implementation process and code examples

After the container is started Log in to admin fi...

Detailed explanation of Linux kernel macro Container_Of

Table of contents 1. How are structures stored in...

Style trigger effect of web page input box

<br />This example mainly studies two parame...

Example statements for indexes and constraints in MySQL

Foreign Keys Query which tables the primary key o...

Example of how to implement keepalived+nginx high availability

1. Introduction to keepalived Keepalived was orig...

Detailed explanation of Linux file permissions and group modification commands

In Linux, everything is a file (directories are a...

CSS3 realizes the website product display effect diagram

This article introduces the effect of website pro...