LAMP Server Fedora 14 (Install apache php mysql phpmyadmin)
- Wednesday, November 17, 2010, 15:21
- How To?
- Views: 5,623
- 4 comments
If you want to host a database driven website, LAMP (Linux Apache MySql Php) is the way to go. In addition you would need to install phpmyadmin as well to manage the database with ease. Going for linux based web-server is recommended just for the sake of convenience and security, given you are comfortable with it. I have personally felt that the installation of LAMP is far easier on Ubuntu with tasksel, may be there is something similar for Fedora?
Step 1: Install mysql client and server in the first step. Become root by typing “su -“ at a terminal
yum install mysql mysql-server
After the installation you can restart the mysql-server by doing this
/etc/init.d/mysqld restart
Next you need to setup the root password for the server, start the setup process by doing this
mysql_secure_installation
You would be asked for the current root password which is blank to begin with, so just press enter, next you would be asked to set the new root password for the mysql server, after which you would be asked a few Y/n questions, answers to which are not difficult to guess. I chose Y for all of them (it asks you to remove anonymous user, which you should do, it is up to you if you want to disable remote access as root).
Step 2: Install apache2 its called httpd inside Fedora after the installation start the server
yum install httpd
/etc/init.d/httpd start
Now you can test if your web-server is up and running by opening the http://localhost in your web browser. You should see a page like this.
Step 3: Time to install and test php support. Install it by doing
yum install php mod_suphp
Before we test for php support, you need to restart http server by doing this
/etc/init.d/httpd restart
Now create a info.php file using your favorite text editor, say vi
vi /var/www/html/info.php
and paste the following content in it and save the file.
<?php
phpinfo();
?>
Remember: the /var/www/html is your root web folder, whatever you put in there would become visible to the rest of the world via your web server. Now open the file you created above by pointing your browser to http://localhost/test.php, if you have followed the steps so far correctly you should see something like this
Step 4: Install additional php related packages, especially the one necessary to communicate with mysql and other webserver modules etc.
yum install php-mysql php-magickwand php-devel php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magpierss php-mapserver php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
Restart the http server by doing
/etc/init.d/httpd restart
If you refresh the info.php now, you would see all the additional .ini files that get parsed.
Now to ensure that the web server as well as mysql server starts on its own at every boot, do the following (while being root with su – and not su alone)
chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on
Step 5: Finally install phpmyadmin
yum install phpmyadmin
Restart apache (httpd) again. If you want to allow phpmyadmin connection from other locations other than localhost, then modify the following file
gedit /etc/httpd/conf.d/phpMyAdmin.conf
by commenting out the following lines
<Directory /usr/share/phpMyAdmin/>
order deny,allow
deny from all
allow from 127.0.0.1
allow from ::1
</Directory>
basically replacing the lines above with
#<Directory /usr/share/phpMyAdmin/>
#order deny,allow
#deny from all
#allow from 127.0.0.1
#allow from ::1
#</Directory>
Now you are all set just restart the httpd again by doing
/etc/init.d/httpd restart
And you should have a perfect web server running. You can access the phpmyadmin from http://your_server_address/phpmyadmin
You might also like
About the Author
4 Comments on “LAMP Server Fedora 14 (Install apache php mysql phpmyadmin)”
Trackbacks
Write a Comment
Gravatars are small images that can show your personality. You can get your gravatar for free today!
Hey!
I did– /etc/init.d/mysqld restart
The code stops mysql, but it fails to start it again…
How do I get mysql to start?
Like or Dislike:
0
0
[Reply]
lifehacker Reply:
January 31st, 2011 at 3:03 pm
@Greg,
/etc/init.d/mysqld start
Should start it again.
Like or Dislike:
0
0
[Reply]
When i install php mod_suphp and restart httpd server.
I got following error:
Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 5 of /etc/httpd/conf.d/suphp.conf: API module structure ‘suphp_module’ in file /etc/httpd/modules/mod_suphp.so is garbled – expected signature 41503232 but saw 41503230 – perhaps this is not an Apache module DSO, or was compiled for a different Apache version?
[FAILED]
how can i solve this problem ??
Like or Dislike:
0
0
[Reply]