I installed apache2 on ubuntu and I want to check that it works by accessing http://localhost/. The problem is I installed ubuntu(17.04) server, so there is no web browser, only the command line.
What can I do?
To access the server from itself, use http://localhost/ or http://127.0.0.1/ . To access the server from a separate computer on the same network, use http://192.168.X.X where X.X is your server's local IP address. You can find the sever's local IP address (assuming it's Linux) by running hostname -I . 127.0.
First, click on your Start Menu and type cmd in the search box and press enter. A black and white window will open where you will type ipconfig /all and press enter. There is a space between the command ipconfig and the switch of /all. Your ip address will be the IPv4 address.
For Windows users, you'll need to make sure you have Python installed first. For macOS and Linux, you can use a simple cURL command to install it straight from your command line. It'll run through and sign you up to the service if you're not already signed up. Then you'll have localhost up and running for the world!
Note: To open a command prompt, you can press Windows + R keys (⊞ Win + R), then type “cmd” and click on Enter. If your application is running on local port 3000, then use this command: With the help of these three services, you can access localhost from the internet.
Not just a term, localhost can also be a domain name, like netflix.com or google.com. Just like any domain, the localhost will also have its own Internet Protocol (IP) address. The address needed will depend on the internet protocol being used.
To perform a ping request to localhost: 1 Open the Run function (Windows key + R) dialog and type cmd. Press Enter.#N#You can also type cmd into the Taskbar Search... 2 You can also type cmd into the Taskbar Search box and select Command Prompt from the list. 3 Running as Administrator is advised. 4 Type ping 127.0.0.1 and press Enter. More ...
If you acces "http://localhost" in the browser, the request will not be forwarded to the internet through the router, but will instead remain in your own system. Localhost has the IP address 127.0.0.1, which refers back to your own server. Exemplary representation of the communication between a web browser and web server within a local computer
curl localhost (curl localhost:8080 if it's not port 80)
or
curl 127.0.0.1
or just test with
ping localhost
or download your index.html or something
wget localhost
I recommend installing a browser for a command line like lynx ,Browsh.
Lynx is light-weight. Fast. An img element is always shown in their alt text. Browsh is a bit slower than Lynx. An img element is always shown ing(but as low quality as your command line can display).
I use different above depending on the purpose. If you just want to see the localhost is working well, use lynx. If you want to check your server working well and see details, use Browsh.
I hope my answer will help you. Any questions, google or ask me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With