About the site configuration of apache2 under linux

The http service provided by apache on linux is not limited to port 80

This means you can use and assign ports however you want

Of course, the server I bought from the rookie chicken with a huge sum of money (nine yuan and nine) is of course unwilling to be mined by others (if I want to mine, it is also my own (╯‵□′)╯︵┻━┻)

Therefore, you can avoid common ports to prevent scanning and improve the concealment of the website.

Or one server can bind multiple sites

 

This requires modifying the apache configuration file (the default installation path is /etc/apache2/)

There are two configuration files involved (apache2)

/etc/apache2/sites-available/000-default.conf (hereinafter referred to as 000)

/etc/apache2/ports.conf (hereinafter referred to as port)

The steps to open a new site are very simple. For example, we need to open port 1234 as a web site and bind /var/www/html/ as the site root directory

<<<<<<<

First open the 000 file and write the following code at the end of the file:

<VirtualHost *:1234>
        DocumentRoot /var/www/html/
        ServerAdmin webmaster@localhost
</VirtualHost>
保存

Then open the port file and write at the beginning of the file

Listen 1234

Finally, due to the modification of the configuration file, the apache service needs to be restarted /etc/init.d/apache2 restart

Visit localhost:1234 again and you will find that the site has been opened

>>>>>>>

 

Advanced thinking:

Forget it, don't think about it, I won't write it here.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325270402&siteId=291194637