By charlieli
Hello, this may be a really beginner question, but I really want to make sure I’m going in the right direction before investing time in this. Heres what I have.
$ORIGIN charlieli.me.
$TTL 1800
charlieli.me. IN SOA ns1.digitalocean.com. hostmaster.charlieli.me. 1441944900 10800 3600 604800 1800
charlieli.me. 1800 IN NS ns1.digitalocean.com.
charlieli.me. 1800 IN NS ns2.digitalocean.com.
charlieli.me. 1800 IN NS ns3.digitalocean.com.
charlieli.me. 1800 IN A 45.55.33.185
fileserver.charlieli.me. 1800 IN A 45.55.33.185
fileserver.conf
<VirtualHost *:80>
ServerName fileserver.charlieli.me
ServerAdmin charlie.li@carleton.ca
ServerAlias fileserver.charlieli.me
DocumentRoot /var/www/fileserver
<Directory /var/www/fileserver>
# enable the .htaccess rewrites
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error_orlybg.log
CustomLog ${APACHE_LOG_DIR}/access_orlybg.log combined
</VirtualHost>
My primary domain’s virtual host is 45.55.33.185 port 80, my subdomain fileserver.charlieli.me is also configured to 45.55.33.185 port 80.
On my subdomain, I would like to open a web-socket to send files to store and retrieve remotely. In my configuration for the landing site, it’s configured to port 80, does this mean I have to listen/receive/respond through port 80 or could I specify another port on the subdomain like 9090 top open with my websocket program and receive data from fileserver.charlieli.me:9090?
Does the “Virtual Host” address in my conf really mean both my primary and subdomain is really sharing the same set of ports and I can access my 9090 port even from charlieli.me:9090 rendering a subdomain redundant?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
When using virtualhosts your domains/subdomains are indeed sharing the same set of ports since they share the same IP address. What setting up virtual hosts does is to have your web server provide different content based on the domain or subdomain name being requested. If you open another service on port 9090 it would be available on both domains.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.