server.port=
时间: 2024-04-02 18:36:14 浏览: 19
这是Spring Boot应用程序的配置文件中的一个属性,用于指定应用程序监听的HTTP端口号。通过设置该属性,可以让应用程序监听指定的端口号,从而能够通过该端口号来访问应用程序提供的服务。如果不指定该属性,则默认情况下应用程序会监听8080端口。例如,设置端口号为8081,可以在配置文件中添加如下配置:
server.port=8081
这样应用程序就会监听8081端口了。
相关问题
server.port=9111 server.servlet.context-path=/BookManager spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/book_manager?useAffectedRows=true spring.datasource.username=root spring.datasource.password=root spring.redis.host=localhost spring.redis.port=6379 spring.redis.password= spring.servlet.multipart.max-file-size=10MB spring.servlet.multipart.max-request-size=100MB spring.servlet.multipart.enabled=false
这段配置是一个Spring Boot应用的配置文件,包含了一些关于端口号、数据库连接、Redis连接、文件上传等的配置信息。
- `server.port=9111`:指定了应用的端口号为9111。
- `server.servlet.context-path=/BookManager`:指定了应用的上下文路径为/BookManager,即访问应用时需要在URL中添加/BookManager。
- `spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver`:指定了数据库驱动类为com.mysql.cj.jdbc.Driver。
- `spring.datasource.url=jdbc:mysql://localhost:3306/book_manager?useAffectedRows=true`:指定了数据库的URL,连接本地的MySQL数据库book_manager,使用useAffectedRows模式。
- `spring.datasource.username=root`:指定了数据库的用户名为root。
- `spring.datasource.password=root`:指定了数据库的密码为root。
- `spring.redis.host=localhost`:指定了Redis的主机为localhost。
- `spring.redis.port=6379`:指定了Redis的端口号为6379。
- `spring.redis.password=`:指定了Redis的密码为空。
- `spring.servlet.multipart.max-file-size=10MB`:指定了文件上传的最大文件大小为10MB。
- `spring.servlet.multipart.max-request-size=100MB`:指定了文件上传的最大请求大小为100MB。
- `spring.servlet.multipart.enabled=false`:禁用了文件上传功能。
以上是对配置文件中各个配置项的解释,您可以根据自己的需求进行修改和使用。如果有其他问题,欢迎继续提问。
nohup java -jar luotuo.jar --spring.profiles.active=superprod --server.port=10007 >/dev/null &
这是一条 Linux 命令,用于在后台运行一个 Java 程序。解释如下:
- `nohup`:表示不挂起程序,即程序在执行时即使终端关闭也不会停止。
- `java -jar luotuo.jar`:表示运行名为 luotuo.jar 的 Java 程序。
- `--spring.profiles.active=superprod`:表示使用名为 superprod 的 Spring Profile 配置。
- `--server.port=10007`:表示将服务器端口设置为 10007。
- `>/dev/null`:表示将输出重定向到空设备,即不打印输出信息。
- `&`:表示将命令放到后台运行。
因此,这条命令的作用是在后台运行一个名为 luotuo.jar 的 Java 程序,使用 superprod 的 Spring Profile 配置,服务器端口为 10007,输出信息被重定向到空设备。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)