Professional Documents
Culture Documents
Requirements
Depending on the used distribution, RHEL or CentOS 7.0, use the following links to perform a minimal
system installation, using a static IP Address for network configuration.
1. After performing a minimal system installation and configure your server network interface with a Static
IP Address on RHEL/CentOS 7.0, go ahead and install Apache 2.4 httpd service binary package provided
form official repositories using the following command.
2. After yum manager finish installation, use the following commands to manage Apache daemon, since
RHEL and CentOS 7.0 both migrated their init scripts from SysV to systemd – you can also use SysV and
Apache scripts the same time to manage the service.
OR
OR
3. On the next step start Apache service using systemd init script and open RHEL/CentOS 7.0 Firewall rules
using firewall-cmd, which is the default command to manage iptables through firewalld daemon.
# firewall-cmd --add-service=http
NOTE: Make notice that using this rule will lose its effect after a system reboot or firewalld service restart,
because it opens on-fly rules, which are not applied permanently. To apply consistency iptables rules on
firewall use –permanent option and restart firewalld service to take effect.
# firewall-cmd --state
# firewall-cmd --list-all
# firewall-cmd --list-interfaces
# firewall-cmd --get-service
# firewall-cmd --query-service service_name
# firewall-cmd --add-port=8080/tcp
4. To verify Apache functionality open a remote browser and type your server IP Address using HTTP
protocol on URL (http://server_IP), and a default page should appear like in the screenshot below.
Apache Default Page
5. For now, Apache DocumentRoot path it’s set to /var/www/html system path, which by default doesn’t
provide any index file. If you want to see a directory list of your DocumentRoot path open Apache welcome
configuration file and set Indexes statement from – to + on <LocationMach> directive, using the below
screenshot as an example.
# nano /etc/httpd/conf.d/welcome.conf
6. Close the file, restart Apache service to reflect changes and reload your browser page to see the final
result.
7. Before installing PHP5 dynamic language support for Apache, get a full list of available PHP modules
and extensions using the following command.
8. Depending on what type of applications you want to use, install the required PHP modules from the above
list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.
9. To get a full information list on PHP from your browser, create a info.php file on Apache Document Root
using the following command from root account, restart httpd service and direct your browser to the
http://server_IP/info.php address.
10. If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment
date.timezone statement, append your physical location and restart Apache daemon.
# nano /etc/php.ini
Locate and change date.timezone line to look like this, using PHP Supported Timezones list.
date.timezone = Continent/City
11. Red Hat Enterprise Linux/CentOS 7.0 switched from MySQL to MariaDB for its default database
management system. To install MariaDB database use the following command.
12. After MariaDB package is installed, start database daemon and use mysql_secure_installation script to
secure database (set root password, disable remotely logon from root, remove test database and remove
anonymous users).
13. To test database functionality login to MariaDB using its root account and exit using quit statement.
mysql -u root -p
MariaDB > SHOW VARIABLES;
MariaDB > quit
Create a phpMyAdmin folder and extract the package into it with the following command.
In a web browser, type the URL of your phpMyAdmin installation. This URL is the public DNS address
(or the public IP address) of your instance followed by a forward slash and the name of your installation
directory. For example:
http://my.public.dns.amazonaws.com/phpMyAdmin