The domain name points directly to Aliyun's project master file.

every time I visit my Aliyun project, I use IP or domain name plus my project file name
how to configure the domain name to access my project main file directly?
Baidu sees the configuration of java. How should it be configured with PHP and Apache?
this is the way I visit every time.
clipboard.png

clipboard.png
if you have such a blog, please recommend

.
Apr.03,2021

first of all, what products did you buy from Aliyun? If it is a cloud service, can the ECS, log in to the server to modify the configuration file of apache? If it is a cloud virtual host, you can't log in to the server, so you can't use it below. Ask me again.

1. First of all, find the configuration file of apache. Generally speaking, the default path is / etc/httpd/conf/httpd.conf (the path is based on the actual installation directory of apache), and edit it.

vim /etc/httpd/conf/httpd.conf

2. Find the ServerName www.example.com:80 line, uncomment it, and change it to:

ServerName mm520zx.top:80

3. Find the DocumentRoot "/ var/www/html line, and change it to the directory where your project entry file index.php is located, for example:

DocumentRoot "/var/www/html/yimeisheng2.com"

4. Find the following:

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
Change

to

<IfModule dir_module>
    DirectoryIndex index.php
</IfModule>

apache root directory configuration

Menu