I'm creating a webpage in Ubuntu, in which simple files such as .txt can be uploaded. Now, I want to transform my laptop into an Ubuntu web server, through which any other Ubuntu or Windows user can access that specific web page through Ethernet connection.
How can I make my laptop having Ubuntu into such a web server?
How can I access that web page from another Ubuntu or Windows user via Ethernet? What are the necessary configurations or settings required for that?
Best Answer
Installing the
apache2
package in Ubuntu is all you need to host files, and most likely the easiest solution since it is available in the repositories and comes with basic configuration.After installing the package, a directory will be created at
/var/www
. Now each time someone tries accessing your browser from a browser will be welcomed by the index page of that directory.By default, it contains an "It Works!" message, and it's located at
If you remove that file, the browser will instead show a listing of files in that folder.
Thus each file you need to let other computers see in your browser should be located inside that directory.
It can be reached by
http://_YOUR_LOCAL_IP_ADDRESS_/
Note: By default, and for security reasons, the
/var/www
directory is not writable for any user. Check this question and answers for more details on that: How to avoid using sudo when working in /var/www?After installing Apache, you stop or start the service by typing one of the following respectively:
Of course, this isn't all you can do with Apache, but as solution for your problem there isn't more that needs be done.