Photo by Christina Morillo: https://www.pexels.com/photo/person-using-silver-macbook-pro-1181467/

Installing & Configuring Apache On Your Dedicated Server

Before installing PHP or MySQL, the first thing you need to do is install Apache on your dedicated server. In order to do that you simply need to access the command line of your server and log in as the root user:

  1. Connect your server via SSH
  2. Run this command: sudo su –
  3. Enter your server password

You now have root access.

Once you have that, you can install Apache using the ‘Yum‘ command:

[root@admin]# yum install httpd
Loaded plugins: fastestmirror, langpacks
base
| 3.6 kB 00:00:00
extras
| 3.4 kB 00:00:00
updates
| 3.4 kB 00:00:00
extras/7/x86_64/primary_d
| 121 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirror.sigmanet.com
* extras: linux.mirrors.es.net
* updates: mirror.eboundhost.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-45.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-45.el7.centos for package:
httpd-2.4.6-45.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.645.el7.centos.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-45.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Installed:
httpd.x86_64 0:2.4.6-45.el7.centos

Dependency Installed:
httpd-tools.x86_64 0:2.4.6-45.el7.centos
mailcap.noarch 0:2.1.41-2.el7

Complete!
[root@admin]#

Once Apache is installed, the next thing you need to do is configure it and then make sure it works on your server, use the following command:

[root@admin]# systemctl start httpd && systemctl enable httpd

To make sure the Apache services are running on your server:

[root@admin] sudo systemctl status httpd

This will show you an active status if the service is running on your dedicated server.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.