Tuesday, August 28, 2012

Install Apache and PHP on Fedora 17/16











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##
##Will start MySql##

Akshay Vyas: http://www.gofedora.in/
Copyright gofedora.in - All Rights Reserved
##Will start MySql##

Akshay Vyas: http://www.gofedora.in/
Copyright gofedora.in - All Rights Reserved
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 Server
 

7(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.
<?php

    phpinfo();

?>
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.
 

5 comments:

sarabjeet said...

Really like that you are providing such information on PHP MYSQl with JAVASCRIPT ,being enrolled at http://www.wiziq.com/course/5871-php-mysql-with-basic-javascript-integrated-course i really thank you for providing such information it was helpful.

JuiCe said...

where is located fedora test page?

Akshay Vyas said...

fedora test page is located in "/usr/share/httpd/noindex/index.html" and you can change the way Apache shows welcome page from /etc/httpd/conf.d/welcome.conf

Anonymous said...

I get pleasure from, lead to I found just what I used to be having a look for.
You have ended my 4 day long hunt! God Bless you
man. Have a great day. Bye

my web page - wedding shower game prizes (http://es-el.com)

Anonymous said...

Nice post! It worked perfectly, which normally doesn't happen. Once again, thanks!

Post a Comment

Related Posts Plugin for WordPress, Blogger...