1) Change to root user
su
##OR##
su -c
2) Check or install updates
yum check-update
##OR##
yum update
3) Install Apache(httpd) web server
yum install httpd
4) install PHP and PHP modules
yum install php php-common
##PHP MODULES##
yum install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
5) Start Apache(httpd) and start Apache(httpd) on boot
systemctl start httpd.service ##will start httpd##systemctl enable httpd.service ##will enable httpd service on boot##
##OR##
service httpd start
chkconfig –levels 235 httpd on
6) Enable Remote Connection to Apache HTTP Server (httpd) –> Open Web server Port (80) on Iptables Firewall
6(a) Edit /etc/sysconfig/iptables :
vi /etc/sysconfig/iptables
6(b) Add following INPUT rule:
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
6(c) Restart Iptables Firewall:
systemctl restart iptables.service
##OR##
service iptables restart
7) Test Apache and PHP
7(a) Test Apache:
To test Apache web server open web browser and type “http://localhost/”
you will see a Fedora Test page For Apache HTTPD Server7(b) Test PHP:Create test PHP page to check that Apache, PHP and PHP modules are working by adding following content to/var/www/html/test.php file.<?phpphpinfo();?>
Now open the browser and type “http://localhost/test.php”
Thanks for reading. If you have any suggestions or query, please feel free to comment.
No comments:
Post a Comment