How to install Apache web server on CentOS

2Fast2BCn

New member
Joined
May 27, 2016
Messages
10
Points
0
Apache HTTP Server is an open source server available for modern operating systems such as Unix and Windows, Apache allows you to use many features of your server but especially one of the most popular web programming languages is PHP. For more information, visit the official website at: httpd.apache.org

If you have bought a VPS, Cloud or a dedicated server and it is activated for using then you can install it on your web hosting (assuming it is not already installed).

How to proceed:
First open the terminal and run the command to install Apache web server:

Code:
yum install httpd
To enable the services to run at boot time in case of a re-boot

Code:
chkconfig –levels 235 httpd on
you must now set up virtual hosting on port 80.

To do this you must open the httpd file located at /etc/httpd/conf/httpd.conf
At this point you need to uncomment the line "* 80". To find it you can search the text: "NameVirtualHost".
At this point it is necessary to save the file and restart our Apache.

The command to restart your web server:

Code:
service httpd restart
Now you can test the operation of our web server by going to the browser and typing the address:

Code:
http://Your_domain
If everything is configured correctly you will see the page with the details of Apache.

apache-test-page.png
 

Dewlance

Member
Joined
Dec 20, 2014
Messages
91
Points
8
Apache installation is bit easy but main part it configuration, Post more info on how to configure domain and how to create domain.

This apache page only work on IP Address but how can you setup your custom domain name like example .com ?

I never use only apache and always use it with some control panel which automatically install all required software.
 

CyberAlchemist

New member
Joined
Feb 9, 2013
Messages
245
Points
0
Apache installation is bit easy but main part it configuration, Post more info on how to configure domain and how to create domain.

I never use only apache and always use it with some control panel which automatically install all required software.
Exactly, if we install Apache on a hosting, it will require many configurations to add sites and it's more easier to do that with a hosting control panel

This apache page only work on IP Address but how can you setup your custom domain name like example .com ?
I am sure you will need to use this method if you want to add a site like example .com to your hosting

Code:
sudo mkdir /var/www/example_site 
sudo chmod -R 755 /var/www/example_site
and adding vhost to add this new domain to hosting

Code:
<VirtualHost example.com>
       ServerAdmin webmaster@localhost
       #We want to be able to access the web site using www.example.com or example.com
       ServerAlias www.example.com
       DocumentRoot /var/www/example_site
       #log file for this server
       CustomLog /var/log/apache2/www.example.com-access.log combined
</VirtualHost>
It is more complex than this and I would go with a hosting panel like mentioned above.
 

Inquestor

Well-known member
Joined
Feb 1, 2013
Messages
495
Points
63
Webmin/Virtualmin is the best and cheapest option I have found and works pretty good for the price. I do prefer cPanel for running sites but on multiple servers it gets expensive
 

2Fast2BCn

New member
Joined
May 27, 2016
Messages
10
Points
0
This apache page only work on IP Address but how can you setup your custom domain name like example .com ?
It requires some configurations in virtual host file.

I do prefer cPanel for running sites but on multiple servers it gets expensive
Why don't you find other hosting panels like Plesk or Directadmin, they are paid ones but more cheaper than cPanel.
 

wpf

New member
Joined
Dec 17, 2016
Messages
3
Points
0
For newbi user i recommend using Lamp or like centmin
 

iserveradmin11

New member
Joined
Mar 17, 2017
Messages
6
Points
0
Hello,
One can easily download by running following command :
RHEL /CENTOS
yum install httpd

UBUNTU :
apt-get install apache2

And after that we configure the configuration file accordingly.
 
Older threads
Replies
0
Views
4,594
Replies
2
Views
3,759
Replies
5
Views
2,080
Replies
1
Views
2,009
Latest threads
Replies
0
Views
591
Replies
2
Views
791
Recommended threads
Replies
8
Views
3,243
Replies
3
Views
2,402
Replies
20
Views
8,985

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top