Linux set up a simple http file server

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_44018338/article/details/102611144

In order for an automated script installation package can be downloaded by wget, you need to deploy a http file server in the cluster a node

  • In Ubuntu by apt-get install apache2 mounting apache2
    in CentOS7 by yum install httpd mounting httpd
  • apache2 configuration file is /etc/apache2/apache2.conf
    httpd configuration file is/etc/httpd/conf/httpd.conf
  • Profile similar contents inside, not described in detail here, both default access port is port 80, which is of course can be modified in the configuration file.
  • Start installed at service httpd start start service httpd restart to restart the service httpd stop stop service
  • Can be found in the configuration file, the default server access path in the /var/www/htmldirectory. Just to achieve a simple http file server, so you can create a soft link in this directory to connect to the file directory.
    • 192.168.1.10 this node as the installation package file directory /home/nn/package/, and then the command ln -s /home/nn/package/ filein /var/www/html/created a soft link in the directory.
    • In the browser you can http://192.168.1.10/fileaccess to the file directory, as follows:

 

 

 

    • As long as the other machine on the same LAN can be by wget 192.168.1.10/file/xxxdownloading the installation package. Since then, the first step in an automated script is completed.

Guess you like

Origin blog.csdn.net/weixin_44018338/article/details/102611144