I want to follow this solution, but...

I specifically want to let others access a site on a LAN that would be stored in the default "/var/www/html" system folder AKA

So I guess I just need to know which port should I use, a guess is port 8080, anyways I want this question to be here @ AskUbuntu for it's usefulness.


  • Typically port 80 is used for http webpages (443 for https). Which port you open will depend on which port is being used by your web server.
    – amc
    May 13 '16 at 14:06
  • I clearly stated what I want. @amc I only guess I would only need to open a port. It's a guess. IDKWTF
    – userDepth
    May 13 '16 at 15:30
  • Have you set up the web server and is it running?
    – amc
    May 13 '16 at 15:33
  • 1
    After you install apache server, the required port (80) is opened automatically as soon as the web-server starts. You don't need to open any port again.
    – ankit7540
    May 13 '16 at 15:43
  • 2
    If you have the default FW setup and you want to use the most common ports for a Webserver you need to configure apache for port 80 and 443 and open both on the firewall. Like @ankit7540 stated once configured your Ubuntu will listen on those 2 ports once Apache is started.
    – pfeiffep
    May 13 '16 at 15:50

You don't want to "open a port", you want to setup a web server.

By default web server listens at port 80 for HTTP, or the web server opens that port for you. Your site is stored at a folder, you can call it "www", but that is not "AKA", and if you serve it to other computers, you cannot let your web server listen at only. Furthermore, if the access is restricted to LAN only, security may not be a issue, but keep such security concern in your mind when you setup a server for other to access your files. Please make sure you understand such stuff before continuing.

You can start by installing apache2 package, and your web server is up and running (The files are stored at /var/www/html).

I suggest you Google something like "ubuntu apache php" to find tons of guides on this topic, i.e., to install, configure a web server capable of running PHP sites (possibly including a MySQL server), if you encounter some specific problems during this procedure, ask those questions instead.

TIP: it may be more helpful to add your specific Ubuntu version when Googling, like: "ubuntu 14.04 LTS apache php"

  • Well if you can read check out the images in the updates. NO need to be a Techie Grammar Nazi. You're playing nice by putting on cards of security which would only shed light in very complex situations. I didn't ask any of the sort. You know I asked for LAN without any concern about security. When I need security I will go to an appropriate place to get informed about any specific situations.
    – userDepth
    Jun 5 '16 at 17:02

Just after the user installs apache webserver, the web-server is started as a service. With the start of this service the port 80 (for HTTP traffic) is opened automatically.

Suggested reading and details about apache / php / MySQL on Ubuntu : ApacheMySQLPHP

Important: Apache, php, phpmyadmin and MySQL should be properly configured for a secure working of your website. Please refer to detailed guides elsewhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.