Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Centos 7 - Installation guide #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions install/war_tomcat.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,156 @@ Airsonic should be running at [http://localhost:8080/airsonic](http://localhost:

**Work in progress**

##### On Centos 7



Install java 1.8 - openjdk

```yum install java-1.8.0-openjdk.x86_64```



Tomcat 8 setup:

- **Create Tomcat user and group:**

```
sudo groupadd tomcat
sudo useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat
```



- **Install Tomcat 8:**

```
cd /tmp
wget http://mirror.nohup.it/apache/tomcat/tomcat-8/v8.5.43/bin/apache-tomcat-8.5.43.tar.gz
```

> Info:
>
> + ***Tomcat website*** -> https://tomcat.apache.org/download-80.cgi
> + ***Download*** "Core" tar.gz



```
sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
cd /opt/
sudo chown -R tomcat. tomcat
sudo chmod -R g+r conf
sudo chmod g+x conf
```



- **Systemd Unit:**



```sudo vi /etc/systemd/system/tomcat.service```



Paste this:
```
# Systemd unit file for tomcat

[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
```





```
:wq
sudo systemctl daemon-reload
```


Install Airsonic:

```
sudo mkdir /var/airsonic/
sudo chown -R tomcat. /var/airsonic/
```

```
sudo mv airsonic.war /var/lib/tomcat8/webapps/airsonic.war
sudo chown tomcat. /opt/tomcat/webapps/airsonic.war
```



Start tomcat service:

```
sudo systemctl start tomcat.service
```



Info:

+ **Logs** are stored in ```/opt/tomcat/logs/catalina.out```

+ Change default port:



```
vi /opt/tomcat/conf/server.xml
```

Change the **Connector port="8080"** port to any other port number:

```
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--

```

For example

```
-->
<Connector port="9999" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--

```



##### On Windows

**Work in progress**
Expand Down