Very good picture site source code, you can use it. Reprinted in full. 1. Introduction to Java Photo Station Source Code Beauty Java photo site, PC version is exposed at 99mm.me, mobile version is exposed at m.99mm.me I scraped the pages of these two sites and integrated them into a project to determine whether the visitor's device is a PC or a mobile device on the server backend. The program does application-level caching: For example, I publish 3 sets of pictures every day. Within the effective time of the cache (24/3=8 hours), a page only accesses the database once and puts the queried data into memory. This greatly reduces the pressure on the database and improves the response speed of the server. When a user accesses a set of images in a browser, they only request the website server once. When you click to view the next picture in the set, use js to modify the picture link. No need to request the website server, load the image directly from the image server This program is tested on a server with 512M memory and can respond very quickly. Specific test environment: Centos7.5 system with 512M memory + JDK1.7 + Tomcat7 + MySQL5.5 It actually occupies about 300M of memory, and the rest is cached. The meaning of the database table fields can be found in the comments of domain in the source code. I am too lazy to write it here. Please refer to the image link in my.properties and change it yourself Change the database configuration in jdbc.properties according to the situation There are 3 default categories: sexy, beautiful legs, pure I wrote the code in the JDK 1.8 environment and used Maven to manage the package. The database table creation language is placed in the resources folder Local download : iht-Beauty-20181217 2. Install JDK1.7 + tomcat7 + Mysql5.5.61 environment under centos7.5 64 bit 1. Installation of JDK 1.7View the installable JDK
Select the 64-bit 1.7 version java-1.7.0-openjdk.x86_64 here
Check whether the installation is successful
If the version information appears, it means the installation is successful. (II) Installation of TomcatTomcat7 installation command >>> Soha <<<, copy all the following and paste it:
Enter the local folder
Go to the official website to find the download link of Tomcat and download it to the server. Here is a quick download address for Tomcat:
Unzip this folder:
Rename this file:
Note: Renaming is for the convenience of subsequent operations. It is not necessary to enter the bin folder.
Grant permissions to all shell scripts in this folder:
Start the tomcat service:
Check whether Tomcat is started successfully
(III) Installation of MySQL 5.5.61a. Installation preparationCentOS7 Mariadb database, uninstall first Method 1: rpm Find Version
uninstall
mariadb-libs-5.5.56-2.el7.x86_64 is the version in the current system. You can delete the configuration file according to the actual changes.
Method 2: yum
uninstall
Here mariadb-libs.x86_64 is the corresponding version to delete the configuration file
b. Detailed installation 1. Download MySQL Community Server 5.5.61 from the official website
3. Download mysql to the server
4. Unzip
5.Change the folder name, pay attention to the folder name..
6. Modify the my.cnf configuration file
Add the following to my.cnf
7. Switch to the mysql directory
8. Add user groups and users. Here you need to switch the directory to the mysql directory.
9. Install MySQL
10. Configure Mysql
11. Start the service
There may be an error here
Create the required directories and grant permissions:
12. Configure PATH
Add the following content to the end of the file and save it using: wq
13. Refresh PATH
11. Start the service
14. Log in to mysql. There is no password for mysql at this time. When Enter password: appears, press Enter directly
15. Change the root password
16. Set up remote login
Notice:
3. Installation of Beauty Photo Station Import the above database file (beauty.sql) into your database Then unzip the Beauty.zip package Go to Beauty–>WEB-INF–>classes, modify the jdbc.properties file, and modify the last 3 lines, which are the address of your database: port/account/password Then transfer the Beauty folder to the server Here I created it in the server root directory folder, and then put the Beauty folder in it The final path is /www/webapps/Beauty This will be used when configuring the following Then enter in ssh Change the line 71 or so below Change 8080 in the command to the port you want to configure. The easiest way is to change it to 80. You don't need to add a port to access it. Then press the arrow key to the end and add a line above the </Host> node. Here is mine: The value in docBase is the absolute path of the Beauty folder above Then press Esc + :wq + Enter to save and exit to complete the configuration. Then restart the Tomcat server. OK, enter your IP or resolved domain name + the port configured above in the browser. If you are accessing through port 80, you don’t need to add the port.
|
<<: Use Haproxy Keepalived for dual-active load balancing installation and configuration
>>: VPSDime: $20/month/4GB memory/60GB SSD space/2TB traffic/10Gbps/KVM/Dallas
I have previously introduced HostWithLinux's ...
Server Mania is a Canadian hosting provider that ...
Liuliuyun, a Chinese merchant, was established in...
Although the Virtualmin/Webmin panel is relativel...
Use code TFN/18OFF/BF2020 to place your order and...
Sharktech, a long-established American hosting pr...
Digital-VM, a business founded in early 2019, mai...
Uovz, a Chinese hosting company, has many data ce...
GetServerHosting, an American hosting provider, w...
DedimaxCom, a foreign hosting provider, was estab...
GalaxyHostPlus, an Irish hosting provider, was es...
CloudCone is a relatively active hosting provider...
Scaleway, an online brand that provides cloud hos...
The temptation of 123systems is here again, this ...
RackNerd, a business founded in late 2019, provid...