Jump to content

Debian 9 Apache web server to fetch files not working


Recommended Posts

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 by jaimetal20
Link to comment
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

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
  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...