Here are the steps to setup LAMP in Ubuntu:
- Execute this command in terminal: sudo apt-get install apache2 php5 php5-gd mysql-server-5.0 phpmyadmin. During this operation, you'll be prompted to enter some information needed.
- Test if setup was successful by opening your browser and entering "http://localhost/".
- Execute in terminal: sudo vim /etc/apache2/apache.conf. At this point, you'll be editing a file using vim to configure Apache2 to work with phpMyAdmin.
- Add this line at the bottom of the file: Include /etc/phpmyadmin/apache.conf
- Restart apache by executing this command in terminal: sudo /etc/init.d/apache2 restart
- Open your browser and go to "http://localhost/phpmyadmin/"
- You might notice that there is an error message when you restart apache w/c says "Apache2: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName". To remove this, execute the command: echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn. "man tee" if you need information on the command.
- Then try restarting Apache2 again. If all is good, proceed to the next step.
- The default location where web documents are stored would be on /var/www/ though the folder requires owner permission. What I did is configured Apache2 to look for the files in /home/[user]/public_html. To do this, copy /etc/apache2/sites-available/default to /etc/apache2/sites-available/[name_you_would_like] by executing the command: sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/[name_you_would_like].
- Edit the newly copied file: sudo vim /etc/apache2/sites-available/mine
- Change the DocumentRoot and Directory to /home/[user]/public_html/
- Disable the default configuration file and enable the new one: sudo a2dissite default && sudo a2ensite [name_of_new_configuration_file]
- Reload the new configuration: sudo /etc/init.d/apache2 reload
- Restart Apache2: sudo etc/init.d/apache2 restart
- Done.
References:
Update: I just found out after installing wordpress that you need to do:
chmod -R a+w /home/[user]/public_html/
0 comments:
Post a Comment