Uploading an API to a port on a DigitalOcean droplet port
This is a Virtual Host directive that works:
<VirtualHost *:8037> #ServerName www.example.com DocumentRoot "/var/www/html/hotelguide/public"...</VirtualHost>
I took out the ServerName
directive (it is commented out with the #), as it wasn't necessary, and seemed to actually break it. If it is the only app you want running on that port, then you don't have to drill down further using ServerName
matches. I have used ServerName
with xxx.xxx.xxx.xxx/path/to/website in the past, but that only seems to work with port 80.
Lastly, make sure you have opened port 8037 on your firewall.
And one last side note, you have the Listen 8037 as if you have that in your sites-available conf, but you don't need it in there (just in the ports.conf as you mentioned later).
Then to get to your app, you type xxx.xxx.xxx.xxx:8037 and it should go to your DocumentRoot
.
Update
With your setup (I changed to port 8037), and apache is clearly working, (when I bring up xxx.xxx.xxx.xxx:8037, the website I set up comes up in my browser),
You can do netstat -ant
on your Digital Ocean server and you should see:
tcp6 0 0 :::8037 :::* LISTEN tcp6 0 0 :::80 :::* LISTEN
Also, I caused the forbidden error when I changed the permissions on the /var/www files. The best permissions are 750 for directories and 640 for files, here are the lines you can execute in a .sh file to accomplish that permission setup:
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 {} \;