jaimetal20 Posted August 21, 2018 Share Posted August 21, 2018 (edited) Hello, I'm trying to access maps's files (songs specifically) in order to later use them with playSound function (i.e playSound("http://ip:22080/mapname/song.mp3") ). I do not want to fetch all the maps files, I just want a way to stream map's songs instead of download them on clients, reducing map download size. I spent a lot of hours looking for a lot of ways to open 22080 port with DomainRoot folder to "/root/mtasa/mtasa-server/mods/deathmatch/resources/[maps]" but whatever I do the url "ip:22080" is always inaccessible getting "ERR_CONNECTION_REFUSED" when opening it on browser. This is my setup: <VirtualHost *:22080> DocumentRoot /root/mtasa/mtasa-server/mods/deathmatch/resources/[maps] ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> I'm not sure if i'm doing it correctly, I hope you guys can help, I've already setup everything and this is just the last thing I need. As I said, I'm not looking for making a web server for download resources, I just want to fetch music files from maps. Edited August 21, 2018 by jaimetal20 Link to comment
qaisjp Posted August 21, 2018 Share Posted August 21, 2018 Is this your own server? It is possible that the port 22080 is being firewalled. You also need to tell the Apache server to listen on (bind to) port 22080: https://httpd.apache.org/docs/2.4/bind.html 1 Link to comment
jaimetal20 Posted August 22, 2018 Author Share Posted August 22, 2018 9 hours ago, qaisjp said: Is this your own server? It is possible that the port 22080 is being firewalled. You also need to tell the Apache server to listen on (bind to) port 22080: https://httpd.apache.org/docs/2.4/bind.html Yeah I have a VPS. Thanks for that link, I've managed to make it listen to 22080 port. The problem I have now is that when I try to access through that port I get this error when I try to access "x.x.x.x:22080/index.html" (i use that html for testing) Forbidden You don't have permission to access /index.html on this server. Apache/2.4.25 (Debian) Server at x.x.x.x Port 22080 I've set as DocumentRoot the folder on "/root/mtasa/mtasa-server/mods/deathmatch/resources/[maps]" And this is what I set in apache2.conf: <Directory /root/mtasa/mtasa-server/mods/deathmatch/resources/[maps]/> AllowOverride None Require all granted </Directory> I've also tried to use playSound to listen a mp3 inside that folder but didnt work either. Link to comment
jaimetal20 Posted August 22, 2018 Author Share Posted August 22, 2018 Well I after making some edits to apache2.conf I make it able to read the port but I got now: Forbidden You don't have permission to access /index.html on this server. Server unable to read htaccess file, denying access to be safe While "AllowOverride None" is already set and file access is already 755. Link to comment
qaisjp Posted August 22, 2018 Share Posted August 22, 2018 Try to read the error log. A search for that error led me to this StackOverflow answer: Quote I had this problem too. My advice is look in your server error log file. For me, it was that the top directory for the project was not readable. The error log clearly stated this. A simple sudo chmod -R 755 <site_top_folder> fixed it for me. 1 Link to comment
jaimetal20 Posted August 22, 2018 Author Share Posted August 22, 2018 9 hours ago, qaisjp said: Try to read the error log. A search for that error led me to this StackOverflow answer: Yeah the root folder needed 755 permission! That's why it was being blocked. Thank you so much, it's working now! Link to comment
Luxy.c Posted October 23, 2018 Share Posted October 23, 2018 Please bare in mind that anybody knowing map resource name would be able to download ALL script files. I would use resource-cache/http-client-files. - Luxy.c Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now