PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, December 30, 2021

[FIXED] Where to edit (which part of the document ) a LAMP servers host file? [and correct synax]

 December 30, 2021     apache, lamp, localhost, web-hosting     No comments   

Issue

While trying to edit a host file on a ubuntu server, the docs recommend updating the system's host file saying

The hosts file creates static associations between IP addresses and hostnames or domains which the system prioritizes before DNS for name resolution. Open this file in a text editor and add a line for your Linode’s public IP address. You can associate this address with your Linode’s Fully Qualified Domain Name (FQDN) if you have one, and with the local hostname you set in the steps above. In the example below, 203.0.113.10 is the public IP address, example-hostname is the local hostname, and example-hostname.example.com is the FQDN.

After opening a SSH connection and running

nano /etc/apache2/apache2.conf

The host file can now be edited. After scrolling to the bottom of the page to add the new lines I looked back at the example in the documentation:

127.0.0.1 localhost.localdomain localhost
203.0.113.10 example-hostname.example.com example-hostname

Is this the correct format?

127.0.0.1 localhost.localdomain localhost
104.123.155.24 newhostuser.104.123.155.24 newhostuser

Solution

You can add HostName entry in /etc/hosts file. If you want to run Apache on IP address then you can edit Listen entry in apache2.conf file.



Answered By - Pandurang
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing