Ubuntu停快速安装jdk、tomcat、mysql和Redis
Ubuntu下快速安装jdk、tomcat、mysql和Redis 安装之前,先执行系统更新 apt-get update 一、安装Java 1、在线安装JDK a、apt-get install openjdk-6-jdk b、apt-get install openjdk-6-jre 备注:通常只需要安装jdk即可,因为jdk下面包括jre,jdk是开发工具包
Ubuntu下快速安装jdk、tomcat、mysql和Redis安装之前,先执行系统更新
apt-get update
一、安装Java
1、在线安装JDK
a、apt-get install openjdk-6-jdk
b、apt-get install openjdk-6-jre
备注:通常只需要安装jdk即可,因为jdk下面包括jre,jdk是开发工具包,jre是java运行环境
2、手动安装JDK
./jdk-6u38-linux-x64.bin
完成安装之后,将解压的jdk1.6.0_38移至/usr/lib/jvm/jdk1.6.0_38
配置环境变量:
>> vi /root/.bashrc
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_38
CLASSPATH=.:$JAVA_HOME/lib
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export CLASSPATH
export PATH
然后
>> source /root/.bashrc
备注:解决Java new Date()与系统时间不一致的问题
在Server上边写一段Java程序,通过Java new Date()来获取时间,用于测试是否与当前系统时间是否一致,如果不一致,就通过如果方案来解决时区不一致的问题
在命令行设置TimeZone 如下:
export TZ="Asia/Shanghai" //或者直接将此命令嵌入到配置Java的环境变量中
再运行Java new Date()程序来测试获取的时区是否与当前Server一致
二、安装tomcat
apt-get install tomcat6
备注:安装完之后,Ubuntu自动将tomcat6加入到系统Service下
?
三、安装mysql
1、apt-get install mysql-server-5.5
2、安装过程中,会跳出字符界面,提示设置root密码
3、安装完之后,可以通过service mysql status查看mysql是否正确启动
4、修改my.cnf配置文件,将bind-address = 127.0.0.1前面加“#”注释掉,这样就可以允许其他机器远程访问本机mysql了
5、修改完my.cnf配置之后,重启mysql服务(service mysql restart)
6、进入mysql数据库,mysql -u root -p然后输入安装时设置的密码进入mysql控制台
7、在mysql控制台可以添加和修改用户以及用户密码,这里我修改root密码,命令如下:
mysql> grant all privileges on *.* to root@localhost identified by "123456" //这里只允许本地可以通过root用户访问
mysql> grant all privileges on *.* to test@localhost identified by "123456" //这里新建一个test用户
mysql> grant all privileges on *.* to test@"%" identified by "123456" //这里允许通过test用户远程访问
mysql> flush privileges ;
8、在远程桌面上,test用户就可以通过mysql GUI连接工具进行远程操作
备注:解决MySQL出现大量unauthenticated user的问题,导致线程卡死,服务器不能连接mysql,在my.cnf中的【mysqld】下加入配置skip-name-resolve,然后重?
启即可
四、安装redis-server
1、apt-get install redis-server
2、安装完之后,可以通过service redis-server status查看mysql是否正确启动
3、进入到/etc/redis/redis.conf将bind-address = 127.0.0.1前面加“#”注释掉,这样就可以允许其他机器远程访问本机redis-server了

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

How to solve the MySQL "Access denied for user" error: 1. Check the user's permission to connect to the database; 2. Reset the password; 3. Allow remote connections; 4. Refresh permissions; 5. Check the database server configuration (bind-address, skip-grant-tables); 6. Check the firewall rules; 7. Restart the MySQL service. Tip: Make changes after backing up the database.

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

Steps to automatically back up MySQL data using Navicat: Install and connect to the MySQL server. Create a backup task, specifying the backup source, file location, and name. Configure backup options, including backup type, frequency, and retention time. Set up an automatic backup plan, enable automatic backup, set time and frequency. Preview the backup settings and perform the backup. Monitor backup progress and history.

Warning messages in the Tomcat server logs indicate potential problems that may affect application performance or stability. To effectively interpret these warning information, you need to pay attention to the following key points: Warning content: Carefully study the warning information to clarify the type, cause and possible solutions. Warning information usually provides a detailed description. Log level: Tomcat logs contain different levels of information, such as INFO, WARN, ERROR, etc. "WARN" level warnings are non-fatal issues, but they need attention. Timestamp: Record the time when the warning occurs so as to trace the time point when the problem occurs and analyze its relationship with a specific event or operation. Context information: view the log content before and after warning information, obtain

To improve the security of DebianTomcat logs, we need to pay attention to the following key policies: 1. Permission control and file management: Log file permissions: The default log file permissions (640) restricts access. It is recommended to modify the UMASK value in the catalina.sh script (for example, changing from 0027 to 0022), or directly set filePermissions in the log4j2 configuration file to ensure appropriate read and write permissions. Log file location: Tomcat logs are usually located in /opt/tomcat/logs (or similar path), and the permission settings of this directory need to be checked regularly. 2. Log rotation and format: Log rotation: Configure server.xml
