Loading API into port on DigitalOcean cassette

I'm not sure if I used the right jargon, but hopefully my question is clear. I'm trying to load an API, I made use of Laravel in port on my DigitalOcean drop.

Basically, when I connect to ***.***.***.***:port, I want it to connect to my API.

I created a file .conffor my api, which is below:

Listen ***.***.***.***:8037
<VirtualHost ***.***.***.***:8037>
ServerName www.name.lk
DocumentRoot "/var/www/html/hotelguide/public"
<Directory /var/www/html/hotelguide/public>
    AllowOverride All
    Order allow,deny
    Require all granted
    Allow from all
</Directory>
</VirtualHost>

This file is placed in /etc/apache2/sites-available

I used 8037 as a random port.

I read about this: https://httpd.apache.org/docs/2.4/bind.html , as it seems to contain what I want, but when I edit etc/apache2/ports.confand I add Listen 8037and restart the service.

But then I visit ***.***.***.***:8037and I get Forbidden 403 error.

UPDATE: , @katie. , , Forbidden 403. nmap netstat enter image description here

+4
1

, :

<VirtualHost *:8037>

        #ServerName www.example.com
        DocumentRoot "/var/www/html/hotelguide/public"
...
</VirtualHost>

ServerName ( #), , , . , , ServerName. ServerName xxx.xxx.xxx.xxx/path/to/website , , , 80.

, , 8037 .

, Listen 8037, conf, ( ports.conf, ).

, , xxx.xxx.xxx.xxx:8037, DocumentRoot.

( 8037), apache , ( xxx.xxx.xxx.xxx:8037, -, , ),

netstat -ant Digital Ocean, :

tcp6       0      0 :::8037                 :::*                    LISTEN     
tcp6       0      0 :::80                   :::*                    LISTEN  

, , /var/www. - 750 640 , , .sh, :

sudo find /var/www -exec chown root:www-data {} \;
sudo find /var/www -type d -exec chmod -v 750 {} \;
sudo find /var/www -type f -exec chmod -v 640 {} \;
+1

Source: https://habr.com/ru/post/1657182/


All Articles