Now that we know our server has been configured. We can install Apache. Apache has just one purpose, which is to display websites on other peoples web browsers. So if we have a site stored on our computer which we are now using as a server. And Apache is installed on it. Then people can type the IP address of the computer or the domain for that IP address into their web browser. When they do this they will see the website on your computer.
Okay so lets get started.
Apache is currently in the Fedora Repos. So we should have no problems installing it using YUM. So we simply type the following commands.
yum install httpd -y
The above will download apache from the Fedora Repo on the server. Then it will install it. Notice that I used the -y in the command. This says yes install it, and yum wont ask us later.
Now that Apache is installed on the server. We will make it so it starts every time the server gets turned on. To do this we will type the following.
chkconfig httpd on
Now that Apache has been turned on we will start it up. Their is a ton of documentation that says to use the following commands to start Apache.
And yes it will work. However you will see Fedora saying that it is forwarding the request over to systemctl. The reason for this is because newer versions of Fedora are porting over to systemctl. And more and more programs are starting to utilize it. This means while some programs may still work using the above command. It is recommended to use the systemctl command. The following command shows you how to start Apache with systemctl.
systemctl start httpd.service
Now that Apache has been started. We should be able to see the Apache test page. On so on another computer try going to the test page. In yesturdays example we had our server on the IP address of 192.168.1.101. So if our computer is in the same network as our server we will simply need to type that IP address into the browsers address bar.
If you don’t see the apache test page you may need to do a few things. First since Apache is designed to display web pages, it utilizes Port 80 and for secure pages it will utilize port 8080. So on our server we will need to check our firewall and make sure that Port 80 is not being blocked. To do this we will type the following command.
The above command will bring up a blue screen that looks like the following.
From here their are a few things we can do. The fastest simplest thing to do is hit the space bar and uncheck the box that says Enabled. This will disable the Firewall completely. I however don’t recommend that. Since the firewall is their to protect us. So we will only disable part of the firewall. The part of the firewall that blocks Port 80.
So what we will do is use our tab key to highlight the Customize button. Once it is highlighted. We will hit enter. This will bring us up to list of different items we can enable and disable. We will use our arrow keys and scroll down to where it says HTTP (WWW) and check it. By pressing the spacebar. Then we will use our tab key to navigate to the close button, then we will press the Enter key. Next we will use the Tab key to navigate to the Ok button and we will press Enter again. Then we will use the Tab key and to navigate to the Yes button and Press Enter again.
Now we should be able to see the test page in web browser from another computer on our network. But don’t call your uncle Joe who is 400 miles away and tell him to view the test page by typing in the IP Address you just typed in. Because that is just your internal IP Address. And he might be using a Linksys router that has the same IP scheming but he he would only be using his IP addresses. So it is kind of pointless.
If you want other people outside of your network to see the website. You will need to know the external IP address. The best way to find this out is by going to IP Chicken. As soon as you go to the IP Chicken site you will see your External IP address. This will be the address you want to give everyone who you want to visit your site.
If your friends can’t see your site. Then this means that either your router is blocking Port 80 or your ISP company is. So we will try achieving the easiest first. Which is to check to see if our router is blocking Port 80. If your using a Linksys router you can do this by opening up a web browser on a computer that is wired to your router. And typing in the routers IP address. This is the gateway IP address. So it will most likely be 192.168.1.1
This will bring a pop up window asking you for your user name and password. If you have never accessed your router threw the web browser before. Then your router will have the default user name and password. You should RTFM to find this out. However if your using a Linksys router then the default user name and password is nothing for the user name. And admin for the password. These means leave the user name field blank and type in admin for the password.
Now you should have access to your router.
Now we will use our mouse and click on Applications & Gaming. And we will look for something that says looks like the following.
|External Port||Internal Port||Protocol||To IP Address||Enabled|
So what we want to do is enable port 80 on our router. And want to make sure 192.168.1.xxx points to our servers internal IP address. In our case it will be 192.168.1.101, now we will save our changes. Once this has been done. We should be able to see the website from outside of out network. If we don;t see it outside of our network this means our ISP company has blocked Port 80. This requires us to use that thing that is kind of out dated known as phone. And call them. Once we talk to them we tell them that we need port 80 unblocked. Now we should have absolutely no problems seeing our web page outside of our network.