(ve):Install LAMP on Fedora 12

  • This page was last modified on March 8, 2011, at 11:48.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

Contents

Install

  • Log in to your (ve) server as root or another user with sudo privileges:

ssh root@example.com
  • Make sure your server is up to date:
yum update

Apache

For this example, the IP is 12.34.56.78 and the domain is ve-server1.com. Be sure to change these values to yours. The NameVirtualHost line is your IP address, which you can easily find in your AccountCenter Server Guide.

  1. Install the latest version of Apache.
    yum install httpd
    
  2. Next, we need to create a vhost.conf file in /etc/httpd/conf.d/:
    touch /etc/httpd/conf.d/vhost.conf
    
  3. Then, we need to add the following code:
    /etc/httpd/conf.d/vhost.conf
    
    
    NameVirtualHost 12.34.56.78:80
    
    
    <VirtualHost 12.34.56.78:80>
    ServerAdmin webmaster@ve-server1.com
    ServerName ve-server1.com
    ServerAlias www.ve-server1.com
    DocumentRoot /var/www/ve-server1.com/html/
    ErrorLog /var/www/ve-server1.com/logs/error.log
    CustomLog /var/www/ve-server1.com/logs/access.log combined
    </VirtualHost>
    
    
  4. Now we will create the directory for the site:
    mkdir -p /var/www/ve-server1.com/{html,logs}
    
  5. We will create a test file to make sure things are working correctly.
    echo '<html><head><title>ve-server1.com</title></head><body><h1>Hello, World!</h1></body></html>' > /var/www/ve-server1.com/html/index.html
    
  6. Then let's configure Apache to start at boot-up.
    chkconfig --levels 235 httpd on
    
  7. Now start Apache:
    /etc/init.d/httpd start
    

We should now be able to point our browser to the IP address to see the default "Hello, World!" page: IMAGE GOES HERE

MySQL

  1. Run this command to install MySQL:
    yum install mysql mysql-server
    
  2. Then we'll configure the system startup links for MySQL. We want MySQL to start automatically whenever the system boots and start the MySQL server:
    chkconfig --levels 235 mysqld on
    /etc/init.d/mysqld start
    
  3. The following command will walk you through setting your MySQL root password, removing anonymous users, disabling remote root access, and removes the test database. Remember to choose a strong password. Read our article on Strong password guide.
    mysql_secure_installation
    

PHP

  1. Use this to install PHP5 and the Apache PHP5 module:
    yum install php
    
  2. Then restart Apache
    /etc/init.d/httpd restart
    
  3. Next, let's add MySQL support in PHP by adding the php-mysql package. This is where/when you would also add any PHP modules. If you're looking for more PHP modules you can run a search:
    yum search php
    
  4. You can install whichever modules you wish, including PHP MySQL support, like this:
    yum install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mssql php-shout php-snmp php-soap php-tidy
    
  5. Once again, restart Apache
    /etc/init.d/httpd restart
    

Security

Follow these articles to make your server more secure: