Install Apache Server and PHP on CentOS

Install Apache:
Run the following command:

# sudo yum install httpd mod_ssl

Once the installation is completed, you need to stat the Apache manully by running the below command:

sudo service httpd restart

Config Apche:
Open the Apache config file by running the below command:

# sudo nano /etc/httpd/conf/httpd.conf

Note: use nano Editor, If its not installed on your server, then run the below command to install nano editor
# sudo yum install nano 


Then, locate the ServerName in apache config file as mentioned below:
#ServerName www.example.com:80

Enter your server Hostname or fully qulified domain name. In the following example:

EX: ServerName YOUR_HOST_NAME 

Then, Restart the Apache
# sudo service httpd restart

Test Apache:
Navigate to your server IP - http://YOUR_SERVER_IP

If the default CentOS Apache “welcome” screen is displayed, the installation was successful. 

Contact CtrlSwitches support if you have any problems.

Install PHP:
Run the following command to install PHP:

# sudo yum install php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml

Then, restart the Apache server
# sudo service httpd restart

You have been successfully install Apache server and PHP on your server!!

  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

Install LAMP on Ubuntu

LAMP stack is nothing but a combination of open source softwares to make a webserver. LAMP refers...

Optimize Apache web server in cPanel/WHM

cPanel & WHM manages the Apache web server and its components with EasyApache. When you will...

Proxy Servers

Proxy server is a computer that sits between a client computer and the Internet, and provide...

Types of Web Servers

ScopeHosts provides web hosting services on Apache web serves as default, you can change or add...

Web servers

Web servers are computers that delivers web pages to clients, in response to thier requests,...