{"id":1302,"date":"2023-08-30T16:22:19","date_gmt":"2023-08-30T08:22:19","guid":{"rendered":"https:\/\/www.cithwu.com:5444\/?p=1302"},"modified":"2023-08-30T16:23:15","modified_gmt":"2023-08-30T08:23:15","slug":"how-to-install-airsonic-media-server-on-centos-8","status":"publish","type":"post","link":"https:\/\/blog.cithwu.com\/wp5444\/how-to-install-airsonic-media-server-on-centos-8\/","title":{"rendered":"How to Install AirSonic Media Server on CentOS 8"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\"><\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">On this page<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">AirSonic is a free, open-source and web-based media streaming server that allows you to access your music from the central location. Airsonic is compatible with any audio\/video file format and also able to stream over HyperText Transfer protocol. It is a self-hosted media streamer written in the Java language and able to handle very large music collections. It runs on most operating systems including Windows, Linux and Mac OS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we will show you how to install AirSonic media streaming server on CentOS 8.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A server running CentOS 8 with minimum 2 GB of RAM.<\/li>\n\n\n\n<li>A root password is configured on your server.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"getting-started\">Getting Started<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default, SELinux is enabled in CentOS 8 server. So you will need to disable it first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can do this by editing \/etc\/selinux\/config file: nano \/etc\/selinux\/config<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make the following changes: SELINUX=disabled<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close the file. Then, restart your system to apply the changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-java\">Install Java<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">AirSonic is based on Java so you will need to install Java to your system. You can install Java by just running the following command: dnf install java-1.8.0-openjdk-devel<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the Java has been installed, you can verify the version of Java with the following command: java -version<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the following output: openjdk version &#8220;1.8.0_232&#8221; OpenJDK Runtime Environment (build 1.8.0_232-b09) OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-airsonic\">Install AirSonic<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, you will need to create a user to run AirSonic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, create a user with the following command: useradd airsonic<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, create a directory for AirSonic with the following command: mkdir \/var\/airsonic \/var\/media_files<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, download the latest version of AirSonic from the Git repository with the following command: wget https:\/\/github.com\/airsonic\/airsonic\/releases\/download\/v10.4.1\/airsonic.war &#8211;output-document=\/var\/airsonic\/airsonic.war<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, give proper permission to the airsonic directory with the following command: chown -R airsonic \/var\/airsonic<br>chown -R airsonic \/var\/media_files<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, download the pre-configured systemd unit file for AirSonic with the following command: wget https:\/\/raw.githubusercontent.com\/airsonic\/airsonic\/master\/contrib\/airsonic.service -O \/etc\/systemd\/system\/airsonic.service<br>wget https:\/\/raw.githubusercontent.com\/airsonic\/airsonic\/master\/contrib\/airsonic-systemd-env -O \/etc\/sysconfig\/airsonic<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, reload the systemd daemon with the following command: systemctl daemon-reload<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, start the AirSonic service and enable it to start on boot with the following commands: systemctl start airsonic<br>systemctl enable airsonic<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can now verify the status of AirSonic with the following command: systemctl status airsonic<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should get the following output: ? airsonic.service &#8211; Airsonic Media Server Loaded: loaded (\/etc\/systemd\/system\/airsonic.service; disabled; vendor preset: disabled) Active: active (running) since Mon 2019-10-28 12:29:51 EDT; 2min 6s ago Main PID: 29564 (java) Tasks: 18 (limit: 5060) Memory: 315.0M CGroup: \/system.slice\/airsonic.service ??29564 \/usr\/bin\/java -Xmx700m -Dairsonic.home=\/var\/airsonic -Dserver.context-path=\/airsonic -Dserver.port=8080 -jar \/var\/airsonic\/&gt; Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.876 INFO &#8212; l.c.StandardChangeLogHistoryService : Reading from DATABASECHANGEL&gt; Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.877 INFO &#8212; l.executor.jvm.JdbcExecutor : SELECT * FROM DATABASECHANGE&gt; Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.969 INFO &#8212; liquibase.changelog.ChangeSet : Marking ChangeSet: classpath&gt; Oct 28 12:31:49 centos8 java[29564]: classpath:liquibase\/db-changelog.xml : Custom Precondition Failed: DBMS Major Version Precondit&gt; Oct 28 12:31:49 centos8 java[29564]: 2019-10-28 12:31:49.972 INFO &#8212; l.executor.jvm.JdbcExecutor : SELECT MAX(ORDEREXECUTED) FR&gt; Oct 28 12:31:50 centos8 java[29564]: 2019-10-28 12:31:50.017 INFO &#8212; l.executor.jvm.JdbcExecutor : INSERT INTO DATABASECHANGELO&gt; Oct 28 12:31:50 centos8 java[29564]: 2019-10-28 12:31:50.020 INFO &#8212; l.l.StandardLockService : Successfully released change&gt; Oct 28 12:31:51 centos8 java[29564]: 2019-10-28 12:31:51.489 INFO &#8212; o.airsonic.player.dao.PlayerDao : Deleted 1 player(s) that hav&gt; Oct 28 12:31:52 centos8 java[29564]: 2019-10-28 12:31:52.424 INFO &#8212; o.a.p.s.MediaScannerService : Automatic media library scan&gt; Oct 28 12:31:53 centos8 java[29564]: 2019-10-28 12:31:53.093 INFO &#8212; o.a.p.service.PodcastService : Automa<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also check the AirSonic running process with the following command: ps -ef | grep airsonic<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the following output: airsonic 29459 1 87 12:07 ? 00:02:08 \/usr\/bin\/java -Xmx700m -Dairsonic.home=\/var\/airsonic -Dserver.context-path=\/airsonic -Dserver.port=8080 -jar \/var\/airsonic\/airsonic.war root 29496 6103 0 12:10 pts\/0 00:00:00 grep &#8211;color=auto airsonic<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"access-airsonic-web-interface\">Access AirSonic Web Interface<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before accessing the AirSonic web interface, you will need to open ports 80 and 8080 with firewalld. You can do it with the following commands: firewall-cmd &#8211;zone=public &#8211;add-port=80\/tcp &#8211;permanent<br>firewall-cmd &#8211;zone=public &#8211;add-port=8080\/tcp &#8211;permanent<br>firewall-cmd &#8211;reload<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next, open your web browser and type the URL <strong>http:\/\/your-server-ip:8080\/airsonic<\/strong>. You will be redirected to the following page:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On this page Air&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,9],"tags":[],"class_list":["post-1302","post","type-post","status-publish","format-standard","hentry","category-linux","category-9"],"_links":{"self":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/1302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/comments?post=1302"}],"version-history":[{"count":2,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/1302\/revisions"}],"predecessor-version":[{"id":1304,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/1302\/revisions\/1304"}],"wp:attachment":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/media?parent=1302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/categories?post=1302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/tags?post=1302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}