Ubuntu16.04 uses nat123 to publish web applications

1. Environment:

  • A server that has just installed the Ubuntu16.04 operating system;
  • nat123 port mapping and dynamic domain name resolution software;
  • Local laravel project;

2. Start deployment:

  1. First configure the server environment, there are precedents and very detailed, the personal test runs perfectly, I will not cite them one by one: https://blog.csdn.net/hustcw98/article/details/79077841
  2. To supplement the above tutorial: 1. MySql needs to modify the binding ip in /etc/mysql/mysql.conf.d/mysqld.cnf to 0.0.0.0, otherwise even if a new user with host % is created in the database, it cannot be remotely Login; 2. The root user cannot log in remotely by default, and needs to modify the SSH configuration file; 3. Don’t forget to refresh permissions and restart the service; 4. Configure the maximum file that nginx allows to upload to 100m, otherwise chat files exceeding 1M will report a 413 error; 5. /etc/php/7.1/fpm/php.ini set post_max_size=100M, upload_max_filesize = 100M, otherwise the uploaded file will still report 413 error if it exceeds 2M;
  3. Since my telecommunications here has not blocked port 80, and the upstream bandwidth is 20M, I have a public IP from telecommunications, so I use nat123 to dynamically resolve my domain name to my server, and then I can access my server from all over the world; Write the command into the startup script: /etc/re.local to start the nat123 service and GateWayWorker;
  4. ufw firewall allows OpenSSH, HTTP, if you need to connect to MySql remotely, you need to allow port 3306;

3. Successful display:

  • All of the above holes have been filled by me one by one. Of course, when I encountered these mistakes, I was confused and at a loss, thanks to Du Niang and thank myself for not giving up lightly;



Guess you like

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