#centos

How to manage selinux in CentOS

SElinux means Security-Enhanced Linux is a Linux kenel security module that provides the mechanism for supporting access control security policies. So I will show you some commands to answer the question how to manage selinux.

To show status of Selinux:

To change selinux policies (e.g: httpd_can_network_connect_db parameter) :

That’s all ūüôā

Install PHP Web server on Centos

When you have a new VPS installed CentOS to use as web server, you need install some basic packets as apache, mysql, php and setup web server.  You will ask yourself that how to install php web server on CentOS? So I will show you steps to implement it as the below.

Installing httpd:

Make sure that you have root permission

Install mysql server:

Installing PHP:

Now, we will setup web server for new domain that was pointed to the ip address of new VPS.

Create web directory:

Create a test file:

Open httpd.config file:

Add lines below to the bottom of httpd.conf file:

Check iptables firewall to make sure that port 80 is opened:

Or open port 80 if needed:

So now, you can access your website  example.com.