CentOS 7 – No Network Connection

KB ID 0001047 

Problem

A while ago I spun up a CentOS server in VMware Workstation, and I could not get it connected to the network, I was in a bit of a hurry, so I blew it away and just built a new server with CentOS 6. This week I’ve been using VirtualBox and spun up a new CentOS 7 server and had the same problem.

Solution

1. Quite why CentOS 7 does this I’m not sure, My NIC is called enp0s3 (run ‘ip addr’ to find yours). Then take a look at;

[box]cat/etc/sysconf/network-scripts/{interface name}[/box]

As you can see (above), the ONBOOT section is set to ‘no’.

2. Use the VI editor (because you wont have Nano installed yet) to edit the file (Press I to insert > Edit the file > Escape > :wq {Enter}).

3. Reboot the server, and now we have comms!

 

Related Articles, References, Credits, or External Links

NA

 

Apache Web Server – Change the Default Page

KB ID 0000882 

Problem

Out of the box, Apache expects your website homepage to be called index, on this site the homepage is called home, here’s how to change it.

Solution

1. Connect to the server via SSH, (or open a terminal session). The file you need to edit is called httpd.conf. This server is running CentOS, so you should find that file in the /etc/httpd/conf folder.

2. I’m going to edit it with nano.

3. Locate the DirectoryIndex section and remove index and any other unwanted filename (i.e. in this example index.var).

4. Add in the one you require and save and exit, (press CTRL+X and Y to save).

5. You nee to restart Apache for the change to take effect.

[box] apachectl -k restart[/box]

 

Related Articles, References, Credits, or External Links

NA