Use the apt-get or yum command to install Icecast2 in Linux using the Terminal.
apt-get install icecast2 yum install icecast2
Just to see what happens in a Web browser when Icecast is not running, type http://localhost:8080 into the Web browser. You should get something like "page cannot be displayed." In /var/log/icecast2/ there are two files, access.log and error.log. By default, the owner and group owner of these filles will be root:root. We should change the owner for both files to be icecast2. If we do not do this, when attempting to start icecast, we will get permission denied errors (FATAL: could not open error logging (/var/log/icecast2/error.log): Permission denied FATAL: could not open access logging (/var/log/icecast2/access.log): Permission denied FATAL: Could not start logging)
chown -R icecast2:icecast2 /var/log/icecast2
Next we need to change the logdir, webroot and adminroot directives in the /etc/icecast2/icecast.xml file.
- In Terminal, type nano /etc/icecast2/icecast.xml and press Enter.
- Press Ctrl W, type logdir and press Enter to go to the area of the icecast.xml file that has the logdir directive.
- Ensure the directive reads <logdir>/var/log/icecast2/</logdir>
- Ensure the webroot directive reads <webroot>/etc/icecast2/web/</webroot>
- Ensure the adminroot directive reads <adminroot>/etc/icecast2/admin/</adminroot>
- Press Ctrl O (to save)
- Press Ctrl X (to exit the nano editor)
If Icecast is running on the same image as your Apache Web Server, Apache might be using port 8080. In this case, we would just need to give Icecast a different port, such as 8181.