How to Install AirSonic Media Server on CentOS 8

How to Install AirSonic Media Server on CentOS 8

All

Linux Articles / All 55 Views comments

AirSonic is a free, open-source and web-based media streaming server that lets you entry your music from the central location. Airsonic is suitable with any audio/video file format and in addition capable of stream over HyperText Switch protocol. It's a self-hosted media streamer written within the Java language and capable of deal with very giant music collections. It runs on most working techniques together with Home windows, Linux and Mac OS.

On this tutorial, we'll present you find out how to set up AirSonic media streaming server on CentOS eight.

Conditions

  • A server operating CentOS eight with minimal 2 GB of RAM.
  • A root password is configured in your server.

Getting Began

By default, SELinux is enabled in CentOS eight server. So you'll need to disable it first.

You are able to do this by modifying /and so on/selinux/config file:

nano /and so on/selinux/config

Make the next modifications:

SELINUX=disabled

Save and shut the file. Then, restart your system to use the modifications.

Set up Java

AirSonic is predicated on Java so you'll need to put in Java to your system. You possibly can set up Java by simply operating the next command:

dnf set up java-1.eight.Zero-openjdk-devel

As soon as the Java has been put in, you possibly can confirm the model of Java with the next command:

java -version

You need to see the next output:

openjdk model "1.eight.0_232"
OpenJDK Runtime Surroundings (construct 1.eight.0_232-b09)
OpenJDK 64-Bit Server VM (construct 25.232-b09, combined mode)

Set up AirSonic

Earlier than beginning, you will want to create a consumer to run AirSonic.

First, create a consumer with the next command:

useradd airsonic

Subsequent, create a listing for AirSonic with the next command:

mkdir /var/airsonic /var/media_files

Subsequent, obtain the newest model of AirSonic from the Git repository with the next command:

wget https://github.com/airsonic/airsonic/releases/obtain/v10.four.1/airsonic.warfare --output-document=/var/airsonic/airsonic.struggle

Subsequent, give correct permission to the airsonic listing with the next command:

chown -R airsonic /var/airsonic
chown -R airsonic /var/media_files

Subsequent, obtain the pre-configured systemd unit file for AirSonic with the next command:

wget https://uncooked.githubusercontent.com/airsonic/airsonic/grasp/contrib/airsonic.service -O /and so on/systemd/system/airsonic.service
wget https://uncooked.githubusercontent.com/airsonic/airsonic/grasp/contrib/airsonic-systemd-env -O /and so forth/sysconfig/airsonic

Subsequent, reload the systemd daemon with the next command:

systemctl daemon-reload

Subsequent, begin the AirSonic service and allow it to start out on boot with the next instructions:

systemctl begin airsonic
systemctl allow airsonic

Now you can confirm the standing of AirSonic with the next command:

systemctl standing airsonic

You need to get the next output:

? airsonic.service - Airsonic Media Server
   Loaded: loaded (/and so on/systemd/system/airsonic.service; disabled; vendor preset: disabled)
   Lively: lively (operating) since Mon 2019-10-28 12:29:51 EDT; 2min 6s in the past
 Fundamental PID: 29564 (java)
    Duties: 18 (restrict: 5060)
   Reminiscence: 315.0M
   CGroup: /system.slice/airsonic.service
           ??29564 /usr/bin/java -Xmx700m -Dairsonic.house=/var/airsonic -Dserver.context-path=/airsonic -Dserver.port=8080 -jar /var/airsonic/>

Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.876  INFO --- l.c.StandardChangeLogHistoryService      : Studying from DATABASECHANGEL>
Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.877  INFO --- l.executor.jvm.JdbcExecutor              : SELECT * FROM DATABASECHANGE>
Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.969  INFO --- liquibase.changelog.ChangeSet            : Marking ChangeSet: classpath>
Oct 28 12:31:49 centos8 java[29564]:           classpath:liquibase/db-changelog.xml : Customized Precondition Failed: DBMS Main Model Precondit>
Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.972  INFO --- l.executor.jvm.JdbcExecutor              : SELECT MAX(ORDEREXECUTED) FR>
Oct 28 12:31:50 centos8 java[29564]: 2019-10-28 12:31:50.017  INFO --- l.executor.jvm.JdbcExecutor              : INSERT INTO DATABASECHANGELO>
Oct 28 12:31:50 centos8 java[29564]: 2019-10-28 12:31:50.020  INFO --- l.l.StandardLockService                  : Efficiently launched change>
Oct 28 12:31:51 centos8 java[29564]: 2019-10-28 12:31:51.489  INFO --- o.airsonic.participant.dao.PlayerDao          : Deleted 1 participant(s) that hav>
Oct 28 12:31:52 centos8 java[29564]: 2019-10-28 12:31:52.424  INFO --- o.a.p.s.MediaScannerService              : Automated media library scan>
Oct 28 12:31:53 centos8 java[29564]: 2019-10-28 12:31:53.093  INFO --- o.a.p.service.PodcastService             : Automa

You may also verify the AirSonic operating course of with the next command:

ps -ef | grep airsonic

It is best to see the next output:

airsonic 29459     1 87 12:07 ?        00:02:08 /usr/bin/java -Xmx700m -Dairsonic.house=/var/airsonic -Dserver.context-path=/airsonic -Dserver.port=8080 -jar /var/airsonic/airsonic.conflict
root     29496  6103  Zero 12:10 pts/Zero    00:00:00 grep --color=auto airsonic

Entry AirSonic Net Interface

Earlier than accessing the AirSonic net interface, you'll need to open ports 80 and 8080 with firewalld. You are able to do it with the next instructions:

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload

Subsequent, open your net browser and sort the URL http://your-server-ip:8080/airsonic. You may be redirected to the next web page:

airsonic media server login

Present the default username and password as admin/admin and click on on the Log in button. You must see the next web page:

Getting started

Subsequent, you will have to vary the default administrator password. To take action, click on on the Change administrator password. It is best to see the next web page:

Settings

Select admin consumer, mark the change password examine field, sort the brand new password and click on on the Save button to vary the default password. 

Subsequent, you will have to arrange the media folder to retailer your music and movies. To take action, click on on the settings > Media folders. You must see the next web page:

Media Folders

Now, sort /var/media_files within the Folder field and click on on the Save button.

Configure Nginx as a Reverse Proxy

Subsequent, you will have to configure Nginx as a reverse proxy for the Airsonic on port 8080. To take action, first set up the Nginx net server with the next command:

dnf set up nginx

As soon as put in, create an Nginx digital host configuration file:

nano /and so on/nginx/conf.d/airsonic.conf

Add the next strains:

server 
   pay attention 80;
   server_name your-server-ip;
   access_log off;
   error_log off;
   location / 
      proxy_pass http://127.Zero.Zero.1:8080;
      proxy_redirect off;
      proxy_set_header Host $host;
      proxy_set_header X-Actual-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_max_temp_file_size Zero;
      client_max_body_size 10m;
      client_body_buffer_size 128okay;
      proxy_connect_timeout 90;
      proxy_send_timeout 90;
      proxy_read_timeout 90;
      proxy_buffer_size 4k;
      proxy_buffers four 32okay;
      proxy_busy_buffers_size 64okay;
      proxy_temp_file_write_size 64okay;


Save and shut the file if you find yourself completed. Then, check Nginx for any syntax error with the next command:

nginx -t

You need to see the next output:

nginx: the configuration file /and so on/nginx/nginx.conf syntax is okay
nginx: configuration file /and so forth/nginx/nginx.conf check is profitable

Subsequent, begin the Nginx service and allow it to start out after system reboot with the next command:

systemctl begin nginx
systemctl allow nginx

Now, you'll be able to entry the AirSonic by visiting the URL http://your-server-ip/airsonic.

Conclusion

Congratulations! you will have efficiently put in an AirSonic media server with Nginx as a reverse proxy on CentOS eight. Now you can host your personal media server and share music together with your family and friends. Be happy to ask me in case you have any questions.

Comments