Deploying common services on Linux systems often requires cumbersome steps, especially for beginners. This article organizes four practical one-click installation scripts covering the Rust development environment, Tomcat server, Docker container engine, and Nginx web server, helping you quickly set up the required environment.
Script List
- Rust Installation Script (
<span>rust_install.sh</span>) – Installs the Rust development environment - Tomcat Installation Script (
<span>tomcat_install.sh</span>) – Installs Tomcat 9 server - Docker Installation Script (
<span>docker_install.sh</span>) – Installs Docker engine and related tools - Nginx Installation Script (
<span>nginx_install.sh</span>) – Installs Nginx web server
General Usage Method
- First, download the script file to your local machine
- Grant execution permissions to the script:
<span>chmod +x script_filename.sh</span> - Run the script:
<span>./script_filename.sh</span>(some scripts may require root permissions, and you might need to use<span>sudo</span>)
Detailed Description of Each Script
1. Rust Installation Script (rust_install.sh)
Function Description
This script is used to install the Rust programming language development environment, including the rustc compiler and cargo package manager. The script will automatically detect the system type and install the necessary dependencies, and finally verify the installation results.
Supported Systems
- Ubuntu/Debian series
- CentOS/RHEL series
- Fedora
- Arch/Manjaro
- openSUSE series
- Other common Linux distributions
Usage Method
# Download the script (assuming from the internet)
curl -O https://linux.nodcat.com/rust_install.sh
# Grant execution permissions
chmod +x rust_install.sh
# Run the script (note: it is not recommended to use the root user)
./rust_install.sh
Notes
- The script will check if it is running as the root user and give a warning
- After installation, you need to log out and log back in, or execute
<span>source $HOME/.cargo/env</span>to make the environment variables effective - After successful installation, the version information of rustc and cargo will be displayed
2. Tomcat Installation Script (tomcat_install.sh)
Function Description
This script is used to install Tomcat 9 server, which will automatically install Java 8 environment (if not installed), configure Tomcat service, and set it to start on boot.
Supported Systems
- Debian/Ubuntu series
- CentOS/RHEL series
- Fedora
- Arch/Manjaro
- openSUSE series
Usage Method
# Download the script
curl -O https://linux.nodcat.com/tomcat_install.sh
# Grant execution permissions
chmod +x tomcat_install.sh
# Must be run with root permissions
sudo ./tomcat_install.sh
Installation Information
- Installation Directory:
<span>/opt/tomcat</span> - Service User:
<span>tomcat</span> - Log File:
<span>/var/log/tomcat_install.log</span> - Access Address:
<span>http://localhost:8080</span>
Service Management Commands
- Start:
<span>systemctl start tomcat</span>or<span>/etc/init.d/tomcat start</span> - Stop:
<span>systemctl stop tomcat</span>or<span>/etc/init.d/tomcat stop</span> - Restart:
<span>systemctl restart tomcat</span>or<span>/etc/init.d/tomcat restart</span> - Status:
<span>systemctl status tomcat</span>
3. Docker Installation Script (docker_install.sh)
Function Description
This script is used to install Docker Engine, Docker CLI, Docker Compose, and other related tools
Supported Systems
- Ubuntu/Debian series
- CentOS/RHEL series
- Fedora
- Other common Linux distributions
Usage Method
# Download the script
curl -O https://linux.nodcat.com/docker_install.sh
# Grant execution permissions
chmod +x docker_install.sh
# Basic installation (requires root permissions)
sudo ./docker_install.sh
# Install a specific version
sudo ./docker_install.sh --version 23.0
# Install from the test channel
sudo ./docker_install.sh --channel test
# Install using an image (e.g., Aliyun)
sudo ./docker_install.sh --mirror Aliyun
Notes
- After installation, you can configure non-root users to use Docker
- Supports rootless mode for running Docker (version 20.10 and above)
- The script will automatically handle package management differences across distributions
4. Nginx Installation Script (nginx_install.sh)
Function Description
This script is used to quickly install the Nginx web server, automatically start the service, and set it to start on boot.
Supported Systems
- Ubuntu/Debian series
- CentOS/RHEL series
- Fedora
- Arch/Manjaro
- openSUSE series
Usage Method
# Download the script
curl -O https://linux.nodcat.com/nginx_install.sh
# Grant execution permissions
chmod +x nginx_install.sh
# Must be run with root permissions
sudo ./nginx_install.sh
Service Management
- Start:
<span>systemctl start nginx</span>or<span>service nginx start</span> - Stop:
<span>systemctl stop nginx</span>or<span>service nginx stop</span> - Restart:
<span>systemctl restart nginx</span>or<span>service nginx restart</span> - Status Check:
<span>systemctl status nginx</span>
Conclusion
These one-click installation scripts greatly simplify the process of deploying common services on Linux systems, especially suitable for beginners or scenarios where a quick development/testing environment is needed. Each script is adapted for different Linux distributions and can automatically handle dependencies and configuration processes.
When using, please choose the appropriate script based on your system type and needs, and pay attention to the prompt information during the script execution process. For production environments, it is recommended to first verify the script’s compatibility in a testing environment.