Articles with tag - apache

Install LAMP in CentOS 7

Posted on 3 years ago by Ping Cheng

Overview

LAMP is a term that stands for Linux, Apache, MySQL and PHP. LAMP provides the basic service for the web hosting. Most website application like WordPress requires those services. This guide will list the command you need to use for LAMP installation in CentOS 7. All commands should be run in the Terminal unless specific required

Steps

Step 1 - Install Apache Service

Apache is a service that runs under Linux system to provide web service through HTTP. To install Apache, we use this command to install:

sudo yum install httpd

After installation finish, use this command to start the Apache:

sudo systemctl start httpd.service

Now your Apache service is running. To check if it is running, accessing http://localhost or http://[IP address] by Firefox. If Apache is working, Firefox would display a page with "Testing 123..." If you would like to start Apache on boot, please input this command:


sudo 

...

[ Read More ]


Fixing "You don't have permission to access / on this server"

Posted on 3 years ago by Ping Cheng

Sometimes after you installed a fresh linux system such as CentOS and implemented the LAMP on it. Then you found when you were trying to access the local web server, the web browser display some error message like "You don't have permission to access / on this server". This really ruins the day.

All the reason of this happening because the system didn't assign the proper permission for the "DocumentRoot". By the default, DocumentRoot (/var/www) is owned by user "apache" and the group "apache", but somehow some times it belongs to user "root" and user "apache" don't have permission to read and execute it. This usually also happened after you relocated your DocumentRoot path into a new directory.

To fix the issue, you need to reassign the permission to the DocumentRoot. Run the terminal and move to DocumentRoot:

$ cd /var/www

Then we are going to change the owner of directory of html:

$ sudo chown -R apache html/

After we modified the ownership o

...

[ Read More ]

Search
Hand crafted with by Ping Cheng