Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install jdk-nginx-mysql-tomcat in java web server built by raspberry pie

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install jdk-nginx-mysql-tomcat in raspberry pie building java web server. I hope you will get something after reading this article. Let's discuss it together.

Install nginx web server (approx. 6MB)

Sudo apt-get install nginx

2. Start nginx

Sudo / etc/init.d/nginx start

The www root directory of nginx is in / usr/share/nginx/www by default

3. Modify the configuration file of nginx

Sudo vi / etc/nginx/sites-available/default

1) pay attention to the following options:

Listen 8080; # # listen for ipv4; this line is default and implied

/ / Port number of the monitor. If it conflicts with other software, you can change it here.

Root / usr/share/nginx/www

/ / nginx default path the path where html is located

Index index.html index.htm index.php

/ / the type of web page nginx is looking for by default. We can add an index.php.

2) PHP script support (PHP scripts cannot be recognized without these items)

Find the definition segment of php and remove the comments from these lines. The modified content is as follows

Location ~ .php ${

Fastcgi_pass unix:/var/run/php5-fpm.sock

Fastcgi_index index.php

Include fastcgi_params

}

There are some other definitions in the php section, so don't touch it, such as:

# fastcgi_split_path_info...

# fastcgi_pass 127.0.0.1:9000

4) install php and sqlite (about 3MB)

Sudo apt-get install php5-fpm php5-mysql

5) reload the configuration of nginx

Sudo / etc/init.d/nginx reload

6) Test html

Access the raspberry pie through the host's IE, and you can see the home page (indicating that the Web server has started normally)

7) Test php

Generate a php file in raspberry pie

Sudo vi / usr/share/nginx/www/index.php

=

Install mysql

First, update our raspberry pie software.

Sudo apt-get update

Install the mysql service after waiting for the update to finish

Sudo apt-get install mysql-server

You need to enter the login password of root in mysql twice during installation.

Log in to mysql after successful installation using the following command

Mysql-u root-p

If you need to open a mysql remote connection after a successful login, run the following command to add remote access to the root user

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' 123456 'WITH GRANT OPTION;mysql > flush privileges

Raspberry pie mysql only listens for local ip access by default, and / etc/mysql/my.cnf needs to be modified if remote IP access is needed.

Vi / etc/mysql/my.cnf

find

# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.bind-address = 127.0.0.1

Change 127.0.0.1 to 0.0.0.0 for remote access.

After reading this article, I believe you have some understanding of "how to install jdk-nginx-mysql-tomcat in raspberry pie building java web server". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report